Android-Root-Coverage-Plugin icon indicating copy to clipboard operation
Android-Root-Coverage-Plugin copied to clipboard

Not all coverage files (`*.ec`) included in the JacocoReport when using `clearPackageData`

Open EverydayPineapple opened this issue 2 years ago • 3 comments
trafficstars

Our project is setup in a way that outputs seperate .ec files per test. I believe this is due to the clearPackageData option being set to true, which is desired for us since it helps with test indempotence.

The issue is that the plugin is only looking for coverage.ec files when I need it to be looking for *.ec files.

The issue has been discussed here but I'm making a new issue since I'm not convinced that PR is trying to solve the same thing.

EverydayPineapple avatar May 02 '23 15:05 EverydayPineapple

This is indeed something I never tested with this plugin, I have some more important bugs to work on first such as supporting the Android Gradle Plugin version 8.0. But this is on my radar as an improvement.

Rolf-Smit avatar May 06 '23 10:05 Rolf-Smit

So I added a test case to the plugin (locally not pushed yet) that uses clearPackageData however I cannot reproduce the issue.

Do you remember which version of the plugin you where using? Gradle Managed Devices? Test Orchestration?

Rolf-Smit avatar Nov 09 '23 16:11 Rolf-Smit

Did some more testing and included Test Orchestrator into the mix, now I can reproduce the issue.

I took this configuration as example: https://github.com/android/testing-samples/blob/main/runner/AndroidTestOrchestratorWithTestCoverageSample/app/build.gradle

The bad news, this is not something I can fix as it seems to be a bug in the Android tooling itself:

  • https://issuetracker.google.com/issues/126258801
  • https://issuetracker.google.com/issues/123987001 (this one is marked as fixed, but I can 100% reproduce the issue on the latest 8.3.0-alpha12 release)

The problem is that the coverage files that this Plugin needs (JaCoCo eventually needs them) are not created or disappear before we can use them.

Edit: pushed branch with a test case, that currently fails (but as explained not something that this plugin can fix)

Rolf-Smit avatar Nov 09 '23 17:11 Rolf-Smit