Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running combinedTestReportDebug always return 0% coverage first time #199

Open
nguyenvp08 opened this issue Jul 2, 2021 · 9 comments
Open

Comments

@nguyenvp08
Copy link

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

@vramasam
Copy link

vramasam commented Jul 9, 2021

Hi,
I am always getting zero percentage coverage with Java11 and AGP 7.x.x. Any inputs here that help us?

@volkansahin45
Copy link

I am not %100 percent sure but I had the same problem when I was implementing Coverage Reports in Sonarqube.

@vramasam
Copy link

Hello @vanniktech Any suggestions here that would help?

@ReginFell
Copy link

You can check this reply from Google
https://issuetracker.google.com/issues/191774966

@dsuresh-ap
Copy link

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"

@vramasam
Copy link

vramasam commented Aug 31, 2021

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.

@dsuresh-ap
Copy link

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.

@vramasam
Copy link

Ohh okay got it. Thank you @dsuresh-ap . Any plan to raise PR for this and make a release, any idea on that?

@dsuresh-ap
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants