Merge pull request #15852 from MikeMcQuaid/tests_fail_fast

dev-cmd/tests: add `--fail-fast`.
This commit is contained in:
Mike McQuaid 2023-08-11 04:45:35 +01:00 committed by GitHub
commit f70a49be2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 12 additions and 0 deletions

View File

@ -24,6 +24,8 @@ module Homebrew
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."
@ -153,6 +155,7 @@ module Homebrew
--color
--require spec_helper
]
bundle_args << "--fail-fast" if args.fail_fast?
# TODO: Refactor and move to extend/os
# rubocop:disable Homebrew/MoveToExtendOS

View File

@ -2210,6 +2210,7 @@ _brew_tests() {
--changed
--coverage
--debug
--fail-fast
--generic
--help
--online

View File

@ -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'

View File

@ -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]' \

View File

@ -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`:

View File

@ -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\.
.