Skip to content

Commit 3504d78

Browse files
committed
docs(blog): add release posts for 0.41.0 and 0.42.0
Announcement posts summarizing the user-facing changes of both releases: 0.41.0 (new assertions, JSON/TAP file reports, --retry/--random-order/ --shard) and 0.42.0 (--rerun-failed, --jobs auto, watcher-free watch, performance work, and the reliability fixes to hooks, build and installer). Claude-Session: https://claude.ai/code/session_01JSeB8UzLCpqst55hAK6dED
1 parent f54da91 commit 3504d78

2 files changed

Lines changed: 121 additions & 0 deletions

File tree

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
date: '2026-07-11'
3+
title: 'Release 0.41.0'
4+
description: 'Three new assertions, JSON and file-based TAP reports, and three test-selection flags — retry flaky tests, shuffle the run order with a seed, and shard a suite across CI runners.'
5+
coverAlt: 'New assertions, JSON/TAP reports, and --retry, --random-order and --shard test-selection flags'
6+
7+
aside: false
8+
---
9+
10+
# {{ $frontmatter.title }}
11+
12+
<time>{{ $formatDate($frontmatter.date) }}</time>
13+
14+
## New features
15+
16+
### Control which tests run, and in what order
17+
18+
Three flags give you finer control over a run, and each one composes with `--parallel`:
19+
20+
- **`--retry <n>`** (or `BASHUNIT_RETRY`) re-runs a failed test up to `n` extra times and reports it as passed if any attempt passes. It fails only after every attempt fails, and a test that recovers on retry is annotated so the flakiness stays visible instead of being hidden. Works with `--stop-on-failure` too ([#737](https://github.com/TypedDevs/bashunit/issues/737)).
21+
- **`--random-order`** shuffles the order of test files and of the tests within each file to surface hidden inter-test coupling. Pair it with **`--seed <n>`** (or `BASHUNIT_SEED`) to replay a specific shuffle; when you omit the seed, bashunit generates one and prints it in the run header ([#738](https://github.com/TypedDevs/bashunit/issues/738)).
22+
- **`--shard <index>/<total>`** runs a deterministic, non-overlapping subset of the test files, so you can split one suite across several parallel CI runners ([#739](https://github.com/TypedDevs/bashunit/issues/739)).
23+
24+
```bash
25+
bashunit --retry 2 tests/
26+
bashunit --random-order --seed 12345 tests/
27+
bashunit --shard 1/4 tests/ # runner 1 of 4
28+
```
29+
30+
### File-based JSON and TAP reports
31+
32+
Alongside the streaming `--output tap`, you can now write reports to a file:
33+
34+
- **`--report-json <file>`** writes results as JSON — summary counts plus per-test records — with no `jq` dependency ([#741](https://github.com/TypedDevs/bashunit/issues/741)).
35+
- **`--report-tap <file>`** writes a TAP v13 report to a file, complementing the existing streaming output ([#740](https://github.com/TypedDevs/bashunit/issues/740)).
36+
37+
```bash
38+
bashunit --report-json report.json --report-tap report.tap tests/
39+
```
40+
41+
### Three new assertions
42+
43+
- **`assert_file_permissions <mode> <file>`** — asserts a file's octal permission mode, portable across GNU and BSD `stat` ([#742](https://github.com/TypedDevs/bashunit/issues/742)).
44+
- **`assert_array_length <n> <array>`** — asserts an array has exactly `n` elements ([#743](https://github.com/TypedDevs/bashunit/issues/743)).
45+
- **`assert_within_delta <expected> <actual> <delta>`** — asserts a number is within a tolerance, floats included ([#744](https://github.com/TypedDevs/bashunit/issues/744)).
46+
47+
## Bug fixes
48+
49+
- The `watch` subcommand crashed with `bashunit::watch::run: command not found` in the released binary because `src/watch.sh` was missing from the build. It is now bundled ([#735](https://github.com/TypedDevs/bashunit/issues/735)).
50+
51+
## Changes
52+
53+
- Faster test execution: subprocess forks were removed from the hot paths, with no change in behaviour.
54+
55+
---
56+
57+
See the full changelog for [0.41.0](https://github.com/TypedDevs/bashunit/releases/tag/0.41.0) on GitHub.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
date: '2026-07-20'
3+
title: 'Release 0.42.0'
4+
description: 'A reliability release: replay only the last failures with --rerun-failed, cap parallelism with --jobs auto, a watcher-free watch fallback, big speed-ups, and a wave of correctness fixes to lifecycle hooks, nested runs, the build and the installer.'
5+
coverAlt: 'Rerun-failed, jobs auto, watch fallback, performance work and correctness fixes across hooks, build and installer'
6+
7+
aside: false
8+
---
9+
10+
# {{ $frontmatter.title }}
11+
12+
<time>{{ $formatDate($frontmatter.date) }}</time>
13+
14+
This is a big reliability release. New workflow features sit on top of a large round of correctness work — several of the fixes came out of a single audit that uncovered one problem after another in the build, the runner and the installer.
15+
16+
## New features
17+
18+
### Replay only what just failed with `--rerun-failed`
19+
20+
Every run now records its failing tests to `.bashunit/last-failed`. Passing `--rerun-failed` (or `BASHUNIT_RERUN_FAILED=true`) replays exactly those tests instead of the whole suite — a much tighter edit-run loop while you fix a handful of failures. A fully green run clears the cache, an empty cache falls back to running everything, and it composes with `--filter`, `--tag` and `--parallel`. Add `.bashunit/` to your `.gitignore` ([#776](https://github.com/TypedDevs/bashunit/issues/776)).
21+
22+
```bash
23+
bashunit tests/ # a few tests fail
24+
bashunit --rerun-failed tests/ # replay just those
25+
```
26+
27+
### Cap parallel concurrency with `--jobs auto`
28+
29+
`--jobs auto` (or `-j auto`) caps parallel workers at the machine's CPU core count, portable across Linux, macOS and BSD. The default stays unlimited ([#766](https://github.com/TypedDevs/bashunit/issues/766)).
30+
31+
### `watch` works without a file watcher installed
32+
33+
The `watch` subcommand no longer requires `inotifywait` or `fswatch`. When neither is present it falls back to pure-shell polling instead of exiting, with the interval set by `BASHUNIT_WATCH_INTERVAL` (default `2` seconds) ([#779](https://github.com/TypedDevs/bashunit/issues/779)).
34+
35+
### Shell tab-completion
36+
37+
bashunit now ships bash and zsh tab-completion scripts under `completions/` — subcommands, `test` flags with value hints, and assertion names — kept in sync with the CLI by an anti-drift CI test ([#778](https://github.com/TypedDevs/bashunit/issues/778)).
38+
39+
## Performance
40+
41+
- **Multi-file runs are no longer quadratic in the number of files.** Each file's test functions are unset once it has been processed, so test subshells stop forking an ever-growing shell. bashunit's own 63-file unit suite dropped from ~64s to ~22s sequential, and ~26s to ~7s in parallel ([#829](https://github.com/TypedDevs/bashunit/issues/829)).
42+
- **`bashunit doc` is ~100× faster.** It used to fork an `echo | sed` pipe per line of the assertion docs; a single `awk` pass now prints the same output in about 50ms instead of ~5s ([#832](https://github.com/TypedDevs/bashunit/issues/832)).
43+
- More broadly, the hot paths are now near fork-free, snapshot and `--tag` scans are cached, and failure rendering is single-pass. On Bash 3.2: 100×10 `assert_equals` ~1.50s → ~0.76s, 500 snapshot assertions ~7.5s → ~3.0s.
44+
45+
## Bug fixes
46+
47+
- **Failing lifecycle hooks are now consistent.** A failing `set_up_before_script` or `set_up` used to behave three different ways depending on the shape of the hook and the Bash version — sometimes silently ignored, sometimes counted wrong with no message. Now every test in the file is marked failed with the hook's error, the totals stay consistent, and the suite continues to the next file. A strict test file can no longer abort the whole run mid-suite ([#836](https://github.com/TypedDevs/bashunit/issues/836)).
48+
- **Run-mode flags no longer leak into nested runs.** Flags like `--parallel`, `--simple`, `--strict`, `--retry`, `--seed` and the report paths were exported into the environment, so a script under test that itself called bashunit silently inherited the parent's configuration. They are now this-process-only; `BASHUNIT_*=…` configuration is unchanged ([#834](https://github.com/TypedDevs/bashunit/issues/834), [#837](https://github.com/TypedDevs/bashunit/issues/837)).
49+
- **`install.sh` fails fast.** A failed download, clone, build or copy now aborts with a clear error instead of reporting success — a failed beta clone could previously run the build in the caller's directory ([#840](https://github.com/TypedDevs/bashunit/issues/840)).
50+
- **`./build.sh --verify` actually gates now**, exiting non-zero when the built binary fails the suite, and the verification run no longer crashes mid-suite ([#834](https://github.com/TypedDevs/bashunit/issues/834)).
51+
- `./bashunit bench` works again when run from a repository checkout ([#834](https://github.com/TypedDevs/bashunit/issues/834)).
52+
- Snapshot placeholders (`::ignore::`) now work on systems without perl; multi-line placeholders still need it ([#823](https://github.com/TypedDevs/bashunit/issues/823)).
53+
- Runs no longer leak a scratch directory under `$TMPDIR/bashunit/run/` — it is cleaned up on exit, including for `--version`/`--help`, subcommands and Ctrl-C ([#811](https://github.com/TypedDevs/bashunit/issues/811)).
54+
- `--test-timeout` no longer occasionally reports a fast test as timed out.
55+
56+
## Changes
57+
58+
- **`build.sh` was hardened**: it runs under `set -euo pipefail`, derives the bundled file list from the entrypoint's own `source` order (one source of truth), guards against duplicate embeds and missing doc markers, drops `eval`, and gates every build behind a `bash -n` syntax check ([#834](https://github.com/TypedDevs/bashunit/issues/834)).
59+
- Per-test timing now defaults to `auto`: shown only when the shell has a fork-free clock, so a plain run stays fast on Bash 3.2. `--profile`, `--verbose` and the reports always measure ([#765](https://github.com/TypedDevs/bashunit/issues/765)).
60+
- `assert_equals`/`assert_same` failures with multiline values now render a git word-diff below the header (opt out with `BASHUNIT_NO_DIFF=true`) ([#777](https://github.com/TypedDevs/bashunit/issues/777)).
61+
62+
---
63+
64+
See the full changelog for [0.42.0](https://github.com/TypedDevs/bashunit/releases/tag/0.42.0) on GitHub.

0 commit comments

Comments
 (0)