Closed GoogleCodeExporter closed 8 years ago
Spock doesn't rely on reflection to guarantee that methods of a @Stepwise spec
are executed in their declared order (which wouldn't work). Instead, it uses
its Groovy compiler plugin to do so, which is 100% reliable. However, there is
a known issue that Spock's "optimize run order" feature (which is activated
with "runner.optimizeRunOrder = true" in SpockConfig.groovy) doesn't currently
take into account that methods of @Stepwise specs must not be reordered. Is
that maybe what you are running into?
Original comment by pnied...@gmail.com
on 23 Feb 2013 at 12:07
I thought about the same thing (that optimize run order might be playing with
it), so we explicitly disabled it even though we never set it to 'true'
anywhere. So I don't think that's it.
Original comment by bsavi...@adaptivecomputing.com
on 23 Feb 2013 at 12:11
The best way to see what's going on is to debug a spec and set a breakpoint
somewhere in`org.spockframework.runtime.extension.builtin.StepwiseExtension`.
In particular, check if `feature.getDeclarationOrder()` (as used in the
`sortFeaturesInDeclarationOrder` method) returns the correct result. Also note
that `@Stepwise` currently only affects the methods of the annotated class, not
those of its super classes.
Original comment by pnied...@gmail.com
on 23 Feb 2013 at 12:26
Also set a breakpoint in
`org.spockframework.runtime.extension.builtin.OptimizeRunOrderExtension` to see
if it's ever called.
Original comment by pnied...@gmail.com
on 23 Feb 2013 at 12:37
Also note that there was a regression in 0.6 that led to exactly the problems
that you are describing (see
http://code.google.com/p/spock/issues/detail?id=256), but it was fixed in 0.7.
Original comment by pnied...@gmail.com
on 23 Feb 2013 at 12:46
That's definitely it! (the regression). I searched everywhere and never found
that one, apparently the search on google code ironically isn't that great. :)
Thanks, we'll see if we can upgrade.
Original comment by bsavi...@adaptivecomputing.com
on 23 Feb 2013 at 12:57
Should be a drop-in replacement (no known incompatible changes in public APIs).
Make sure to recompile all specs.
Original comment by pnied...@gmail.com
on 23 Feb 2013 at 1:02
There are some geb incompatabilities if I remember right, but nothing too
serious.
Original comment by bsavi...@adaptivecomputing.com
on 23 Feb 2013 at 1:13
That's correct. You'll have to update to Geb 0.9.0-RC-1.
Original comment by pnied...@gmail.com
on 23 Feb 2013 at 1:20
Original comment by pnied...@gmail.com
on 24 Feb 2013 at 12:33
Original issue reported on code.google.com by
bsavi...@adaptivecomputing.com
on 22 Feb 2013 at 7:41