-
Suggestion
-
Resolution: Fixed
-
None
-
Windows 7
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.
[CLOV-1256] as a developer I'd like to instrument tests written in the Spock framework
Workflow | Original: JAC Suggestion Workflow [ 3342494 ] | New: JAC Suggestion Workflow 3 [ 3584980 ] |
Status | Original: RESOLVED [ 5 ] | New: Closed [ 6 ] |
Epic Name | Original: Spock framework | |
Epic Status | Original: Done [ 11730 ] | |
Workflow | Original: New Clover Workflow - Restricted [ 1474021 ] | New: JAC Suggestion Workflow [ 3342494 ] |
Issue Type | Original: Epic [ 19 ] | New: Suggestion [ 10000 ] |
Status | Original: Closed [ 6 ] | New: Resolved [ 5 ] |
Workflow | Original: New Clover Workflow [ 897475 ] | New: New Clover Workflow - Restricted [ 1474021 ] |
Epic Status | New: Done [ 11730 ] |
Workflow | Original: Clover Workflow [ 896371 ] | New: New Clover Workflow [ 897475 ] |
Workflow | Original: reviewflow [ 514278 ] | New: Clover Workflow [ 896371 ] |
Component/s | New: Ant Tasks [ 12252 ] | |
Component/s | New: Grails Plugin [ 13100 ] | |
Component/s | New: Maven plugin [ 12666 ] | |
Epic Name | New: Spock framework |
Issue Type | Original: Story [ 16 ] | New: Epic [ 19 ] |
Status | Original: Resolved [ 5 ] | New: Closed [ 6 ] |
Hey, in case you didn't notice - the Clover 3.3 has been released: http://www.atlassian.com/software/clover/download
Have fun with Clover & Spock!