[英]Test Result Report in Jenkins Pipeline using Groovy | Pipeline Execution | Report Types
我正在詹金斯(Jenkins)中建立针对以各种测试框架(NUnit,MSTest等)编写的测试项目的测试结果报告,并且希望增进我对报告类型以及管道执行阶段和发布之间的区别的理解。
Pipeline Execution 管道执行
Stages are executed in the order in which they appear and if there are any stages after and the one before fails the following stages will not get executed. 阶段按照它们出现的顺序执行,并且如果后面有任何阶段,而前一个阶段失败,则以下阶段将不会执行。
Where post gets executed regardless of whether or not the stages completed successfully or not, after the stages execution. 在阶段执行之后,无论阶段是否成功完成,都将在何处执行发布。
Report Types 报告类型
Provided I have a stage (produces test result): 如果我有一个阶段(产生测试结果):
stage('MSTest') {
steps {
bat(script: 'dotnet test "..\\TestsProject.csproj" --logger "trx;LogFileName=TestResult.xml"')
}
}
And a post that runs always (consume test result to produce test result report): 并始终运行一个帖子(消耗测试结果以生成测试结果报告):
post {
always {
xunit testTimeMargin: '5000', thresholdMode: 1, thresholds: [], tools: [ReportType(deleteOutputFiles: true, failIfNotNew: false, pattern: '..\\TestResult.xml', skipNoTestFiles: false, stopProcessingIfError: false)]
}
} }
Project variations: 项目变化:
Provided my test project is written in NUnit the 'ReportType' method in 'tools:' will need to be replaced with NUnit3 for the post to execute successfully. 如果我的测试项目是用NUnit编写的,则“ tools:”中的“ ReportType”方法将需要替换为NUnit3,以使帖子成功执行。
Provided my test project is written in MSTest the 'ReportType' method in 'tools:' will need to be replaced with MSTest for the post to execute successfully. 如果我的测试项目是用MSTest编写的,则“ tools:”中的“ ReportType”方法将需要用MSTest替换,以使帖子成功执行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.