Skip to content

JaCoCo fails to collect coverage with Yasson JSONB dependency #2

@jfallows

Description

@jfallows

As checked in on current develop branch.

% mvn clean install
...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:21 min
[INFO] Finished at: 2021-01-27T21:01:15-08:00
[INFO] ------------------------------------------------------------------------

After applying this patch to remove johnzon dependency.

diff --git a/pom.xml b/pom.xml
index 469086b..59e50e3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -73,12 +73,14 @@
       <scope>provided</scope>
     </dependency>
     <!-- workaround for JaCoCo coverage checks -->
+    <!--
     <dependency>
       <groupId>org.apache.johnzon</groupId>
       <artifactId>johnzon-jsonb</artifactId>
       <version>1.2.8</version>
       <scope>test</scope>
     </dependency>
+    -->
     <dependency>
       <groupId>org.reaktivity</groupId>
       <artifactId>reaktor</artifactId>

then the build fails due to jacoco error.

[INFO] --- jacoco-maven-plugin:0.8.6:check (default) @ nukleus-proxy ---
[INFO] Loading execution data file /Users/jfallows/GitHub/reaktivity/nukleus-proxy.java/target/jacoco.exec
[INFO] Analyzed bundle 'nukleus-proxy' with 20 classes
[WARNING] Rule violated for bundle nukleus-proxy: instructions covered ratio is 0.00, but expected minimum is 0.92
[WARNING] Rule violated for bundle nukleus-proxy: classes missed count is 20, but expected maximum is 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:21 min
[INFO] Finished at: 2021-01-27T21:07:19-08:00
[INFO] ------------------------------------------------------------------------

It seems as though jacoco is having an issue specifically with the yasson classes, since there is no problem if johnzon is inserted earlier in the classpath so that johnzon is selected instead of yasson as the json-b provider.

After investigating, I found jacoco/jacoco#51 which has similar symptoms, but did not yet find any evidence of runtime class modifications by yasson.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinghelp wantedExtra attention is needed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions