Hi,
I have a gradle quarkus project which consists of 2 modules: api and utils.
api module contains test classes for both utils and api modules (some of them are marked as @QuarkusTest).
api's build gradle is configured according to https://quarkus.io/guides/tests-with-coverage#quarkus-jacoco-jacoco-config_quarkus-jacoco-includes:
1) it has gthe following plugins:
plugins {
id 'java'
id 'io.quarkus'
id 'jacoco'
id 'org.kordamp.gradle.jandex' version '1.1.0'
}
2) it has dependency
testImplementation("io.quarkus:quarkus-jacoco")
3) for non QuarkusTests it has:
test {
environment("DOCKER_HOST", System.getenv("TEST_DOCKER_URL"))
systemProperty "java.util.logging.manager", "org.jboss.logmanager.LogManager"
systemProperty("quarkus.test.profile", "test-${buildDatabaseKind}")
finalizedBy jacocoTestReport
jacoco {
excludeClassLoaders = ["*QuarkusClassLoader"]
destinationFile = layout.buildDirectory.file("jacoco-quarkus.exec").get().asFile
}
jacocoTestReport.enabled = false
}
There are 3 test classes:
GreetingResourceTest (@QuarkusTest)
CommonTest (regular unit test) for the api module
UtilsTest (regular unit test) for the utils module
Project structure looks like:
And jacoco report doesn't take into account test classes marked as @QuarkusTest:
If I change CommonTest class and add @QuarkusTest annotation (despite it is actually not a Quarkus test), then report looks like:
And everything works fine if I don't have submodules in my project.
Expected behavior
Jacoco should take into account QuarkusTest classes
Actual behavior
Jacoco doesn't take into account QuarkusTest classes
How to Reproduce?
Create project like in the description and run 'gradle clean build'
Output of uname -a or ver
No response
Output of java -version
No response
Quarkus version or git rev
No response
Build tool (ie. output of mvnw --version or gradlew --version)
I also noticed that it works this way only if default build directory is changed in build.gradle:
buildDir = file("${rootProject.buildDir}/${project.name}")
Describe the bug
Hi, I have a gradle quarkus project which consists of 2 modules: api and utils. api module contains test classes for both utils and api modules (some of them are marked as @QuarkusTest). api's build gradle is configured according to https://quarkus.io/guides/tests-with-coverage#quarkus-jacoco-jacoco-config_quarkus-jacoco-includes: 1) it has gthe following plugins: plugins { id 'java' id 'io.quarkus' id 'jacoco' id 'org.kordamp.gradle.jandex' version '1.1.0' } 2) it has dependency testImplementation("io.quarkus:quarkus-jacoco") 3) for non QuarkusTests it has: test { environment("DOCKER_HOST", System.getenv("TEST_DOCKER_URL")) systemProperty "java.util.logging.manager", "org.jboss.logmanager.LogManager" systemProperty("quarkus.test.profile", "test-${buildDatabaseKind}") finalizedBy jacocoTestReport jacoco { excludeClassLoaders = ["*QuarkusClassLoader"] destinationFile = layout.buildDirectory.file("jacoco-quarkus.exec").get().asFile } jacocoTestReport.enabled = false }
There are 3 test classes:
Project structure looks like:
And jacoco report doesn't take into account test classes marked as @QuarkusTest:
If I change CommonTest class and add @QuarkusTest annotation (despite it is actually not a Quarkus test), then report looks like:
And everything works fine if I don't have submodules in my project.
Expected behavior
Jacoco should take into account QuarkusTest classes
Actual behavior
Jacoco doesn't take into account QuarkusTest classes
How to Reproduce?
Create project like in the description and run 'gradle clean build'
Output of
uname -a
orver
No response
Output of
java -version
No response
Quarkus version or git rev
No response
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
No response