question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When coverage goes down threshold is updated and the build is not marked as unstable

See original GitHub issue

Using 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:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
sackdancommented, Jun 28, 2019

Any news on this front?

1reaction
cizezsycommented, Aug 19, 2019

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found