Reputation: 4780
I have an app with a separate module. I am looking to combine code coverage in a single xml report and submit to sonar cloud. I have managed to combine the coverage thanks to the help of this blog post. However, I am having problems with the sonar integration.
Here is my sonar.gradle
apply plugin: "org.sonarqube"
sonarqube {
properties {
property "sonar.projectKey", "*******"
property "sonar.organization", "*********"
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.token", "*********"
property "sonar.java.coveragePlugin", "jacoco"
property "sonar.projectName", "*********"
property "sonar.sources", ["src/test", "src/main/java"]
property "sonar.tests", "src/test"
property "sonar.test.inclusions", "**/*Test*/**"
property "sonar.sourceEncoding", "UTF-8"
property "sonar.sources", "src/main/java"
property "sonar.java.coveragePlugin", "jacoco"
property "sonar.coverage.jacoco.xmlReportPaths", "/Users/james/Documents/Development/testapp/app/build/reports/jacoco/allDebugCoverage/allDebugCoverage.xml'."
}
}
When I run ./gradlew sonar -info
I can see
No coverage report can be found with sonar.coverage.jacoco.xmlReportPaths='/Users/james/Documents/Development/testapp/app/build/reports/jacoco/allDebugCoverage/allDebugCoverage.xml'.
From the screen shot we can see the allDebugCoverage.xml
is there. The html provides a visual on the expected coverage for the code.
Then I see Searching for
... and it lists each of my test classes.
The rest of the analysis is taking place, the test coverage is not being submitted.
I am sure I am doing something stupid here, there is very little clear up to date guidance on this. If anyone can help, I'd greatly appreciate it.
Upvotes: 1
Views: 774