Skip to content

fix(cli): name the actual cause when a bootstrap file is unusable - #1264

Merged
Chemaclass merged 2 commits into
mainfrom
fix/bootstrap-diagnosis
Aug 14, 2026
Merged

fix(cli): name the actual cause when a bootstrap file is unusable#1264
Chemaclass merged 2 commits into
mainfrom
fix/bootstrap-diagnosis

Conversation

@Chemaclass

Copy link
Copy Markdown
Member

🤔 Background

Related #1262

-e/--env/--boot reported the same thing whatever went wrong, and it was true of one case out of four:

path before why it was wrong
somedir cannot read the bootstrap file a directory is readable — the check is -f, not -r
nope.sh cannot read the bootstrap file it is not there at all
/dev/null cannot read the bootstrap file readable, just not a regular file
unread.sh cannot read the bootstrap file accurate

So --env tests/ or a mistyped filename — both ordinary mistakes — sent the reader to permissions.

Found while verifying the documented bench options table: -e /dev/null exited 1, and the message claimed a readable file could not be read.

💡 Changes

test_a_missing_env_file_without_a_space_stays_terse asserted the old wording. Its intent is the absence of the space explanation, not the phrasing, so it now asserts the accurate message with a comment recording why it moved — rather than being weakened to keep passing.

One message covered four causes and was true of one:

  somedir      cannot read the bootstrap file   (a directory IS readable)
  nope.sh      cannot read the bootstrap file   (it is not there at all)
  /dev/null    cannot read the bootstrap file   (readable, not a regular file)
  unread.sh    cannot read the bootstrap file   (accurate)

The check that rejects a directory is -f, not -r, so the message sent the
reader to permissions for what is really a wrong-path mistake -- and
`--env tests/` or a mistyped filename are ordinary errors.

Each cause now names itself. The #1247 space-split explanation still prints on
top when it applies.

test_a_missing_env_file_without_a_space_stays_terse asserted the old wording;
its intent is the absence of that explanation, not the phrasing, so it now
asserts the accurate message and says why in a comment.

Closes #1262
@Chemaclass Chemaclass added the bug Something isn't working label Aug 14, 2026
@Chemaclass Chemaclass self-assigned this Aug 14, 2026
The unreadable-file case can only be set up with chmod, which is a no-op for
root, so it skips on the Bash 3.0 CI image and runs everywhere else. That made
bashunit_init_test.sh carry two skipped tests there, and
bashunit_summary_output_test.sh uses that file to demonstrate --show-skipped
and asserts the wording "There was 1 skipped test:". Green locally, five Bash
3.0 jobs red.

Move the four tests out so the count stays one, and leave a comment at the top
of the file naming the constraint and why a conditional skip is the dangerous
kind -- the failure is invisible on a dev machine.
@Chemaclass
Chemaclass merged commit 1cff381 into main Aug 14, 2026
37 checks passed
@Chemaclass
Chemaclass deleted the fix/bootstrap-diagnosis branch August 14, 2026 18:15
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.

1 participant