Get coverage from class in other module tested with QuarkusUnitTest

150 views Asked by At

In the jacoco coverage of my quarkus extension, I am missing certain classes. The project contains to submodules, which finally causing the issue.

Example project: https://github.com/HerrDerb/quarkus-extension-coverage-issue

As I cannot run QuarkusTest in a quarkus extension runtime module, I test certain runtime classes with a QuarkusUnitTest in my deployment module. These beans under test are missing in the final coverage report of the deployment module

I am testing the class MyBean inside of the deployment module. When running ./gradlew test jacocoTestReport it will generate the folder deplyoment/build/reports/jacacoco. Looking over the html reports files, it is visible that the coverage report of MyBean is missing. This is, because the bean is actually not implemented inside of the deployment module. Moving it test-wise from the runtime module to the deployment module will result in the desired coverage.

I tried to play around with jacoco properties inside the debployment/build.gradle which did not result in any success:

jacocoTestReport {
    additionalSourceDirs.from project(':runtime').sourceSets.main.java.srcDirs
}

How can I include "external" beans (from another module) in the coverage report of my QuarkusUnitTest?

0

There are 0 answers