From 657fb0007f39f07cc0401e0c5d03e25df6234aa4 Mon Sep 17 00:00:00 2001 From: Alexander M Pickering Date: Tue, 21 Jul 2026 20:19:46 -0500 Subject: Inital commit. --- scripts/README.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 scripts/README.md (limited to 'scripts/README.md') diff --git a/scripts/README.md b/scripts/README.md new file mode 100644 index 0000000..91adbd3 --- /dev/null +++ b/scripts/README.md @@ -0,0 +1,50 @@ +# Report scripts + +Portable POSIX-sh tooling to generate reports from the bats test suite. All +entrypoints run under mingw bash, WSL bash and Alpine/busybox ash, and depend +only on `bats`, `awk`, `sort` and coreutils. + +## `profile-tests.sh` + +Per-test timing (and optional per-line hotspots). See `doc/profiling.md`. +## `profile-run.sh` + +Direct profiling for real `trbldoc.sh` invocations (outside bats). Produces: + +- per-run wall-clock summary (`run-summary.csv`) +- line hotspots (`hotspots.html`) +- pipeline phase hotspots inferred from trace line ranges (`phase-hotspots.html`) + +Example: + +```sh +sh scripts/profile-run.sh -n 3 -C -- -s tests/fixtures/pipeline -o .trblcache/built +``` +## `hotspot-tests.sh` + +Repeatable hotspot analysis for the bats suite without relying on JUnit output. +It captures: + +- per-test timing from raw `bats --timing` output +- line hotspots from xtrace logs +- optional phase hotspots for `trbldoc.sh` (when helper scripts are present) + +```sh +sh scripts/hotspot-tests.sh -s all -n 30 +``` + +## `coverage-tests.sh` + +Shell line coverage of `trbldoc.sh`. See `doc/coverage.md`. + +## `generate-reports.sh` + +Run both into one timestamped `reports/` directory. Puts reports into a +`reports/run-/` directory. + +```sh +sh scripts/generate-reports.sh -p +``` + +`lib/` holds shared helpers: `common.sh` (sh helpers), `trace-init.sh` (the +`BASH_ENV` xtrace hook), and the `*.awk` extractors/renderers. -- cgit v1.2.3-70-g09d2