- Multi-module Gradle project in Kotlin and
build.gradle
- SonarQube 7.7
- Gradle plugin 2.7
- Integration as per https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Gradle
- Currently testing with provided Docker image
./gradlew sonarqube
runs just fine.
Q1: I don’t really need JaCoCo, do I? Just relying on SonarQube is fine?
Q2: SonarQube shows the test coverage but not the number of tests and I don’t see the list of unit tests anywhere. Why could that be?
Q3: Besides test
I made the sonarqube
task also depend on my integrationTest
task. Yet, the reported test coverage does not include the coverage from the latter. Is this intentional?
Code/configuration snippets
test {
useJUnitPlatform {
filter {
includeTestsMatching "*Test*"
}
}
failFast = true
...
task integrationTest(type: Test, group: "Verification", description: "Runs integration tests.") {
mustRunAfter test
classpath = configurations.integrationTestRuntime + sourceSets.main.output + sourceSets.test.output
useJUnitPlatform {
filter {
includeTestsMatching "*IT"
}
}
}
project.tasks["sonarqube"].dependsOn "test", "integrationTest"