genqlient icon indicating copy to clipboard operation
genqlient copied to clipboard

Auto-update generated files if `UPDATE_SNAPSHOTS=1` is set

Open benjaminjkraft opened this issue 2 years ago • 0 comments

If you do UPDATE_SNAPSHOTS=1 go test ./... that will:

  1. run the snapshot tests, updating any changed snapshots
  2. run the integration tests and (if you have tokens) example tests
  3. 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.

benjaminjkraft avatar Jul 28 '22 23:07 benjaminjkraft