-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
Description
Once jacoco is setup on a project the main thing that matters is the coverage metric.
It would be helpful to see this in the build output.
Scenario
- JaCoCo version: 0.8.13.202504020838
- Operating system: Linux
- Tool integration: Maven
- Description of your use case:
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>jacoco-check</id>
<goals>
<goal>check</goal>
</goals>
<configuration>
<rules>
<rule>
<element>BUNDLE</element>
<limits>
<limit>
<counter>BRANCH</counter>
<value>COVEREDRATIO</value>
<minimum>50%</minimum>
</limit>
<limit>
<counter>CLASS</counter>
<value>MISSEDCOUNT</value>
<maximum>0</maximum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
</executions>
</plugin>
Current Behaviour
[INFO] --- jacoco:0.8.13:check (jacoco-check) @ sybber ---
[INFO] Loading execution data file /git/gipe/sybber/target/jacoco.exec
[INFO] Analyzed bundle 'sybber' with 10 classes
[INFO] All coverage checks have been met
Wanted Behaviour
[INFO] --- jacoco:0.8.13:check (jacoco-check) @ sybber ---
[INFO] Loading execution data file /git/gipe/sybber/target/jacoco.exec
[INFO] Analyzed bundle 'sybber' with 10 classes
[INFO] Bundle coverage: branch ratio% [60/50], classes max-missed [0/0]
[INFO] All coverage checks have been met
Possible Workarounds
Read the report.
Possible Behaviour
It might also be helpful to warn if the coverage limits are close to being broken, so
[INFO] --- jacoco:0.8.13:check (jacoco-check) @ sybber ---
[INFO] Loading execution data file /git/gipe/sybber/target/jacoco.exec
[INFO] Analyzed bundle 'sybber' with 10 classes
[WARN] Bundle coverage: branch ratio% [55/50], classes max-missed [0/0]
[WARN] All coverage checks have been met. Limits are close to being exceeded.