Skip to content
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

Merged
merged 15 commits into from
Mar 21, 2022

Conversation

kriegaex
Copy link
Contributor

@kriegaex kriegaex commented Mar 11, 2022

@Stepwise can now be applied to feature methods. The effects are:

  1. 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.

  2. After the first error or failure occurs in any iteration, all subsequent iterations are going to be skipped.

Fixes #1008.

To do:

  • Test automation
  • Spock manual update
  • Release notes update

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.

@codecov
Copy link

codecov bot commented Mar 11, 2022

Codecov Report

Merging #1442 (4bac821) into master (224a2a0) will increase coverage by 0.05%.
The diff coverage is 100.00%.

@@             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              
Impacted Files Coverage Δ
...k/runtime/extension/builtin/StepwiseExtension.java 94.59% <100.00%> (+2.92%) ⬆️
...ork/runtime/ParameterizedFeatureChildExecutor.java 100.00% <0.00%> (+15.38%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 224a2a0...4bac821. Read the comment docs.

'@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.
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.
@kriegaex
Copy link
Contributor Author

kriegaex commented Mar 14, 2022

@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.

@leonard84
Copy link
Member

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.

@leonard84 leonard84 enabled auto-merge (squash) March 21, 2022 20:55
Copy link
Member

@leonard84 leonard84 left a 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

@leonard84 leonard84 merged commit 1e45839 into spockframework:master Mar 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow spec iterations to be skipped
2 participants