Skip to content

Commit e56435b

Browse files
committed
docs: describe TestReplay contexts and the core opt-in
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0161e7oMkzNW9DZMUPtyQibH
1 parent 00295a3 commit e56435b

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

CLAUDE.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,25 @@ stdout against `stdout.txt`. A case that is expected to fail commits its
124124
`stderr.txt`. Regenerate a golden by running the command in its directory and
125125
writing the output back over the committed file.
126126

127+
`TestReplay` runs the whole corpus once per *context*. `base` runs each case as
128+
committed and `managed-db` reruns it against a live database, so a context can
129+
change the config a case is generated with and the experiments it is generated
130+
under. A case restricts itself to some of them with `"contexts": [...]` in its
131+
`exec.json`, and commits per-context expected errors as `stderr/<context>.txt`.
132+
There is only one set of committed golden files, so every context is expected
133+
to generate identical code.
134+
135+
The `core` context generates every case through the analysis core
136+
(`SQLCEXPERIMENT=coreanalyzer`). The two paths still disagree, so it is opt-in
137+
and needs no database:
138+
139+
```bash
140+
SQLC_TEST_CORE=1 go test ./internal/endtoend -run 'TestReplay/core'
141+
```
142+
143+
Go aborts a test binary on panic, so a case that panics the core analyzer ends
144+
the run early. Run a subset to get past one (`-run 'TestReplay/core/^select'`).
145+
127146
### Example Tests
128147

129148
- **Location:** `/examples/` directory

0 commit comments

Comments
 (0)