diff --git a/.agent/rules/testing.md b/.agent/rules/testing.md index 67f41cd2ea2..77173ff6506 100644 --- a/.agent/rules/testing.md +++ b/.agent/rules/testing.md @@ -1,5 +1,9 @@ --- description: Rules for the testing strategy of this repo +paths: + - "**/*_test.go" + - "acceptance/**" + - "integration/**" --- # Rules for the testing strategy of this repo @@ -132,6 +136,12 @@ Available on `PATH` during test execution (from `acceptance/bin/`): - `gron.py`: flatten JSON into greppable discrete assignments (simpler than `jq` for searching JSON). - `jq` is also available for JSON processing. +**RULE: Prefer `gron.py | grep ` over inline `jq` paths for single-value lookups.** The gron output prints the JSON path inline, so the test log explains itself. + +**RULE: Don't pass `--keep` to `print_requests.py` if a later `print_requests.py` call follows.** The buffer accumulates, so the second call double-prints the earlier requests. + +**RULE: Route noisy or non-deterministic command output to `LOG.` instead of `output.txt` or `/dev/null`.** `LOG.*` files are visible under `go test -v` but excluded from the diff — see `acceptance/selftest/log/`. Use `&> LOG.` to capture both streams (then `contains.py` to assert invariants like `'!panic' '!internal error'`), or `2>>LOG.` for cleanup-step stderr you'd otherwise drop to `/dev/null`. + ### Update workflow **RULE: Run `./task test-update` to regenerate outputs, then `./task fmt` and `./task lint`.** If fmt or lint modify files in `acceptance/`, there's an issue in the source files. Fix the source, regenerate, and verify fmt/lint pass cleanly.