Skip to content

fix(cli): reject a report path that is a directory - #1178

Merged
Chemaclass merged 1 commit into
mainfrom
fix/1177-report-path-directory
Aug 13, 2026
Merged

fix(cli): reject a report path that is a directory#1178
Chemaclass merged 1 commit into
mainfrom
fix/1177-report-path-directory

Conversation

@Chemaclass

Copy link
Copy Markdown
Member

🤔 Background

Related #1177

--report-junit build/ (filename forgotten) 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 — no report written, a message naming a bashunit source file
rather than the user's mistake, and CI green. A job publishing that report
finds no file and nothing red to explain it.

A missing parent directory was already caught properly, which is what made
this gap easy to miss.

💡 Changes

  • Reject a directory in both writability checks
  • Name the actual mistake: is a directory, not a file — "cannot be written" would send the reader to permissions
  • Verified across --report-junit, --report-json, --report-html, --report-md, --log-junit and the bench equivalents; normal paths still write

A directory satisfies both -e and -w, so it passed the writability check and
the run continued to the writer, which failed with a raw bash message naming a
bashunit source file -- and still exited 0. The report was never written and CI
stayed green, so a job publishing it found no file and nothing red to explain
it. A missing parent directory was already caught, which is what made the gap
easy to miss.

Reject it in both writability checks, naming the actual mistake: 'cannot be
written' sends the reader to permissions, and a directory is almost always a
forgotten filename.

Closes #1177
@Chemaclass Chemaclass added the bug Something isn't working label Aug 13, 2026
@Chemaclass Chemaclass self-assigned this Aug 13, 2026
@Chemaclass
Chemaclass merged commit ed420b8 into main Aug 13, 2026
37 checks passed
@Chemaclass
Chemaclass deleted the fix/1177-report-path-directory branch August 13, 2026 22:10
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