无法在 Jenkins 中收集机器人框架报告
Unable to do robot framework reports collection in Jenkins
我正在尝试 运行 4 个测试脚本 并行。我想按以下方式为每个测试脚本存储 output.xml
文件-
Test_1 -> output1.xml
Test_2 -> output2.xml
.
.
Test_4 -> output3.xml
并将它们组合在一起并生成一个 report.html
文件
我收到一些与 output.xml 文件位置相关的错误。
我的脚本在Jenkins
到运行机器人-
pipeline {
agent any
triggers {
cron('H */4 * * 1-5')
}
stages {
stage('Testing') {
parallel{
stage('Testing- Operator') {
steps {
sh '''robot //var//jenkins_home//workspace//Testing_Operator//Operator.robot
robot archiveDirName:\'robot-plugin\',logFileName: \'**/log*.html\',outputFileName:\'**/output*.xml\',outputPath:\'/var/jenkins_home/workspace/Testing_Pipeline\',overwriteXAxisLabel: \'\',reportFileName:\'**/report*.html\''''
}
}
stage('Testing -Manager') {
steps {
sh '''robot //var//jenkins_home//workspace//Testing_Manger//Manager.robot
robot archiveDirName:\'robot-plugin\',logFileName: \'**/log*.html\',outputFileName:\'**/output*.xml\',outputPath:\'/var/jenkins_home/workspace/Testing_Pipeline\',overwriteXAxisLabel: \'\',reportFileName:\'**/report*.html\''''
}
}
stage('Testing -Admin') {
steps {
sh '''robot //var//jenkins_home//workspace//Testing_Admin//Admin.robot
robot archiveDirName:\'robot-plugin\',logFileName: \'**/log*.html\',outputFileName:\'**/output*.xml\',outputPath:\'/var/jenkins_home/workspace/Testing_Pipeline\',overwriteXAxisLabel: \'\',reportFileName:\'**/report*.html\''''
}
}
stage('Testing -Owner') {
steps {
sh '''robot //var//jenkins_home//workspace//Testing_Owner//Owner.robot
robot archiveDirName:\'robot-plugin\',logFileName: \'**/log*.html\',outputFileName:\'**/output*.xml\',outputPath:\'/var/jenkins_home/workspace/Testing_Pipeline\',overwriteXAxisLabel: \'\',reportFileName:\'**/report*.html\''''
}
}
}
}
}
}
这是错误-
Output: /var/jenkins_home/workspace/Testing_Pipeline/output.xml
[ ERROR ] Reading XML source '/var/jenkins_home/workspace/Testing_Pipeline/output.xml'
failed: ParseError: not well-formed (invalid token): line xx, column xx
错误的可能原因是什么?语法正确吗?
可能 output.xml
由于 运行 robot
并行而损坏。
你可以做的是让所有 robot
命令使用不同输出路径(或文件名)的标志,并在最后阶段调用 rebot
来生成最终报告和日志。
我正在尝试 运行 4 个测试脚本 并行。我想按以下方式为每个测试脚本存储 output.xml
文件-
Test_1 -> output1.xml
Test_2 -> output2.xml
.
.
Test_4 -> output3.xml
并将它们组合在一起并生成一个 report.html
文件
我收到一些与 output.xml 文件位置相关的错误。
我的脚本在Jenkins
到运行机器人-
pipeline {
agent any
triggers {
cron('H */4 * * 1-5')
}
stages {
stage('Testing') {
parallel{
stage('Testing- Operator') {
steps {
sh '''robot //var//jenkins_home//workspace//Testing_Operator//Operator.robot
robot archiveDirName:\'robot-plugin\',logFileName: \'**/log*.html\',outputFileName:\'**/output*.xml\',outputPath:\'/var/jenkins_home/workspace/Testing_Pipeline\',overwriteXAxisLabel: \'\',reportFileName:\'**/report*.html\''''
}
}
stage('Testing -Manager') {
steps {
sh '''robot //var//jenkins_home//workspace//Testing_Manger//Manager.robot
robot archiveDirName:\'robot-plugin\',logFileName: \'**/log*.html\',outputFileName:\'**/output*.xml\',outputPath:\'/var/jenkins_home/workspace/Testing_Pipeline\',overwriteXAxisLabel: \'\',reportFileName:\'**/report*.html\''''
}
}
stage('Testing -Admin') {
steps {
sh '''robot //var//jenkins_home//workspace//Testing_Admin//Admin.robot
robot archiveDirName:\'robot-plugin\',logFileName: \'**/log*.html\',outputFileName:\'**/output*.xml\',outputPath:\'/var/jenkins_home/workspace/Testing_Pipeline\',overwriteXAxisLabel: \'\',reportFileName:\'**/report*.html\''''
}
}
stage('Testing -Owner') {
steps {
sh '''robot //var//jenkins_home//workspace//Testing_Owner//Owner.robot
robot archiveDirName:\'robot-plugin\',logFileName: \'**/log*.html\',outputFileName:\'**/output*.xml\',outputPath:\'/var/jenkins_home/workspace/Testing_Pipeline\',overwriteXAxisLabel: \'\',reportFileName:\'**/report*.html\''''
}
}
}
}
}
}
这是错误-
Output: /var/jenkins_home/workspace/Testing_Pipeline/output.xml
[ ERROR ] Reading XML source '/var/jenkins_home/workspace/Testing_Pipeline/output.xml' failed: ParseError: not well-formed (invalid token): line xx, column xx
错误的可能原因是什么?语法正确吗?
可能 output.xml
由于 运行 robot
并行而损坏。
你可以做的是让所有 robot
命令使用不同输出路径(或文件名)的标志,并在最后阶段调用 rebot
来生成最终报告和日志。