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

cli: remove deprecated retryTagFilter option #1713

Merged
merged 2 commits into from
Jun 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Please see [CONTRIBUTING.md](https://github.com/cucumber/cucumber/blob/master/CO
### Breaking changes

* Drop support for Node.js 10 and 15, add support for Node.js 16
* Remove deprecated `--retryTagFilter` option (the correct option is `--retry-tag-filter`)

### Added

Expand Down
23 changes: 1 addition & 22 deletions features/retry.feature
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,6 @@ Feature: Retry flaky tests
"""
And it fails

@spawn
Scenario: running Cucumber JS with --retryTagFilter in camel case will result in a warning
Given a file named "features/a.feature" with:
"""
Feature:
Scenario:
Given a step
"""
Given a file named "features/step_definitions/cucumber_steps.js" with:
"""
const {Given} = require('@cucumber/cucumber')

Given(/^a step$/, function() {})
"""
When I run cucumber-js with `--retry 1 --retryTagFilter @flaky`
Then the error output contains the text:
"""
the argument --retryTagFilter is deprecated and will be removed in a future release; please use --retry-tag-filter
"""
But it passes

Scenario: running Cucumber JS with negative --retry will fail
When I run cucumber-js with `--retry -1`
Then the error output contains the text:
Expand Down Expand Up @@ -590,4 +569,4 @@ Feature: Retry flaky tests
Then it fails
And scenario "Failing" attempt 0 step "Given a failing step" has status "failed"
And scenario "Failing" attempt 1 step "Given a failing step" has status "failed"
And scenario "Passing" step "Given a passing step" has status "skipped"
And scenario "Passing" step "Given a passing step" has status "skipped"
10 changes: 1 addition & 9 deletions src/cli/argv_parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ const ArgvParser = {
0
)
.option(
'--retryTagFilter, --retry-tag-filter <EXPRESSION>',
'--retry-tag-filter <EXPRESSION>',
`only retries the features or scenarios with tags matching the expression (repeatable).
This option requires '--retry' to be specified.`,
ArgvParser.mergeTags,
Expand Down Expand Up @@ -236,14 +236,6 @@ const ArgvParser = {
args: program.args,
}
},

lint(fullArgv: string[]): void {
if (fullArgv.includes('--retryTagFilter')) {
console.warn(
'the argument --retryTagFilter is deprecated and will be removed in a future release; please use --retry-tag-filter'
)
}
},
}

export default ArgvParser
2 changes: 0 additions & 2 deletions src/cli/configuration_builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ export default class ConfigurationBuilder {

constructor({ argv, cwd }: INewConfigurationBuilderOptions) {
this.cwd = cwd

ArgvParser.lint(argv)
const parsedArgv = ArgvParser.parse(argv)
this.args = parsedArgv.args
this.options = parsedArgv.options
Expand Down