我的总体覆盖范围已达到阈值,但仍将构建标记为不稳定.有人知道原因吗?
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: UNSTABLEJacoco报告
推荐答案好吧,根据我发现的链接,覆盖范围应同时超过最小和最大覆盖范围.
Ok, according to links I found, the coverage should be ABOVE both minimum and maximum coverage.
查看链接 issues.jenkins-ci/browse/JENKINS-16903 —报告相同的意外行为.
See the links issues.jenkins-ci/browse/JENKINS-16903 — reporting the same unexpected behaviour.
groups .google/forum/#!topic/jenkins-jacoco-plugin-mailing-list/pzHm98RJjB8/discussion -这是最终声明的规则:
groups.google/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.
更多推荐
达到阈值时如何修复不稳定的构建?
发布评论