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

Jacoco code coverage for androidTest #359

Open
F43nd1r opened this issue Oct 17, 2024 · 3 comments
Open

Jacoco code coverage for androidTest #359

F43nd1r opened this issue Oct 17, 2024 · 3 comments

Comments

@F43nd1r
Copy link

F43nd1r commented Oct 17, 2024

Hey @mannodermaus, I'm trying to create a jacoco report for instrumented junit 5 tests. With applying the jacoco plugin and enableAndroidTestCoverage = true I can get a report with all classes, but it always reports zero coverage.

Is this supported? If so, how can I configure this correctly?

@mannodermaus
Copy link
Owner

I don't have a lot of first-hand experience with Jacoco myself, but certainly there have been many instances in the past where its reporting didn't want to pick up the coverage files properly. The naming of enableAndroidTestCoverage tells me that you want to observe coverage from your instrumentation tests? So far we've only ever dealt with unit tests for this, so it's not unlikely that there are some file paths that aren't correctly reported to Jacoco. Could you share the versions of AGP and android-junit5 that you're employing in your project?

@F43nd1r
Copy link
Author

F43nd1r commented Oct 17, 2024

Yes, this is about instrumented tests.
AGP 8.5.2 and android-junit5 1.11.2.0 (with compose extension 1.6.0)

@mannodermaus
Copy link
Owner

Thanks! No promises I can look at this quickly, but I'll keep this open and will try to take a look at it. 🙇‍♂️

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

No branches or pull requests

2 participants