简体   繁体   English

Jenkins 管道 - 分离单元测试和集成测试结果

[英]Jenkins pipeline - Separating unit tests and integration test results

I'm using JenkinsFile to manage our pipeline.我正在使用 JenkinsFile 来管理我们的管道。 Since, we integrated maven-failsafe-plugin to run the unit tests and integration tests separately, we get separate result reports from both plugins.由于我们集成了 maven-failsafe-plugin 来分别运行单元测试和集成测试,因此我们从两个插件中获得了单独的结果报告。 This is how i configured the same in JenkinsFile in the post section:这就是我在帖子部分的 JenkinsFile 中配置相同的方式:

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.我本来希望 Jenkins 分别显示单元测试和集成测试,但不幸的是,Jenkins 合并了两个 XML 的结果,并且单元测试和集成测试之间没有明显的区别。 We want our builds to have a separate view on Integration tests results.我们希望我们的构建对集成测试结果有一个单独的视图。 Is there anyway to do that with Jenkins?无论如何,詹金斯可以这样做吗?

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.使用mvn clean verify您可以在 jenkins 管道中使用mvn site并构建 HTML 表示。 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.这些测试结果分为 failsafe 和 surefire,您可以直接从工作区打开它,并查看 failsafe 和 surefire 插件的不同结果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM