Skip to content

Commit

Permalink
cli: remove deprecated retryTagFilter option (#1713)
Browse files Browse the repository at this point in the history
* remove retryTagFilter camelCased option

* add changelog entry
  • Loading branch information
davidjgoss committed Jun 30, 2021
1 parent b8e83b7 commit 2b222f0
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 33 deletions.
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

0 comments on commit 2b222f0

Please sign in to comment.