fix(runner): fail test on syntax error instead of silent halt#628
Merged
Chemaclass merged 6 commits intomainfrom Apr 19, 2026
Merged
fix(runner): fail test on syntax error instead of silent halt#628Chemaclass merged 6 commits intomainfrom
Chemaclass merged 6 commits intomainfrom
Conversation
Capture stderr and exit code of `source "$test_file"`. On syntax error or non-zero exit, record a source hook failure and skip the file so the suite surfaces the problem instead of continuing silently. Closes #220
Contributor
✅ Contributor ReportUser: @Chemaclass This user is on the trusted contributors list and was automatically approved. |
…n shellcheck - Force LC_ALL=C/LANG=C in the acceptance test so bash's "syntax error" message stays English; assert on "Error" + "failed" which the runner renders regardless of locale. - Exclude fixtures/test_bashunit_when_syntax_error.sh from the ShellCheck workflow; the fixture intentionally contains a parse error.
ShellCheck's find-based scanner matched the fixture even with ignore_paths, so rename to .bash to keep it out of both the CI scanner and `make sa`.
ignore_paths only matches directory prefixes; ignore_names skips by basename, which is what we need for a single fixture file.
JesusValeraDev
approved these changes
Apr 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤔 Background
Related #220
When a test file contained a Bash syntax error,
sourceprinted the error to stderr but the runner continued silently — tests after the error were dropped and the run still reported "All tests passed". Bug hid broken test files.💡 Changes
source "$test_file"inbashunit::runner::load_test_filesunexpected EOF) and record a source hook failure viarecord_file_hook_failure