Skip to content

[Core] cucumber.feature preserves tags when used with a feature argument #1986

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

Merged
merged 1 commit into from
Jun 5, 2020

Conversation

mpkorstanje
Copy link
Contributor

@mpkorstanje mpkorstanje commented Jun 5, 2020

The feature option can be used with either a rerun file or a feature path. For
example when used as a property:

cucumber.feature=path/to/features
cucumber.feature=@path/to/rerun.txt

Cucumber options consist of a hierarchy of options. When the feature options is
used with a rerun file; tag and name filters from the previous level should be
removed. This ensures that all scenarios in the rerun file and only the
scenarios in the rerun file should be executed (unless the selection is filtered
more at this or the next level).

When used with a feature argument without a line filter this should not be the case.
However builder::addRerun would be invoked anyway.

When parsing cucumber.feature for rerun files, when no rerun files are present an
empty collection is returned. Because splitAndMap was used rather then
splitAndThenFlatMap, builder::addRerun would always be invoked.

Fixes: #1985

@mpkorstanje mpkorstanje changed the title [Core] cucumber.feature preserves tags when used with a feature argument [Core] cucumber.feature preserves tags when used with a feature argument Jun 5, 2020
The feature option can be used with either a rerun file or a feature path. For
example when used as a property:

```
cucumber.feature=path/to/features
cucumber.feature=@path/to/rerun.txt
```

Cucumber options consist of a hierarchy of options. When the feature options is
used with a rerun file; tag and name filters from the previous level should be
removed. This ensures that all scenarios in the rerun file and only the
scenarios in the rerun file should be executed (unless the selection is filtered
more at this or the next level).

When used with a feature argument without a line filter this should not be the case.
However `builder::addRerun` would be invoked anyway.

When parsing `cucumber.feature` for rerun files, when no rerun files are present an
empty collection is returned. Because `splitAndMap` was used rather then
`splitAndThenFlatMap`, `builder::addRerun` would always be invoked.

Fixes: #1985
@mpkorstanje mpkorstanje force-pushed the core-do-not-clobber-tags-on-feature-argument branch from 2e75dcf to 7965517 Compare June 5, 2020 21:20
@mpkorstanje mpkorstanje marked this pull request as ready for review June 5, 2020 21:22
@coveralls
Copy link

coveralls commented Jun 5, 2020

Coverage Status

Coverage remained the same at 85.956% when pulling 7965517 on core-do-not-clobber-tags-on-feature-argument into 969f82c on master.

@mpkorstanje mpkorstanje merged commit ca2b488 into master Jun 5, 2020
@mpkorstanje mpkorstanje deleted the core-do-not-clobber-tags-on-feature-argument branch June 5, 2020 21:35
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.

Tag expressions are lost when specifying external feature file locations
2 participants