JacocoTestReport not working in 2.0-rc-1

I have switched to gradle 2.0-rc-1 and my jacocoTestReport stopped working. Report is generated, but no session data is present and thus coverage is 0 for all classes. Exactly the same build.gradle works for gradle 1.12.

Can you provide more details (ideally a self-contained reproducible example)?

I have the same problem;

easily reproducible with the files in https://gist.github.com/anonymous/719a681b38bab8d8360b run with ‘./gradlew clean test jacocoTestReport’ against 1.10-bin or 1.12-bin (both show full coverage) versus 2.0-rc-1-bin (no coverage). I can also send you a whole ziped project if that helps.

Thanks for the reports. I can reproduce this, and we’ll try to get it fixed for 2.0.

This reply was created from a merged topic originally titled No session data in JaCoCo Coverage Report available.. Using Gradle-2.0-rc-1 th default configuration of the jacocoTestReport seems to be misconfigured. The generated test.exec in build/jacoco/test.exec is not picked up by the reporting task (there is no INFO ouput visible telling me it tries to load that data file). The consequence is an empty coverage report (no coverage).

Adding:

jacocoTestReport {

executionData { file (‘build/jacoco/test.exec’) }
}

fixes the problem.

Would be nice if this would work out-of-the-box in 2.0.

Thanks

Sven

Sven,

I’ve tried to reproduce this, and adding the above ‘executionData’ block doesn’t solve the problem for me. Only switching back to 1.12 does.

thanks, works for me now with 2.0-rc-2