Open nguyenvp08 opened 3 years ago
Hi, I am always getting zero percentage coverage with Java11 and AGP 7.x.x. Any inputs here that help us?
I am not %100 percent sure but I had the same problem when I was implementing Coverage Reports in Sonarqube.
Hello @vanniktech Any suggestions here that would help?
You can check this reply from Google https://issuetracker.google.com/issues/191774966
We had ported this plugin from Groovy to Kotlin and our coverage broke as well on Java11 and AGP 7.x.x.
The unit test coverage path for combined tests was incorrect. We had to change "jacoco/test${sourceName.capitalize()}UnitTest.exec"
to "outputs/unit_test_code_coverage/${sourceName}UnitTest/*.exec"
Hello @dsuresh-ap . Can you please explain the above change. I believe the above path is something related to sonar. if not so, please let me know where we have to do the change as part of this plugin.
Hey @vramasam, the line in this plugin is https://github.com/vanniktech/gradle-android-junit-jacoco-plugin/blob/master/src/main/groovy/com/vanniktech/android/junit/jacoco/GenerationPlugin.groovy#L239.
This is where Jacoco looks for JVM unit test coverage. After running the plugin and you go to the /build
directory you should see that there is no .exec
file in the path the plugin specifies.
Ohh okay got it. Thank you @dsuresh-ap . Any plan to raise PR for this and make a release, any idea on that?
@vramasam Unfortunately we have re-wrote the plugin in Kotlin and changed a few things around specifically for our app. So I am not sure if our changes will work for all users.
Dear,
I am using your library to generate test report from both Android tests and local tests, and then push the coverage report to sonarqube, but I often have to run the "combinedTestReportDebug" task twice, because the first time task will generate 0% coverage report, the second time running task will generate correct report coverage percentage