I\'m trying to do Sonar Setup with Jacoco for Kotlin to generate Code Coverage report but it\'s not showing any code coverage. While checking Sonar Console it showing following
If you're using the android test orchestrator this is likely the problem.
I had the same issue today and after disabling the android test orchestrator the coverage is working again.
Bug report: https://issuetracker.google.com/issues/72758547
I'm not sure how Android Kotlin builds are configured, but in my Android Java build.gradle
I had to comment out the test orchestrator like so:
android {
...
testOptions {
// temporarily disable the orchestrator as this breaks coverage: https://issuetracker.google.com/issues/72758547
//execution 'ANDROID_TEST_ORCHESTRATOR'
...
}
}
There are few things you need to do to make it work for kotlin.
plugins {
id "jacoco"
id "org.sonarqube" version "2.7.1"
}
Follow this url: https://community.sonarsource.com/t/coverage-test-data-importing-jacoco-coverage-report-in-xml-format/12151
Add properties in your build.gradle for it to search for jacoco results.
property 'sonar.coverage.jacoco.xmlReportPaths', "${buildDir}/reports/jacoco/test/jacocoTestReport.xml"
Follow this url for properties: https://docs.sonarqube.org/7.5/analysis/analysis-parameters/