-
Type:
Bug
-
Resolution: Won't Fix
-
Priority:
Critical
-
Component/s: jacoco-plugin
-
None
Jacoco plugin ignores minimum***Coverage options and sets it to 0 when maximum***Coverage weren't set.
Â
We call Jacoco this way (pipeline stage step)
jacoco(execPattern: '**/*.exec', changeBuildStatus: true, exclusionPattern: '**/*Test*.class', inclusionPattern: '**/*.class', minimumMethodCoverage: '10')
 But in log I see this:
Health thresholds: JacocoHealthReportThresholds [minClass=0, maxClass=0, minMethod=0, maxMethod=0, minLine=0, maxLine=0, minBranch=0, maxBranch=0, minInstruction=0, maxInstruction=0, minComplexity=0, maxComplexity=0]
On the other side, in case when jacoco calls this way (we've added maximumMethodCoverage option):Â
jacoco(execPattern: '**/*.exec', changeBuildStatus: true, exclusionPattern: '**/*Test*.class', inclusionPattern: '**/*.class', minimumMethodCoverage: '10', maximumMethodCoverage: '80')Â
And in log something new:
Thresholds: JacocoHealthReportThresholds [minClass=0, maxClass=0, minMethod=10, maxMethod=80, minLine=0, maxLine=0, minBranch=0, maxBranch=0, minInstruction=0, maxInstruction=0, minComplexity=0, maxComplexity=0]
Â
Â
Probably, issue in the class JacocoHealthReportThresholds (package hudson.plugins.jacoco) in method public void ensureValid(), e.g.:
- maxClass was parsed as 0 (not set) and applyRange returns 0 ;
- minClass was set to 10 and applyRange is called with params 0, 10, 0 and return 0 .
Â