本文介绍了达到阈值时如何修复不稳定的构建?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

My overall coverage is meeting the threshold, but still build is marked as Unstable. Does anyone know the reason for this?

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

Jacoco报告

推荐答案

好吧,根据我发现的链接,覆盖范围应同时超过最小和最大覆盖范围.

Ok, according to links I found, the coverage should be ABOVE both minimum and maximum coverage.

查看链接 https://issues.jenkins-ci.org/browse/JENKINS-16903 —报告相同的意外行为.

See the linkshttps://issues.jenkins-ci.org/browse/JENKINS-16903 — reporting the same unexpected behaviour.

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

https://groups.google.com/forum/#!topic/jenkins-jacoco-plugin-mailing-list/pzHm98RJjB8/discussion — here the rule it is finally declared:

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

It also seems from the second topic that specifying only one threshold (or only minimum) does not work. Therefore I'd recommend you to try setting both min and max to your expected minimum.

这篇关于达到阈值时如何修复不稳定的构建?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-27 13:31