Forgus / spock

Automatically exported from code.google.com/p/spock
0 stars 0 forks source link

Grails Spock plugin breaks create-integration-test script #247

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem? If possible, provide source code and
stack trace.
1. Install the plugin
2. create an integration test via the grails command / script
3. You have to have several other unit and integration tests, preferably that 
interact with GORM or other dynamic methods.
4. Now, see the inclusion of @TestMixin(GrailsUnitTestMixin)?  Yeah, that 
causes random test failures in both the unit and integration test phases 
depending on what other tests you have.  You cannot have ANY unit test 
artifacts in integration tests or it corrupts the test environments of both.

Note on #4, this ONLY affects grails 2.0.x installs and is related to the 
changes in using mixins as far as I can tell.  It's not specific to the spock 
plugin either.  Add that mixin to a normal/preexisting integration test and it 
should produce similar errors.  I had to swap the styles of all unit and 
integration tests on upgrading to 2.0.x.  Having said that, the fix is to 
change whatever mods to the create script were made, to not include that 
annotation for integration tests.

What version of Spock and Groovy are you using?
spock 0.6 groovy 1.8.6 and grails 2.0.3

Please provide any additional information below. You can also assign
labels.

Very cool plugin, but why hijack the create-XX-test scripts?  I'd honestly much 
prefer to have the option of creating spock specs or standard tests... meaning, 
you should probably create your own 'create' script.

Original issue reported on code.google.com by robb....@gmail.com on 14 Apr 2012 at 10:00

GoogleCodeExporter commented 8 years ago
To my knowledge, the plugin isn't hijacking any scripts. The correct plugin 
version for Grails 2.x is 0.6. The 0.6-groovy-1.8 version is only for Grails 
1.3.

Original comment by pnied...@gmail.com on 15 Apr 2012 at 6:18

GoogleCodeExporter commented 8 years ago
I've asked Marco (who contributed the initial feature to look at this)

Original comment by lda...@gmail.com on 15 Apr 2012 at 11:28

GoogleCodeExporter commented 8 years ago
Marco has sent a pull request 
(https://github.com/spockframework/spock-grails/pull/2). Luke, could you have a 
look at it?

Original comment by pnied...@gmail.com on 12 May 2012 at 11:24