Explain how to use coverage targets
See original GitHub issueIs it possible to add documentation to the cobertura
pipeline step parameters here: https://jenkins.io/doc/pipeline/steps/cobertura/ ?
I had to dig into https://github.com/jenkinsci/cobertura-plugin/blob/cbe06a5974494fb3775730edf7506b47bdd8d109/src/main/java/hudson/plugins/cobertura/CoberturaPublisher.java#L760 to discover how to set the lineCoverageTargets
value for example.
Then I figured out that the value is a string of "healthy %, unhealthy %, unstable %"
(but what does that mean with respect to build results?)
An experiment where the actual line coverage is 77% would give the following results:
- Setting
lineCoverageTargets: '100, 90, 80'
caused the build to fail with the message:Failing build due to unstability
- Setting
lineCoverageTargets: '100, 90, 0'
caused the build to fail with the message:Failing build because it is unhealthy.
- Setting
lineCoverageTargets: '100, 0, 0'
caused the build to pass with a message about new health minimum and new stability minimum
Issue Analytics
- State:
- Created 5 years ago
- Reactions:13
- Comments:6 (1 by maintainers)
Top Results From Across the Web
How to Set Code Coverage Goals and Interpret Results
How to Set Code Coverage Goals and Interpret Results · Covered != Tested · The obvious conclusion. So the only meaningful coverage target...
Read more >Introduction to Cobertura | Baeldung
Simply put, Cobertura is a reporting tool that calculates test coverage for a codebase – the percentage of branches/lines accessed by unit tests ......
Read more >Command line usage — Coverage.py 6.4.4 documentation
Coverage.py can annotate your source code to show which lines were executed and which were not. The html command creates an HTML report...
Read more >2.8. Adding Code Coverage and Other Metrics
To see how the plugins work, we are going to integrate code coverage ... In the Coverage Metrics Targets section, you can define...
Read more >Don't use test coverage as a target - Ben Morris.
Measuring test code coverage can be a useful technique for finding where the gaps are in your automated tests. The problem is that...
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
https://github.com/jenkinsci/cobertura-plugin/pull/68
With
lineCoverageTargets: '90.0, 80.1, 50'
:It is too bad so that these parameters are not documented in a decent way.