# Bash Testing Policy (grill C-15) Every bash script under `scripts/` MUST have at least one bats test covering the happy path and one covering the failure path. This is the compensating control for bash being exempt from the Go coverage gate (D-186). ## Framework - **bats** — `bats scripts/tests/*.bash` runs all bash tests. - **shellcheck** — `shellcheck scripts/*.sh scripts/lib/*.sh scripts/tests/*.bash` static analysis. - **shfmt** — `shfmt -d scripts/` formatting check (optional; skip if not installed). ## Install (if missing) ```bash # bats npm install -g bats # or: git clone https://github.com/bats-core/bats-core.git && ./bats-core/install.sh /usr/local # shellcheck apt-get install -y shellcheck # shfmt (optional) mvdan.cc/sh (go install mvdan.cc/sh/v3/cmd/shfmt@latest) ``` ## Running ```bash make test-bash # runs bats (skips gracefully if bats missing) make lint-bash # runs shellcheck + shfmt (skips gracefully if missing) make test # runs both Go + bash tests make lint # runs both Go + bash lint ``` ## Test file convention - Test files live in `scripts/tests/_test.bash`. - Source `load test_helper` at the top of every test file. - Happy path: `@test "