🤔 Background
Same class as #871 and #873: an unusable path is accepted, the work it was meant to do is skipped, and the run still reports success.
--env / --boot with a missing file
src/main.sh sources the bootstrap without checking that it exists. A typo'd path leaks a raw shell error, runs no tests at all, and exits 0:
$ ./bashunit --env missing.sh tests/
src/main.sh: line 242: missing.sh: No such file or directory
$ echo $?
0
That is the entire output — no header, no test lines, no totals. With a valid bootstrap the same command runs the suite normally, so the failure mode is "green build that tested nothing".
Report paths that cannot be written
--report-json, --log-junit and friends do not check that the destination is writable. The suite runs, the report is silently not produced, and the run exits 0:
$ ./bashunit --report-json /nope/dir/o.json tests/
All tests passed
src/reports.sh: line 207: /nope/dir/o.json: No such file or directory
$ echo $?
0
$ test -f /nope/dir/o.json || echo "no report written"
no report written
A CI job that runs tests and then uploads the report gets a green build and an empty artifact.
Also unvalidated
Suggested fix
Fail fast at the boundary, matching bashunit::main::validate_config_or_exit added in #874:
--env/--boot: error and exit non-zero when the file does not exist or is not readable.
- Report options: verify the parent directory exists and is writable before the run starts, so the failure is reported up front rather than after the suite has passed.
--seed: validate as a non-negative integer.
🤔 Background
Same class as #871 and #873: an unusable path is accepted, the work it was meant to do is skipped, and the run still reports success.
--env/--bootwith a missing filesrc/main.shsources the bootstrap without checking that it exists. A typo'd path leaks a raw shell error, runs no tests at all, and exits0:That is the entire output — no header, no test lines, no totals. With a valid bootstrap the same command runs the suite normally, so the failure mode is "green build that tested nothing".
Report paths that cannot be written
--report-json,--log-junitand friends do not check that the destination is writable. The suite runs, the report is silently not produced, and the run exits0:A CI job that runs tests and then uploads the report gets a green build and an empty artifact.
Also unvalidated
--seed abcis silently ignored (exit0). Lower impact than the above, but the same gap — --jobs with a non-integer value hangs on Bash 3.x and is silently ignored on Bash 4.3+ #873 fixed the other numeric options.Suggested fix
Fail fast at the boundary, matching
bashunit::main::validate_config_or_exitadded in #874:--env/--boot: error and exit non-zero when the file does not exist or is not readable.--seed: validate as a non-negative integer.