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

dev-cmd/tests: add --fail-fast. #15852

Merged
merged 1 commit into from
Aug 11, 2023
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
3 changes: 3 additions & 0 deletions Library/Homebrew/dev-cmd/tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ def tests_args
description: "Enable debugging using byebug."
switch "--changed",
description: "Only runs tests on files that were changed from the master branch."
switch "--fail-fast",
description: "Exit early on the first failing test."
flag "--only=",
description: "Run only <test_script>`_spec.rb`. Appending `:`<line_number> will start at a " \
"specific line."
Expand Down Expand Up @@ -153,6 +155,7 @@ def tests
--color
--require spec_helper
]
bundle_args << "--fail-fast" if args.fail_fast?

# TODO: Refactor and move to extend/os
# rubocop:disable Homebrew/MoveToExtendOS
Expand Down
1 change: 1 addition & 0 deletions completions/bash/brew
Original file line number Diff line number Diff line change
Expand Up @@ -2210,6 +2210,7 @@ _brew_tests() {
--changed
--coverage
--debug
--fail-fast
--generic
--help
--online
Expand Down
1 change: 1 addition & 0 deletions completions/fish/brew.fish
Original file line number Diff line number Diff line change
Expand Up @@ -1470,6 +1470,7 @@ __fish_brew_complete_arg 'tests' -l byebug -d 'Enable debugging using byebug'
__fish_brew_complete_arg 'tests' -l changed -d 'Only runs tests on files that were changed from the master branch'
__fish_brew_complete_arg 'tests' -l coverage -d 'Generate code coverage reports'
__fish_brew_complete_arg 'tests' -l debug -d 'Display any debugging information'
__fish_brew_complete_arg 'tests' -l fail-fast -d 'Exit early on the first failing test'
__fish_brew_complete_arg 'tests' -l generic -d 'Run only OS-agnostic tests'
__fish_brew_complete_arg 'tests' -l help -d 'Show this message'
__fish_brew_complete_arg 'tests' -l online -d 'Include tests that use the GitHub API and tests that use any of the taps for official external commands'
Expand Down
1 change: 1 addition & 0 deletions completions/zsh/_brew
Original file line number Diff line number Diff line change
Expand Up @@ -1815,6 +1815,7 @@ _brew_tests() {
'(--only)--changed[Only runs tests on files that were changed from the master branch]' \
'--coverage[Generate code coverage reports]' \
'--debug[Display any debugging information]' \
'--fail-fast[Exit early on the first failing test]' \
'--generic[Run only OS-agnostic tests]' \
'--help[Show this message]' \
'--online[Include tests that use the GitHub API and tests that use any of the taps for official external commands]' \
Expand Down
2 changes: 2 additions & 0 deletions docs/Manpage.md
Original file line number Diff line number Diff line change
Expand Up @@ -1579,6 +1579,8 @@ Run Homebrew's unit and integration tests.
Enable debugging using byebug.
* `--changed`:
Only runs tests on files that were changed from the master branch.
* `--fail-fast`:
Exit early on the first failing test.
* `--only`:
Run only *`test_script`*`_spec.rb`. Appending `:`*`line_number`* will start at a specific line.
* `--seed`:
Expand Down
4 changes: 4 additions & 0 deletions manpages/brew.1
Original file line number Diff line number Diff line change
Expand Up @@ -2274,6 +2274,10 @@ Enable debugging using byebug\.
Only runs tests on files that were changed from the master branch\.
.
.TP
\fB\-\-fail\-fast\fR
Exit early on the first failing test\.
.
.TP
\fB\-\-only\fR
Run only \fItest_script\fR\fB_spec\.rb\fR\. Appending \fB:\fR\fIline_number\fR will start at a specific line\.
.
Expand Down
Loading