fix(cli): report a bootstrap that never finished loading - #1180
Merged
Conversation
A bootstrap that fails to load left the run with no tests, no summary and exit 0, so CI passed having executed nothing. A bare 'exit' in the file was worse: entirely silent. [ -f ] && source cannot catch this. source is a POSIX special builtin, so a syntax error in the file, or an exit, terminates the shell at that point -- '|| status=$?' never runs and nothing after the call executes. The --env/--boot flag path already validated its file (#875); the env-var path never did. bash -n would catch it but costs an interpreter fork on every invocation, which the cold-start budget caps at 1, and this repo has a bootstrap -- all ~258 nested acceptance runs would pay it. Leave a marker instead and let the EXIT trap report one that was never cleared: fork-free, and it covers both failure modes. An absent bootstrap stays silent: BASHUNIT_BOOTSTRAP defaults to tests/bootstrap.sh, which most projects do not have. Closes #1179
This was referenced Aug 13, 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 #1179
A bootstrap that fails to load leaves the run with no tests, no summary and
exit 0 — CI passes having executed nothing:
[ -f ] && sourcecannot catch it:sourceis a POSIX special builtin, soa syntax error or a bare
exitends the shell at that point and nothing afterthe call runs. The
--env/--bootflag path already validated its file (#875);the env-var path never did.
💡 Changes
bash -npre-validation, which costs an interpreter fork on every invocation — capped at 1 bybashunit_coldstart_forks_test.sh, and this repo has a bootstrap, so ~258 nested acceptance runs would pay it (fork budget tests still 11/11)