I've followed the steps that I understand should generate a report containing consolidated coverage from all my @QuarkusTest
and @QuarkusIntegrationTest
classes, but it seems that @QuarkusTest coverage is ignored.
I add a dependency on quarkus-jacoco:
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-jacoco</artifactId>
<scope>test</scope>
</dependency>
I configure the jacoco-maven-plugin:
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.10</version>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<exclClassLoaders>*QuarkusClassLoader</exclClassLoaders>
<destFile>${project.build.directory}/jacoco-quarkus.exec</destFile>
<append>true</append>
</configuration>
</execution>
<execution>
<id>default-prepare-agent-integration</id>
<goals>
<goal>prepare-agent-integration</goal>
</goals>
<configuration>
<destFile>${project.build.directory}/jacoco-quarkus.exec</destFile>
<append>true</append>
</configuration>
</execution>
<execution>
<id>report</id>
<phase>post-integration-test</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<dataFile>${project.build.directory}/jacoco-quarkus.exec</dataFile>
<outputDirectory>${project.build.directory}/jacoco-report</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
And I execute a build:
./mvnw clean verify -Dquarkus.package.write-transformed-bytecode-to-build-output=true
All tests run and pass, but the report appears to only show coverage from @QuarkusIntegrationTest
s. Code that is clearly touched by @QuarkusTest
s is shown as uncovered.
If I remove the explicit report
execution section, the report is generated earlier and correctly shows @QuarkusTest
coverage which proves the stats do get generated, but omits @QuarkusIntegrationTest
coverage.
It seems like the <append>true</append>
instructions are being ignored.
Can anyone see what I am missing?
EDIT: I tried generating distinct exec files for the two types of test and then using the merge
goal to combine them , but got the same result.