-
Improvement
-
Resolution: Fixed
-
Trivial
-
None
-
Jenkins 1.604
JaCoCo plugin 1.0.19
We have build jobs preparing jar files for "modules" that may or may not have actual java code. Sometimes they just have resources. Sometimes previously resource-only modules have code added later.
Currently our statistics view configured to show the nice coverage percentage (thanks for the great plugin by the way!) shows 0% for the resource only jobs. Yet we also have naughty modules with Java code but no unit tests that show 0% (as they should). It would be great if the modules with no actual code show 100% coverage - since that seems correct in a way and distinct from naughty modules lacking tests
Unit test coverage still shows N/A so you can easily sort out that the 100% is likely a resource-only job. Or maybe even make an "empty" 100% show in a different text color (blue?) or distinct in some other way.
Naturally we use template jobs to make it easy to keep all the jobs configured the same. That way the JaCoCo is ready the moment some code actually shows up.
Thanks in advance! Hoping this is a fairly easy and non-controversial request, but maybe I'm missing something.
- is related to
-
JENKINS-56123 JaCoCo Coverage Statistics Grid Portlet reports 100% coverage in case there is no coverage collected at all
-
- Open
-
Code changed in jenkins
User: Kevin Scaldeferri
Path:
resources/test/multiple.png
src/main/java/hudson/plugins/jacoco/model/Coverage.java
src/test/java/hudson/plugins/jacoco/CoverageTest.java
src/test/java/hudson/plugins/jacoco/model/CoverageObjectGraphTest.java
src/test/java/hudson/plugins/jacococoveragecolumn/JaCoCoColumnTest.java
http://jenkins-ci.org/commit/jacoco-plugin/174dbd90ab3ffbaaceb07664d57649cefc06d97d
Log:
Report 100% for empty Coverage objects
If a section of code has no branches, we should report 100% branch coverage
not 0% coverage. This prevents spurious threshold violations for such code.
(This concern also applies to other coverage measures, although in practice
I've only encountered this problem for branches.)
Fixes
JENKINS-25076andJENKINS-29117