0

I want to generate unit and integration test coverage html report for my Android project. This project is composed of 3 modules:

  • app module (I don't really want to make a report for this module)
  • sdk module (real target of the tests)
  • sdk-integration-tests (containing the sdk module integration tests)

I am following exactly this implementation https://blog.mindorks.com/generate-global-code-coverage-report-in-android-development-using-jacoco-plugin

All tests pass.

But:

  • The report displays 0% of coverage. It does not match the actual test coverage. Classes and methods widely used in the tests are still marked as not covered.
  • I would like to merge the reports of two modules (sdk and sdk-integration-tests)

EDIT: One important remark: the tests use Mockito and Robolectric. I really think it could play an important part in the erroneous analysis of code coverage.

Do you have any idea?

Thibaut
  • 1
  • 2

1 Answers1

1

Could you share your junitJacoco configuration? Last time I also face the same issue, until find the solution here:

tasks.withType(Test) {
    jacoco.includeNoLocationClasses = true
    jacoco.excludes = ['jdk.internal.*']
}
anticafe
  • 6,816
  • 9
  • 43
  • 74