Skip to content

Introduce DataIterator and IDataDriver#1479

Merged
leonard84 merged 12 commits into
spockframework:masterfrom
leonard84:data_iterator
Jun 27, 2022
Merged

Introduce DataIterator and IDataDriver#1479
leonard84 merged 12 commits into
spockframework:masterfrom
leonard84:data_iterator

Conversation

@leonard84
Copy link
Copy Markdown
Member

The main motivation is to extract the DataIterator logic from the
PlatformParameterizedSpecRunner into a reusable form, so that it can
serve as foundation for data driven specs in the future.

This also opened up the possibility of adding a new extension point IDataDriver,
which can be used to control the actual iterations of a feature.
A possible use-case is to enable property based testing like jqwik
via a third-party extension.

@leonard84 leonard84 requested a review from marcphilipp June 2, 2022 16:22
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 2, 2022

Codecov Report

Merging #1479 (9261e4a) into master (a897f6b) will increase coverage by 79.73%.
The diff coverage is 83.61%.

@@              Coverage Diff              @@
##             master    #1479       +/-   ##
=============================================
+ Coverage          0   79.73%   +79.73%     
- Complexity        0     4024     +4024     
=============================================
  Files             0      411      +411     
  Lines             0    12710    +12710     
  Branches          0     1649     +1649     
=============================================
+ Hits              0    10134    +10134     
- Misses            0     1981     +1981     
- Partials          0      595      +595     
Impacted Files Coverage Δ
.../org/spockframework/runtime/model/FeatureInfo.java 95.45% <50.00%> (ø)
...ework/runtime/PlatformParameterizedSpecRunner.java 71.42% <70.00%> (ø)
...rg/spockframework/runtime/DataIteratorFactory.java 80.95% <80.95%> (ø)
...ork/runtime/ParameterizedFeatureChildExecutor.java 95.45% <92.30%> (ø)
...a/org/spockframework/runtime/model/MethodInfo.java 95.16% <92.85%> (ø)
...ockframework/runtime/ParameterizedFeatureNode.java 78.18% <100.00%> (ø)
.../spockframework/runtime/SpockExecutionContext.java 95.34% <100.00%> (ø)
.../spockframework/runtime/extension/IDataDriver.java 100.00% <100.00%> (ø)
.../spockframework/runtime/model/ExecutionResult.java 100.00% <100.00%> (ø)
...rg/spockframework/runtime/model/ParameterInfo.java 100.00% <100.00%> (ø)
... and 407 more

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 a897f6b...9261e4a. Read the comment docs.

wolfs
wolfs previously approved these changes Jun 2, 2022
Copy link
Copy Markdown

@wolfs wolfs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used this to replace an ugly hack for Gradle's multi version extension, and it works good! So I'd like to have this as a feature and would use it.

Comment thread spock-core/src/main/java/org/spockframework/runtime/extension/IDataDriver.java Outdated
@leonard84 leonard84 requested a review from marcphilipp June 12, 2022 19:41
@leonard84 leonard84 self-assigned this Jun 12, 2022
@leonard84 leonard84 added this to the 2.2 milestone Jun 12, 2022
marcphilipp
marcphilipp previously approved these changes Jun 19, 2022
@leonard84 leonard84 requested a review from marcphilipp June 24, 2022 16:06
@leonard84 leonard84 merged commit 8105fb5 into spockframework:master Jun 27, 2022
@leonard84 leonard84 deleted the data_iterator branch June 27, 2022 09:40
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.

3 participants