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

Custom separator support for rerun formatter #930

Merged
merged 5 commits into from
Oct 4, 2017

Conversation

kmate
Copy link
Contributor

@kmate kmate commented Sep 20, 2017

Allows to change the separator in the rerun formatter, eg. --format-options '{ separator: " " }'. This way you can get the list of failing tests in a single line that could be handy sometimes.

@charlierudolph
Copy link
Member

What's the use case for this? It's printed with new lines to make it easier to read. Parsing the rerun file relies on it being newline separated

@kmate
Copy link
Contributor Author

kmate commented Sep 21, 2017

It is easier to copy a single line from the terminal and append it to the end of the previous command, so you can rerun the failing tests quickly without using a file.

@charlierudolph
Copy link
Member

The point of the rerun file is so you would just specify it instead of having to copy and paste anything.

cucumber-js @rerun.txt

Is there a reason you prefer copy / pasting as opposed to that?

@kmate
Copy link
Contributor Author

kmate commented Sep 23, 2017

Eg. copy the last line from a CI log and re-run it locally.

@charlierudolph
Copy link
Member

Okay cool. Thanks for the explanation. Couple things I think this PR still needs

  • documentation update (probably with the line about the rerun formatter) in docs/cli. This should mention the use case about CI and a warning that using this option does not work with the rerun file.
  • a test (probably in rerun_formatter_spec.js)
  • a possible change to the interface. All the format options thus far are used by all the formatters. Since this is specific to the rerun formatter, thoughts on the interface being --format-options '{ "rerun": { "separator": " " } }'? I think thats useful as the options is more self documenting about what it applies to.

@kmate
Copy link
Contributor Author

kmate commented Sep 24, 2017

Ok, I will do it soon.

@kmate
Copy link
Contributor Author

kmate commented Sep 26, 2017

Done.

Copy link
Member

@charlierudolph charlierudolph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry took me a while to get around to this. One last update needed and this will be merged. Thanks!

})
_.each(
[
{ separator: null, label: 'default' },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this case, if I log the output it is features/a.feature:1nullfeatures/b.feature:2. I believe it should be switched to undefined in order to trigger the default case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch. Actually I needed to define both the option and the expected separator.

@charlierudolph charlierudolph merged commit 81aeaed into cucumber:master Oct 4, 2017
@aslakhellesoy
Copy link
Contributor

Hi @kmate,

Thanks for your making your first contribution to Cucumber, and welcome to the Cucumber committers team! You can now push directly to this repo and all other repos under the cucumber organization! 🍾

In return for this generous offer we hope you will:

  • ✅ Continue to use branches and pull requests. When someone on the core team approves a pull request (yours or someone else's), you're welcome to merge it yourself.
  • 💚 Commit to setting a good example by following and upholding our code of conduct in your interactions with other collaborators and users.
  • 💬 Join the community Slack channel to meet the rest of the team and make yourself at home.
  • ℹ️ Don't feel obliged to help, just do what you can if you have the time and the energy.
  • 🙋 Ask if you need anything. We're looking for feedback about how to make the project more welcoming, so please tell us!

On behalf of the Cucumber core team,
Aslak Hellesøy
Creator of Cucumber

@charlierudolph
Copy link
Member

Released in 3.0.4

@lock
Copy link

lock bot commented Oct 24, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants