Uploaded image for project: 'Clover'
  1. Clover
  2. CLOV-1256

as a developer I'd like to instrument tests written in the Spock framework

    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

      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

            Katherine Yabut made changes -
            Workflow Original: JAC Suggestion Workflow [ 3342494 ] New: JAC Suggestion Workflow 3 [ 3584980 ]
            Status Original: RESOLVED [ 5 ] New: Closed [ 6 ]
            Monique Khairuliana (Inactive) made changes -
            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 ]
            Owen made changes -
            Workflow Original: New Clover Workflow [ 897475 ] New: New Clover Workflow - Restricted [ 1474021 ]
            Marek Parfianowicz made changes -
            Epic Status New: Done [ 11730 ]
            Piotr Swiecicki made changes -
            Workflow Original: Clover Workflow [ 896371 ] New: New Clover Workflow [ 897475 ]
            Piotr Swiecicki made changes -
            Workflow Original: reviewflow [ 514278 ] New: Clover Workflow [ 896371 ]

            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!

            Marek Parfianowicz added a comment - 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!
            Marek Parfianowicz made changes -
            Component/s New: Ant Tasks [ 12252 ]
            Component/s New: Grails Plugin [ 13100 ]
            Component/s New: Maven plugin [ 12666 ]
            Epic Name New: Spock framework
            Marek Parfianowicz made changes -
            Issue Type Original: Story [ 16 ] New: Epic [ 19 ]
            Marek Parfianowicz made changes -
            Status Original: Resolved [ 5 ] New: Closed [ 6 ]

              mparfianowicz Marek Parfianowicz
              365070a405d9 Jesper Skov
              Votes:
              5 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved: