Context
Follow-up to #798 (closed) — the two structural directions it left unexplored, now with fresh numbers after #801-#818 and #830.
Current acceptance suite (61 files, macOS Bash 3.2, 2026-07-19):
| Metric |
Value |
Wall, --parallel (CI mode) |
17.7s |
| Wall, sequential |
94s |
CPU, --parallel run |
~90s |
Nested ./bashunit spawn sites |
~272 |
Cold start (--version) |
53ms |
Minimal nested run (1 noop test, --no-parallel) |
91ms |
Fixed floor: 272 × 91ms ≈ 25s CPU (~28% of the suite's CPU) is nested-run boot cost, before any fixture test executes. The rest is fixture bodies + parent overhead.
Task: audit, don't optimize (yet)
Phase 1 — categorize all 61 tests/acceptance/*_test.sh files. For each, decide:
- A. True CLI-surface test — asserts on process-level behavior: exit codes, rendered console output/snapshots, flag parsing, env-file loading, signal handling, parallel worker behavior. Must stay acceptance. (Fork-census tests, snapshot tests, exit-code tests are all A.)
- B. Function-level test in disguise — spawns
./bashunit but really asserts logic reachable by calling bashunit::* functions directly (like tests/functional/ and tests/unit/ do). Candidate for reclassification; each converted spawn saves ≥91ms CPU plus its fixture body cost.
- C. Mixed — file contains both; note which tests are B.
Output: a table in this issue (file → A/B/C, spawn count, rough per-file wall time, notes). Per-file timing:
for f in tests/acceptance/*_test.sh; do
s=$(python3 -c 'import time;print(int(time.time()*1e9))')
./bashunit "$f" >/dev/null 2>&1
e=$(python3 -c 'import time;print(int(time.time()*1e9))')
echo "$(( (e-s)/1000000 ))ms $f"
done | sort -rn
Phase 2 — file follow-up issues (one per coherent batch of B/C conversions, biggest measured win first). Do NOT convert anything in this issue's PR — the audit table and follow-up issues are the deliverable. A conversion batch only proceeds if Phase 1 shows ≥2s wall or ≥10s CPU win for the batch.
Secondary direction (measure only, likely reject)
Artifact sharing: sourcing src/ is ~31ms of the 53ms cold start; cap across 272 runs ≈ 8.4s CPU. Prior finding (#798/#761): the single-file bin/bashunit build is NOT faster to source (parse time dominates), and lazy-sourcing complicates the release build. Only pursue if Phase 1 leaves it as the dominant remaining cost — record the decision either way.
Constraints
- Audit PR touches no runtime code; conversions (follow-ups) are strict TDD, one batch per PR
- Reclassified tests must keep asserting the same behavior — no coverage loss; anything asserting on rendered output/exit codes stays acceptance
- Fixture naming gotcha: files under
tests/acceptance/fixtures/ must not match *[tT]est.sh (discovery-scan snapshots)
- Bash 3.0+; full quality gate on every PR (
./bashunit tests/, --parallel, --parallel --simple --strict, make sa, make lint)
Acceptance criteria
Context
Follow-up to #798 (closed) — the two structural directions it left unexplored, now with fresh numbers after #801-#818 and #830.
Current acceptance suite (61 files, macOS Bash 3.2, 2026-07-19):
--parallel(CI mode)--parallelrun./bashunitspawn sites--version)--no-parallel)Fixed floor: 272 × 91ms ≈ 25s CPU (~28% of the suite's CPU) is nested-run boot cost, before any fixture test executes. The rest is fixture bodies + parent overhead.
Task: audit, don't optimize (yet)
Phase 1 — categorize all 61
tests/acceptance/*_test.shfiles. For each, decide:./bashunitbut really asserts logic reachable by callingbashunit::*functions directly (liketests/functional/andtests/unit/do). Candidate for reclassification; each converted spawn saves ≥91ms CPU plus its fixture body cost.Output: a table in this issue (file → A/B/C, spawn count, rough per-file wall time, notes). Per-file timing:
Phase 2 — file follow-up issues (one per coherent batch of B/C conversions, biggest measured win first). Do NOT convert anything in this issue's PR — the audit table and follow-up issues are the deliverable. A conversion batch only proceeds if Phase 1 shows ≥2s wall or ≥10s CPU win for the batch.
Secondary direction (measure only, likely reject)
Artifact sharing: sourcing
src/is ~31ms of the 53ms cold start; cap across 272 runs ≈ 8.4s CPU. Prior finding (#798/#761): the single-filebin/bashunitbuild is NOT faster to source (parse time dominates), and lazy-sourcing complicates the release build. Only pursue if Phase 1 leaves it as the dominant remaining cost — record the decision either way.Constraints
tests/acceptance/fixtures/must not match*[tT]est.sh(discovery-scan snapshots)./bashunit tests/,--parallel,--parallel --simple --strict,make sa,make lint)Acceptance criteria