Problem
--report-junit adir (a forgotten filename) passes validation, because a
directory satisfies both -e and -w. The run then reaches the writer:
src/reports/junit.sh: line 44: adir: Is a directory
and exits 0. So the report is never written, the message names a bashunit
source file rather than the user's mistake, and CI stays green — a job that
publishes that report finds no file and nothing red to explain it.
A missing parent directory is caught properly (Error: … cannot be written,
exit 1), which is what makes the gap easy to miss.
Fix
Reject a directory in both writability checks, with a message that names the
actual mistake:
Error: BASHUNIT_REPORT_JSON is a directory, not a file: 'adir'.
"cannot be written" would send the reader to permissions; a directory is
almost always a forgotten filename.
Affects --report-junit, --report-json, --report-html, --report-md,
--log-junit and the bench equivalents — all five now exit 1.
Problem
--report-junit adir(a forgotten filename) passes validation, because adirectory satisfies both
-eand-w. The run then reaches the writer:and exits 0. So the report is never written, the message names a bashunit
source file rather than the user's mistake, and CI stays green — a job that
publishes that report finds no file and nothing red to explain it.
A missing parent directory is caught properly (
Error: … cannot be written,exit 1), which is what makes the gap easy to miss.
Fix
Reject a directory in both writability checks, with a message that names the
actual mistake:
"cannot be written" would send the reader to permissions; a directory is
almost always a forgotten filename.
Affects
--report-junit,--report-json,--report-html,--report-md,--log-junitand thebenchequivalents — all five now exit 1.