-
Notifications
You must be signed in to change notification settings - Fork 68
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
Book / Docs / Readme teach using Cucumber.run() - which does not make cargo test fail with non-zero exit code #334
Comments
To be fair, I don't quite understand what you are suggesting.
As you mentioned earlier, book already uses
Yes, |
Yes, but it just... does it. Silently. I admit I skimmed over the later parts of the book instead of reading them carefully - but I did not even notice the change in the methods used.
Thank you. That is a nice thing to have exposed in the API indeed! But:
I disagree. The quickstart makes it look like "to run the Cucumber tests and be all settled, you only call
I am suggesting that the "default" way to run the tests - taught by the book in its very first "how to" chapter - should involve exiting with non-zero code on test failure. Especially if they are intended to be a part of Interesting enough, my results seem to differ from the book. In the first picture of a failing test there are both
|
#84 brought a valid topic that using
run()
did not allow you to see if the Cucumber tests fail. The output of this ticket was newrun_and_exit()
method - which, unlikerun()
, will make your executable panic and exit with non-zero code.However, the Book - together with Docs.rs and Readme - never mentions that
.run()
still has this behavior and that you can avoid it. The Book is still using the new method, but a-matter-of-fact'ly - some snippets just call.run_and_exit()
instead of.run()
without drawing any attention to it. This has led me to quite a surprise today when I noticed that my automation was not picking up some failures in Cucumber tests, since the executable using.run()
was always exiting with 0, and so thecargo test
command never failed technically 🙂My suggestion would be to
.run(
with.run_and_exit(
;.run()
is considered to be of some value.The text was updated successfully, but these errors were encountered: