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

Add --fail-fast CLI option to the runner::Basic #196

Merged
merged 9 commits into from
Jan 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,16 @@ All user visible changes to `cucumber` crate will be documented in this file. Th

[Diff](/../../compare/v0.11.0...v0.11.1) | [Milestone](/../../milestone/6)

### Added

- `--fail-fast` CLI option to `runner::Basic`. ([#196])

### Changed

- Optimized `runner::Basic` to not wait the whole batch to complete before executing next `Scenario`s. ([#195])

[#195]: /../../pull/195
[#196]: /../../pull/196



Expand Down
3 changes: 3 additions & 0 deletions book/src/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ OPTIONS:
Coloring policy for a console output

[default: auto]

--fail-fast
Run tests until the first failure

-h, --help
Print help information
Expand Down
2 changes: 2 additions & 0 deletions book/src/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@ fn cat_is_fed(world: &mut AnimalWorld) {
And see the test failing:
![record](rec/quickstart_simple_fail.gif)

> __TIP__: By default, unlike [unit tests](https://doc.rust-lang.org/cargo/commands/cargo-test.html#test-options), failed [step]s don't terminate the execution instantly, and the whole test suite is executed regardless of them. Use `--fail-fast` [CLI] option to stop execution on first failure.

What if we also want to validate that even if the cat was never hungry to begin with, it won't end up hungry after it was fed? So, we may add an another [scenario] that looks quite similar:
```gherkin
Feature: Animal feature
Expand Down
2 changes: 2 additions & 0 deletions book/src/writing/asserting.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ fn cat_is_fed(_: &mut AnimalWorld) {

> __TIP__: To additionally print the state of the `World` at the moment of failure, increase output verbosity via `-vv` [CLI] option.

> __TIP__: By default, unlike [unit tests](https://doc.rust-lang.org/cargo/commands/cargo-test.html#test-options), failed [step]s don't terminate the execution instantly, and the whole test suite is executed regardless of them. Use `--fail-fast` [CLI] option to stop execution on first failure.




Expand Down
Loading