Alasdair Ross
Alasdair Ross

Reputation: 380

Can Sonarqube show coverage by test using JaCoCo and Gradle?

Using Java, JUnit 4, JaCoCo, Gradle and Sonarqube, I'm able to see code coverage in Sonarqube, however, I'm unable to see which tests cover lines of code (i.e. which tests contributed to the coverage).

It appears that using Maven there is a surefire plugin that can be configured to enable this, however I'm unable to find an option for Gradle.

It's a multi-project gradle build, and each sub-project has the following section:

project(":<proj_name>") {
    sonarqube {
        properties {
            property "sonar.jacoco.reportPaths", "$project.buildDir/jacoco/test.exec"
            property "sonar.junit.reportsPath", "$project.buildDir/test-results/*.xml"
        }
    }
}

Is there something equivalent to the argLine property for surefire that I need to turn on? Is this even possible with a Gradle/JaCoCo/JUnit combo?

Upvotes: 1

Views: 528

Answers (1)

G. Ann - SonarSource Team
G. Ann - SonarSource Team

Reputation: 22844

This feature is no longer available in SonarQube.

Upvotes: 0

Related Questions