Skip to content

fix(runner): honour --stop-on-failure on runtime errors#622

Merged
Chemaclass merged 2 commits intomainfrom
fix/383-stop-on-failure-illegal-option
Apr 18, 2026
Merged

fix(runner): honour --stop-on-failure on runtime errors#622
Chemaclass merged 2 commits intomainfrom
fix/383-stop-on-failure-illegal-option

Conversation

@Chemaclass
Copy link
Copy Markdown
Member

@Chemaclass Chemaclass commented Apr 18, 2026

Summary

  • Runtime errors (e.g. command not found, illegal option, unbound variable) were not stopping the runner when --stop-on-failure / BASHUNIT_STOP_ON_FAILURE=true was enabled. Only assertion failures triggered the stop.
  • The runtime-error branch in bashunit::runner::process_test_result now checks bashunit::env::is_stop_on_failure_enabled and exits (or marks the parallel runner) the same way the assertion-failure branch does.

Closes #383

Runtime errors (e.g. `command not found`, `illegal option`) now
honour `--stop-on-failure` / `BASHUNIT_STOP_ON_FAILURE=true`, matching
the behaviour for assertion failures.

Closes #383
@Chemaclass Chemaclass added the bug Something isn't working label Apr 18, 2026
@Chemaclass Chemaclass self-assigned this Apr 18, 2026
@github-actions
Copy link
Copy Markdown
Contributor

✅ Contributor Report

User: @Chemaclass
Status: Trusted contributor (whitelisted)

This user is on the trusted contributors list and was automatically approved.

…r test

Under `--strict` (`set -euo pipefail`), `output=$(./bashunit …)` would
abort the test body on the inner non-zero exit. Capture the exit code
via `|| exit_code=$?` and compare with `assert_same`, since
`assert_general_error` reads `$?` (or arg3), not arg1.
@Chemaclass Chemaclass merged commit b0a3e79 into main Apr 18, 2026
62 of 65 checks passed
@Chemaclass Chemaclass deleted the fix/383-stop-on-failure-illegal-option branch April 18, 2026 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stop on failure not working with illegal option errors

2 participants