Add focused changed-path test wrapper
This commit is contained in:
@@ -13,6 +13,21 @@ This repository tests its configuration at defined seams. The tests run with `ba
|
||||
| Script syntax | `tests/scripts_syntax.bats` | `bash -n` clean, executable bits, shellcheck when available |
|
||||
| Deployment flow | `tests/deployment_flow.bats` | deploy.sh exists, targets known, SSH reachable (skips offline) |
|
||||
|
||||
## Focused pre-commit testing
|
||||
|
||||
For normal commits, use the focused wrapper:
|
||||
|
||||
```bash
|
||||
./scripts/test-changed.sh
|
||||
```
|
||||
|
||||
It reads staged paths with `git diff --cached` and runs only the mapped Bats
|
||||
files. Use `--list` to inspect the selection without running tests, or
|
||||
`--paths FILE ...` to preview a mapping. Shared test infrastructure and
|
||||
unmapped paths fail closed rather than silently skipping coverage. Run the
|
||||
full suite with `./tests/run.sh` when changing shared test helpers, the test
|
||||
runner, or when focused coverage is not sufficient.
|
||||
|
||||
## Red-Green
|
||||
|
||||
Tests are written first. A failing test means the seam is not satisfied; the config change that makes it pass is the only acceptable fix. No `--no-verify`, no deleting tests without approval.
|
||||
|
||||
Reference in New Issue
Block a user