标题翻译
Jenkins pipeline - Separating unit tests and integration test results
问题
我正在使用JenkinsFile来管理我们的流水线。
自从我们集成了maven-failsafe-plugin来分别运行单元测试和集成测试以来,我们从这两个插件得到了单独的结果报告。
以下是我在JenkinsFile中在post部分配置的方式:
junit testResults: '**/target/surefire-reports/*.xml, **/target/failsafe-reports/*.xml'
我本来希望Jenkins能够分别显示单元测试和集成测试,但不幸的是,Jenkins合并了两者的XML结果,单元测试和集成测试之间没有明确的区别。
我们希望构建具有集成测试结果的单独视图。
在Jenkins中是否有方法可以实现这一点?
英文翻译
I'm using JenkinsFile to manage our pipeline.
Since, we integrated maven-failsafe-plugin to run the unit tests and integration tests separately, we get separate result reports from both plugins.
This is how i configured the same in JenkinsFile in the post section:
junit testResults: '**/target/surefire-reports/*.xml, **/target/failsafe-reports/*.xml'
I would have expected Jenkins to show unit tests and integration tests separately, but unfortunately, Jenkins merges the results of both XML and there is no clear distinction between unit test and integration tests.
We want our builds to have a separate view on Integration tests results.
Is there anyway to do that with Jenkins?
答案1
得分: 0
我不知道在Jenkins本身中如何实现这一点,但也许有一种变通方法。在使用mvn clean verify
之后,您可以在Jenkins流水线中使用mvn site
命令,并构建一个HTML表示。这些测试结果被分为failsafe和surefire,并且您可以直接从工作区打开它,查看failsafe和surefire插件的不同结果。
英文翻译
I dont know a way how to do that in Jenkins itself, but maybe a workaround. After you use mvn clean verify
you can use mvn site
in a jenkins pipeline and build a HTML representation. These testresults are splitted between failsafe and surefire and you can open it directly from your workspace and look into the diffrent results from failsafe and surefire plugin.
专注分享java语言的经验与见解,让所有开发者获益!
评论