-
Notifications
You must be signed in to change notification settings - Fork 466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make @Stepwise
work for iterated features
#1442
Make @Stepwise
work for iterated features
#1442
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1442 +/- ##
============================================
+ Coverage 79.53% 79.59% +0.05%
- Complexity 4007 4010 +3
============================================
Files 404 404
Lines 12550 12563 +13
Branches 1640 1640
============================================
+ Hits 9982 9999 +17
+ Misses 1973 1969 -4
Partials 595 595
Continue to review full report at Codecov.
|
'@stepwise' can now be applied to feature methods. The effects are: 1. the feature be switched to ExecutionMode.SAME_THREAD, similarly to how whole specs are switched to the same execution mode when using the annotation on class level. 2. After the first error or failure occurs in any iteration, all subsequent iterations are going to be skipped. Fixes spockframework#1008.
375ad5c
to
27eb151
Compare
spock-core/src/main/java/org/spockframework/runtime/extension/builtin/StepwiseExtension.java
Outdated
Show resolved
Hide resolved
spock-core/src/main/java/org/spockframework/runtime/extension/builtin/StepwiseExtension.java
Show resolved
Hide resolved
The tests covering @stepwise usage on spec level have a '[spec]' prefix now in preparation of '[feature]' and '[mixed]' cases for the new feature-level usage. Moreover, fix a few copy & paste bugs in conditions.
spock-core/src/main/java/org/spockframework/runtime/extension/builtin/StepwiseExtension.java
Show resolved
Hide resolved
spock-specs/src/test/groovy/org/spockframework/smoke/extension/StepwiseExtension.groovy
Outdated
Show resolved
Hide resolved
spock-specs/src/test/groovy/org/spockframework/smoke/extension/StepwiseExtension.groovy
Outdated
Show resolved
Hide resolved
This was required in a code review, so I implemented it.
@leonard84, from my perspective, this is done and ready to be merged, unless you find issues in my most recent commits. But better safe than sorry, so take due time to review them. I do not know your usual merge practice, so if you want me to rebase on the main branch and/or squash the commits into fewer ones, just let me know. I am not going to rebase or squash anything now, because it might confuse you, reviewing incrementally. |
Just commit normally, I normally squash with Github when merging back to master. |
spock-specs/src/test/groovy/org/spockframework/smoke/extension/StepwiseFeatures.groovy
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @kriegaex
@Stepwise
can now be applied to feature methods. The effects are:the feature is switched to
ExecutionMode.SAME_THREAD
, similarly to how whole specs are switched to the same execution mode when using the annotation on class level.After the first error or failure occurs in any iteration, all subsequent iterations are going to be skipped.
Fixes #1008.
To do:
Special thanks to @leonard84 who helped me evolve my separate extension with more complex code structure (because I started implementing it for Spock 1.3 where that was necessary) into something more elegant and minimal. Without him, it would not look quite as beautiful. In the end, I merely had to migrate it from a separate annotation + extension into the existing
StepwiseExtension
, where it is only a small change.