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

Hilt + Code Coverage Issues #222

Open
alisonthemonster opened this issue Jul 27, 2021 · 0 comments
Open

Hilt + Code Coverage Issues #222

alisonthemonster opened this issue Jul 27, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@alisonthemonster
Copy link
Owner

As mentioned in this issue: google/dagger#1982

A useful note for anyone having trouble with this using Android Gradle Plugin (AGP) 4.1. In order to get any unit test code coverage with JaCoCo you need to testCoverageEnabled false so that AGP's compiled classes for use on device are not used instead of the local instrumented classes.

That explains why I had to programmatically set the testCoverageEnabled to true in my FTL tests and false in my unit tests to generate code coverage properly. See #211

There's an issue tracker here: https://issuetracker.google.com/issues/171125857
They discuss some workarounds, but I'm happy with mine for now. I'll keep this issue open as a reminder to check up on the issue tracker.

@alisonthemonster alisonthemonster added the bug Something isn't working label Jul 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant