fix(cli): name the actual cause when a bootstrap file is unusable - #1264
Merged
Conversation
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
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.
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 #1262
-e/--env/--bootreported the same thing whatever went wrong, and it was true of one case out of four:somedircannot read the bootstrap file-f, not-rnope.shcannot read the bootstrap file/dev/nullcannot read the bootstrap fileunread.shcannot read the bootstrap fileSo
--env tests/or a mistyped filename — both ordinary mistakes — sent the reader to permissions.Found while verifying the documented
benchoptions table:-e /dev/nullexited 1, and the message claimed a readable file could not be read.💡 Changes
--envspace-split explanation from --env with a space in the path reports a truncated path that does not exist #1247 still prints on top when it appliestest_a_missing_env_file_without_a_space_stays_terseasserted 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.