如何强制更新失败作业的代码覆盖率趋势图
How can I force update code coverage trend graphs on failed jobs
如何在jacoco分析失败的情况下将代码覆盖结果发布到趋势图?
对于 Findbugs、PMD 等,这可以通过 canRunOnFailed
设置来实现。 JaCoCo 有类似的东西吗?
On project level I see the trend graph which only considers the successful builds. I would also like to see the coverage graph updated if the job fails.
这是由 JENKINS-28479 跟踪的:
ProjectActions (and trend graphs) do not appear for failed projects
This problem is not only related to the JUnit plug-in. In general, every plug-in that has been migrated its actions to a SimpleBuildStep has this problem. The affected source code is in SimpleBuildStep
.
A test case that exposes this bug is WarningsPluginTest#should_not_skip_failed_builds_with_option_run_always
这仍然是开放的。
原回答:
这不是特定于 maven jacoco 构建步骤:您需要做的就是确保构建步骤总是 return“成功”。
如果您正在使用管道,您可以wrap your step in a try/catch。
如果您使用的是常规作业定义,则可以考虑 shell/windows command step where you return 0(或 exit /b 0
)在 mvn 命令之后。
下一个构建步骤将是 mvn sonar:sonar
发布步骤,然后将始终执行。
如何在jacoco分析失败的情况下将代码覆盖结果发布到趋势图?
对于 Findbugs、PMD 等,这可以通过 canRunOnFailed
设置来实现。 JaCoCo 有类似的东西吗?
On project level I see the trend graph which only considers the successful builds. I would also like to see the coverage graph updated if the job fails.
这是由 JENKINS-28479 跟踪的:
ProjectActions (and trend graphs) do not appear for failed projects
This problem is not only related to the JUnit plug-in. In general, every plug-in that has been migrated its actions to a SimpleBuildStep has this problem. The affected source code is in
SimpleBuildStep
.A test case that exposes this bug is WarningsPluginTest#should_not_skip_failed_builds_with_option_run_always
这仍然是开放的。
原回答:
这不是特定于 maven jacoco 构建步骤:您需要做的就是确保构建步骤总是 return“成功”。
如果您正在使用管道,您可以wrap your step in a try/catch。
如果您使用的是常规作业定义,则可以考虑 shell/windows command step where you return 0(或 exit /b 0
)在 mvn 命令之后。
下一个构建步骤将是 mvn sonar:sonar
发布步骤,然后将始终执行。