Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@
- Performance: `--coverage` is roughly 5x faster and `--coverage-report-html` roughly 19x β€” a run over this repo went from 16.2s to 2.9s, and a 128-file HTML report from 58.7s to 3.1s. The report phase emits each format in one awk invocation per run instead of Bash loops and forks per file and per row, and the capture path writes records straight to disk, normalizes a path with one fork instead of four, and reads each cache once (#1092, #1096, #1098, #1099, #1102, #1104, #1110, #1117)

### Fixed
- A bootstrap file that fails to load now reports it and exits non-zero, through every path that loads one (`BASHUNIT_BOOTSTRAP`, `--env`, `--boot`, and the `bench` equivalents), instead of leaving the run with no tests, no summary and exit 0. `source` is a POSIX special builtin, so a syntax error or a bare `exit` in the file ends the shell before anything after the call can run β€” an absent bootstrap is still ignored, since the default path is one most projects do not have (#1179, #1181)
- A bootstrap file that fails to load now reports it and exits non-zero, through every path that loads one (`BASHUNIT_BOOTSTRAP`, `--env`, `--boot`, and the `bench` equivalents), instead of leaving the run with no tests, no summary and exit 0. a syntax error makes `source` return non-zero, which ends the shell because `set -e` is active there, and a bare `exit` in the file ends it regardless β€” either way nothing after the call runs β€” an absent bootstrap is still ignored, since the default path is one most projects do not have (#1179, #1181)
- A report path that is a directory (`--report-junit build/` with the filename forgotten) fails fast with `is a directory, not a file` instead of passing validation, failing inside the writer with a raw bash message naming a bashunit source file, and exiting 0 with no report written. Affects every report flag and the `bench` equivalents (#1177)
- `bashunit init` no longer adds a dead `BASHUNIT_BOOTSTRAP` line to `.env` on every run: it commented out the existing setting and appended a fresh copy even when the value was unchanged, so a third run left three lines, two of them inert. It also now reports what it did to `.env`, the one file it wrote without saying so (#1175)
- A coverage run that tracked no executable line at all no longer reports it as `Coverage 0% is below minimum N%`: that 0% is arithmetic rather than a measurement, and the message sent the reader to their tests when the cause is almost always a `--coverage-paths` that matched nothing. The gate still fails, now naming the real problem (#1171)
- A run whose scratch directory goes missing now says so once, on stderr, naming the directory, instead of recovering silently β€” the recovery added for that case left no trace at all, which is worse for diagnosis than the misleading error it replaced (#1167)
- A run's scratch-directory cleanup can no longer widen to every concurrent run's: the safety guard accepted any path containing `/bashunit/run/`, which includes the per-OS parent that all runs on a machine share, so a run whose random token came out empty would have deleted the others' directories along with its own. Both the run and the parallel trees now require the token segment (#1165)
- A run survives its scratch directory going missing instead of reporting a valid test file as unsourceable: `source "$file" 2>"$dir/source_err"` fails on the *redirect* when the directory is gone, which bash reports as the command failing, so the runner printed `Failed to source '<file>' (exit 1, ..., no stderr)` and named the one thing that was not at fault (#1163)
- A run survives its scratch directory going missing, and says so once on stderr naming the directory, instead of reporting a valid test file as unsourceable: `source "$file" 2>"$dir/source_err"` fails on the *redirect* when the directory is gone, which bash reports as the command failing, so the runner printed `Failed to source '<file>' (exit 1, ..., no stderr)` and named the one thing that was not at fault (#1163, #1167)
- Duplicate test functions are detected under `--parallel` again: the check ran inside the per-file loop, which `--parallel` backgrounds, so the state it set died with the subshell and a file where one of two same-named tests never ran reported "All tests passed" and exited 0. The report also names the line of every definition now, instead of leaving the second one to be found by hand (#1147)
- A `@data_provider` naming a function that is not defined no longer makes the test vanish: the run reported "No tests found", blaming a missing test rather than the missing provider and never printing the annotation's name. Both that and a provider that yields no data are now errors naming the provider, and under `--parallel` the failure reaches the aggregate instead of the run printing the error and exiting 0 (#1145)
- `mock`, `mock_sequence` and `spy` report a usable-name error instead of a raw bash syntax error when the command name carries whitespace or shell syntax β€” `mock "ls -l" echo hi` used to print `syntax error near unexpected token '-l'` from inside bashunit (#1136)
Expand Down
Loading