Details
-
Suggestion
-
Resolution: Fixed
-
None
-
Windows 7
Description
We use Clover for both Java and Groovy.
Unfortunately, Clover does not understand the tests we write in Spock.
So a test like this:
class OpsWiseJobQueryTestSpec extends AbstractTestSpec { OpsWiseJobQuery wait static File existingFileMarker = File.createTempFile("opswiseJobQuery", ".txt") void setup() { wait = new OpsWiseJobQuery() wait.manifestDir = existingFileMarker.getParentFile() existingFileMarker.createNewFile() } void cleanup() { existingFileMarker.delete() } def "should work with completed job"() { expect: state == wait.getJobState(manifestFilename) where: state | manifestFilename OpsWiseJobState.WAITING | "non-existing-name.whatever" OpsWiseJobState.DONE | existingFileMarker.getName() } }
Ends up with a coverage report like this:
Class Tests Fail Error Time (secs) % Tests Success OpsWiseJobQueryTestSpec 12 0 0 0,026 100% Tests Started Status Time (secs) Message OpsWiseJobQueryTestSpec. 12 mar 10:32:50 PASS 0 OpsWiseJobQueryTestSpec.$spock_feature_1_0 12 mar 10:32:49 PASS 0,001 OpsWiseJobQueryTestSpec. 12 mar 10:32:49 PASS 0 OpsWiseJobQueryTestSpec.setup 12 mar 10:32:49 PASS 0,009 OpsWiseJobQueryTestSpec. 12 mar 10:32:50 PASS 0,001 OpsWiseJobQueryTestSpec.$spock_feature_1_0 12 mar 10:32:50 PASS 0 OpsWiseJobQueryTestSpec.cleanup 12 mar 10:32:50 PASS 0,01 OpsWiseJobQueryTestSpec.setup 12 mar 10:32:50 PASS 0,001 OpsWiseJobQueryTestSpec.cleanup 12 mar 10:32:50 PASS 0,001 OpsWiseJobQueryTestSpec. 12 mar 10:32:49 PASS 0,002 OpsWiseJobQueryTestSpec. 12 mar 10:32:49 PASS 0,001 OpsWiseJobQueryTestSpec. 12 mar 10:32:49 PASS 0
I would expect to see just a single test passed.
Attachments
Issue Links
There are no Sub-Tasks for this issue.