genqlient
genqlient copied to clipboard
Auto-update generated files if `UPDATE_SNAPSHOTS=1` is set
If you do UPDATE_SNAPSHOTS=1 go test ./...
that will:
- run the snapshot tests, updating any changed snapshots
- run the integration tests and (if you have tokens) example tests
- check that the code for the integration tests and example tests is up-to-date
Step 3 is not strictly a snapshot test; the generated code is actually checked in and used. But, I mean, it's basically the same! So we should probably update it in the same places; if you need to update the snapshots you also probably need to update the integration tests. It's a little weirder because you'll also now need to re-run them (since they test things other than the snapshots) but that's probably ok.