Skip to content

Commit 5dcec26

Browse files
authored
acceptance: capture testing patterns from databricks#5414 and auto-scope to test files (databricks#5422)
Three acceptance-test idioms surfaced in databricks#5414 review that weren't captured in `.agent/rules/testing.md`: - Prefer `gron.py | grep` over `jq` for single-value lookups. - Don't pass `--keep` to `print_requests.py` if a later call follows. - Route noisy command output to `LOG.<name>` — `&> LOG.deploy` + `contains.py '!panic'`, or `2>>LOG.<name>` for cleanup stderr. Added `paths:` frontmatter so the rules auto-load when Claude reads test files. This pull request and its description were written by Isaac.
1 parent ec7c659 commit 5dcec26

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

.agent/rules/testing.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
---
22
description: Rules for the testing strategy of this repo
3+
paths:
4+
- "**/*_test.go"
5+
- "acceptance/**"
6+
- "integration/**"
37
---
48

59
# Rules for the testing strategy of this repo
@@ -132,6 +136,12 @@ Available on `PATH` during test execution (from `acceptance/bin/`):
132136
- `gron.py`: flatten JSON into greppable discrete assignments (simpler than `jq` for searching JSON).
133137
- `jq` is also available for JSON processing.
134138

139+
**RULE: Prefer `gron.py | grep <field>` over inline `jq` paths for single-value lookups.** The gron output prints the JSON path inline, so the test log explains itself.
140+
141+
**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.
142+
143+
**RULE: Route noisy or non-deterministic command output to `LOG.<name>` 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.<name>` to capture both streams (then `contains.py` to assert invariants like `'!panic' '!internal error'`), or `2>>LOG.<name>` for cleanup-step stderr you'd otherwise drop to `/dev/null`.
144+
135145
### Update workflow
136146

137147
**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.

0 commit comments

Comments
 (0)