Skip to content

Book / Docs / Readme teach using Cucumber.run() - which does not make cargo test fail with non-zero exit code #334

Open
@Artalus

Description

@Artalus

#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 new run_and_exit() method - which, unlike run(), 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 the cargo test command never failed technically 🙂

My suggestion would be to

  • either simply mass-replace every use of .run( with .run_and_exit(;
  • or at least have a plaque right in Quickstart part of the Book, stating the difference between the two, if .run() is considered to be of some value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingk::documentationRelated to project documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions