When coverage goes down threshold is updated and the build is not marked as unstable
See original GitHub issueUsing the snippet generator I’ve added the following step to my Jenkinsfile
:
cobertura coberturaReportFile: 'coverage.xml', conditionalCoverageTargets: '80, 0, 0', failUnhealthy: true, failUnstable: true, lineCoverageTargets: '80, 0, 0', maxNumberOfBuilds: 0, methodCoverageTargets: '80, 0, 0', onlyStable: false, sourceEncoding: 'ASCII', zoomCoverageChart: false
This should set the initial threshold to 80% for lines, methods and conditionals and auto-update the minimum when the build is successful (as autoUpdateHealth
and autoUpdateStability
are true
by default). But when coverage goes down the threshold is updated and the build is not marked as unstable:
The pipeline steps reports the update of the thresholds:
Methods's new health minimum is: 78.84
Lines's new health minimum is: 82.19
Conditionals's new health minimum is: 72.23
Methods's new stability minimum is: 78.84
Lines's new stability minimum is: 82.19
Conditionals's new stability minimum is: 72.23
In other non-pipeline jobs using the cobertura-plugin
, when the coverage is bellow the minimum the coverage does not get updated and the build is marked as unstable.
Environment
- Jenkins v.2.73.3
- Cobertura plugin v1.12
- Pipeline plugin v2.5
- Pipeline: API plugin v2.23.1
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:12 (2 by maintainers)
Top Results From Across the Web
jenkins - How to fix unstable builds when thresholds are met?
My overall coverage is meeting the threshold, but still build is marked as Unstable. Does anyone know the reason for this?
Read more >[java code coverage] How to mark build as UNSTABLE with ...
This job is using Jacoco plugin for coverage reporting. The goal is to mark the build as Unstable if the coverage drops. I've...
Read more >2.8. Adding Code Coverage and Other Metrics
Next, we need to tell Jenkins to keep track of our code coverage metrics. Scroll down to the “Post-build Actions” section. You should...
Read more >What Does Unstable Mean in Jenkins - YouTube
Timecodes ⏱:00:00 Introduction00:05 Overview00:28 Starting point00:41 What is the definition of UNSTABLE ?01:00 Using the unstable pipeline ...
Read more >[JENKINS-1267] cc.xml reports failure for last build, although the last ...
How about code coverage? Our Jenkins instance is configured to mark a build as unstable if cove coverage goes down, which happens very...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Any news on this front?
@lexotero I think the third value in the
methodCoverageTargets
option is used for stable threshold, so it won’t mark build as unstable as you config it to zero.