Thursday, March 24, 2016

Jacoco coverage report in spite of connected device test failures?

Leave a Comment

I'm cleaning up an Android project that has several hundred Espresso tests of which several are flaky. Getting 100% instrumented test success on a regular basis isn't realistic in this context.

My Gradle task for Jacoco code coverage works perfectly (!) when all the Espresso tests do pass (achievable by skipping the flaky ones). When there are test failures, however, the Jacoco report shows 0% coverage even though the Gradle test report has the correct data. Looks like the coverage.ec file generated is 0 bytes.

The connected<flavor>DebugAndroidTest task has been configured with ignoreFailures = true, so the build no longer halts when there were failing tests.

Is there any way to get the test task to correctly generate the coverage.ec file in spite of failures?

0 Answers

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment