Clobber all filter types when override one filter type in the environment options #748
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If using
-Dcucumber.options="path/file.feature --name scenario_name"
, to run a specific scenario, then any tag filters (or name filters) specified in@CucumberOptions
will be clobbered. However if instead using-Dcucumber.options="path/file.feature:line"
, to run a specific scenario, then the tag or name filters specified in@CucumberOptions
will not be clobbered, and and "inconsistent filters" exception will occur. The same happens when using-Dcucumber.options="@rerun.txt"
, since the@rerun.txt
will contain feature paths with line filters.The explanation from an implementation viewpoint is that this is because, tag- and name-filters are put in the same filter list, whereas the line filters need to be kept together the their feature paths (each line filter is only applied to its one feature path), so the stored in the feature path list.
This PR makes the specification of feature paths will line filters, or specification using the
@rerun.txt
syntax, clobber the list with tag and name filters from the@CucumberOptions
. And also that the specification of tag of name filters, strips the line filters from feature paths from@CucumberOptions
.Should a file with feature paths and line filters be specified in the
@CucumberOptions
, those line filters will not be stripped if specifying a tag or name filter in-Dcucumber.options
. In part because while it is possible, the@rerun.txt
was not primarily intended for this, and in part because it would more complicated to implement.