I am trying to configure code coverage reporting for our Grails application when running Spock-based unit tests. I am able to generate the reports, but the coverage is 0.
I have tried playing with various options (e.g. Sampling vs. Tracing), but the results are always the same: the total number of classes/methods/lines shown is correct, but the coverage is always 0, e.g.:
Class,%: 0%(0/2)
Method,%: 0%(0/4)
Line,%: 0%(0/16)
Which is clearly bogus, since the relevant code can be modified in such a way that the tests fail.
The setup:
- OS X Yosemite 10.10.2
- IntelliJ IDEA Ultimate 14.1.3
- Grails 2.4.4
- Spock 0.7
- Groovy 2.4.3
- Java 1.8.0-31