Closed essobedo closed 3 years ago
Hi @essobedo thank you for your contribution!
In fact I think our jacoco setup is completely broken: it is not collecting any data at all for integration tests, only for unit tests. This is why you are not seeing any mapper-generated classes in the report: they only appear in integration tests.
So let me suggest the following:
<executions>
<execution>
<id>prepare-agent-ut</id>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<destFile>${project.build.directory}/jacoco-ut.exec</destFile>
</configuration>
</execution>
<execution>
<id>prepare-agent-it</id>
<phase>pre-integration-test</phase>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<destFile>${project.build.directory}/jacoco-it.exec</destFile>
</configuration>
</execution>
<execution>
<id>report-ut</id>
<goals>
<goal>report</goal>
</goals>
<configuration>
<dataFile>${project.build.directory}/jacoco-ut.exec</dataFile>
<outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
</configuration>
</execution>
<execution>
<id>report-it</id>
<goals>
<goal>report</goal>
</goals>
<configuration>
<dataFile>${project.build.directory}/jacoco-it.exec</dataFile>
<outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
</configuration>
</execution>
</executions>
I think it would be nice to exclude all the classes whose names end with __MapperGenerated
, wdyt?
@adutra good catch, let me try it
@adutra Should be fine now
@adutra However, I'm not sure that having the code coverage of integration test classes is really useful but maybe I missed something
However, I'm not sure that having the code coverage of integration test classes is really useful but maybe I missed something
It's not. But at least we have something that works now. The next steps would be to consolidate reports and maybe the ability to report coverage of classes in runtime
and deployment
modules when running the integration tests. But we can look into it later.
fixes #39
Motivation
Some classes are generated and affect the JaCoCo reports.
Modifications
$$accessor.class
generated by the extension annotation processor of Quarkus from the JaCoCo report__MapperGenerated
Result
The JaCoCo report is no more affected by the generated classes.
NB: The test classes like
CassandraEndpoint
andCassandraNameConverterEndpoint
have been removed from the project