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

error: unknown option '--rerun' #971

Closed
Gump0422 opened this issue Aug 27, 2021 · 3 comments · Fixed by #973
Closed

error: unknown option '--rerun' #971

Gump0422 opened this issue Aug 27, 2021 · 3 comments · Fixed by #973
Labels
bug @serenity-js/cucumber Adapter for Cucumber.js

Comments

@Gump0422
Copy link

Gump0422 commented Aug 27, 2021

It seems such code below not going to a correct way
https://github.com/serenity-js/serenity-js/blob/master/packages/cucumber/src/cli/CucumberOptions.ts

asArgumentsForCucumber(version: Version): string[] { console.log(version) return Object.keys(this.config) .reduce( (acc, option: keyof CucumberConfig) => isNotEmpty(this.config[option]) ? acc.concat(this.optionToValues(option, this.config[option], version)) : acc, [ 'node', 'cucumber-js' ], ) .concat(this.config.rerun ?? []); }

cucumberOpts from my side
cucumberOpts: { rerun: "@rerun.txt" }
Result will show as picture:
I do think ""--rerun","@rerun.txt"" should be remove, if not, will go wrong with " error: unknown option '--rerun' "
image

@jan-molak
Copy link
Member

Hi @Gump0422, would you be able to create a minimal reproducible example by forking one of the Serenity/JS + Cucumber templates and pasting a link here?

@jan-molak
Copy link
Member

jan-molak commented Aug 27, 2021

Ah OK, I think I know what you mean.

So, if there's a rerun option specified in the config, there's an additional parameter added, which shouldn't have been there.

Potentially related protractor-cucumber-framework/protractor-cucumber-framework#219

@jan-molak jan-molak added @serenity-js/cucumber Adapter for Cucumber.js bug labels Aug 27, 2021
jan-molak added a commit that referenced this issue Aug 27, 2021
…exist

When executing Cucumber in re-run mode, specifying a path to a "rerun" file that didn't exist
resulted in a Cucumber throwing an error. This was problematic as it required the user to modify
Cucumber config each time they wanted to re-run failed tests. This change prevents Serenity from
passing the location of "rerun" file to Cucumber if it doesn't exist, allowing the tests to be
executed normally if there were no failures, or re-ran otherwise

fix #971 re protractor-cucumber-framework/protractor-cucumber-framework#219
@Gump0422
Copy link
Author

Hi, @jan-molak
Good for you, I appreciated it very much, I will try this fixed version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug @serenity-js/cucumber Adapter for Cucumber.js
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants