Skip to content

Commit 9169f8a

Browse files
ilslvtyranron
andauthored
Add --fail-fast CLI option to runner::Basic (#196)
Co-authored-by: Kai Ren <[email protected]>
1 parent 7da9107 commit 9169f8a

File tree

5 files changed

+116
-16
lines changed

5 files changed

+116
-16
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,16 @@ All user visible changes to `cucumber` crate will be documented in this file. Th
1111

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

14+
### Added
15+
16+
- `--fail-fast` CLI option to `runner::Basic`. ([#196])
17+
1418
### Changed
1519

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

1822
[#195]: /../../pull/195
23+
[#196]: /../../pull/196
1924

2025

2126

book/src/cli.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ OPTIONS:
2525
Coloring policy for a console output
2626
2727
[default: auto]
28+
29+
--fail-fast
30+
Run tests until the first failure
2831
2932
-h, --help
3033
Print help information

book/src/quickstart.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,8 @@ fn cat_is_fed(world: &mut AnimalWorld) {
274274
And see the test failing:
275275
![record](rec/quickstart_simple_fail.gif)
276276

277+
> __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.
278+
277279
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:
278280
```gherkin
279281
Feature: Animal feature

book/src/writing/asserting.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ fn cat_is_fed(_: &mut AnimalWorld) {
7676
7777
> __TIP__: To additionally print the state of the `World` at the moment of failure, increase output verbosity via `-vv` [CLI] option.
7878
79+
> __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.
80+
7981

8082

8183

0 commit comments

Comments
 (0)