I work on Android project with multiple submodules. I'm trying to generate coverage report using jacoco but for some modules test coverage appears to be empty. I tracked down the execution to gradle test tasks and noticed that for missing modules executed cli contains exclude=*
in the execution command.
So for one module with good coverage gradlew testDebugUnitTest
produces following commandline:
-javaagent:build/tmp/expandedArchives/org.jacoco.agent-0.8.7.jar/jacocoagent.jar=destfile=build/jacoco/testDebugUnitTest.exec,append=true,inclnolocationclasses=false,dumponexit=true,output=file,jmx=false
In this case nice output is generated in /build/jacoco/testDebugUnitTest.exec
For some submodules gradle produces following (see excludes=*
):
-javaagent:build/tmp/expandedArchives/org.jacoco.agent-0.8.7.jar/jacocoagent.jar=destfile=build/jacoco/testDebugUnitTest.exec,append=true,excludes=*,inclnolocationclasses=false,dumponexit=true,output=file,jmx=false
For those modules the testDebugUnitTest.exec
file is extremely small (like 45 bytes) and obviously jacocoTestReport is not able to produce the report for that submodule.
All submodules use the same versions of packages, implements the same test and AndroidTest packages etc.
There is no errors reported and I think something is either not configured or I'm missing some package
Why gradle adds that exclude? How can I override it?