小编典典

达到阈值时如何修复不稳定的建筑?

jenkins

我的总体覆盖范围已达到阈值,但仍将构建标记为不稳定。有人知道原因吗?

16:53:04 [JaCoCo plugin] Thresholds: JacocoHealthReportThresholds [minClass=75, maxClass=99, minMethod=75, maxMethod=99, minLine=75, maxLine=99, minBranch=40, maxBranch=99, minInstruction=65, maxInstruction=99, minComplexity=0, maxComplexity=99]
16:53:04 [JaCoCo plugin] Publishing the results..
16:53:04 [JaCoCo plugin] Loading packages..
16:53:04 [JaCoCo plugin] Done.
16:53:04 [JaCoCo plugin] Overall coverage: class: 89, method: 89, line: 77, branch: 41, instruction: 67
16:53:04 [JaCoCo plugin] Health thresholds: JacocoHealthReportThresholds [minClass=75, maxClass=99, minMethod=75, maxMethod=99, minLine=75, maxLine=99, minBranch=40, maxBranch=99, minInstruction=65, maxInstruction=99, minComplexity=0, maxComplexity=99]
16:53:04 [JaCoCo plugin] Apply Min/Max thresholds result: UNSTABLE

哈科科报告


阅读 447

收藏
2020-07-25

共1个答案

小编典典

好的,根据我发现的链接,覆盖范围应该在最小和最大覆盖范围之内。

请参阅链接 https://issues.jenkins-
ci.org/browse/JENKINS-16903-报告相同的意外行为。

https://groups.google.com/forum/#!topic/jenkins-jacoco-plugin-mailing-
list/pzHm98RJjB8/discussion-在此规则最终声明为:

配置的最大阈值高于实际覆盖范围。如果覆盖率低于最小值,则构建失败; 如果覆盖率低于最大值,则构建不稳定;如果覆盖率高于,则成功。

从第二个主题看来,仅指定一个阈值(或仅最小阈值)似乎不起作用。因此,建议您尝试将最小和最大都设置为预期的最小。

2020-07-25