graphql-engine/v3/crates/metadata-resolve
Samir Talwar 63ac02bc07 Take snapshots of passing and failing metadata resolution. (#763)
### What

In order to more easily monitor and review changes to metadata
resolution, this introduces snapshot testing for both successful and
failing calls to `resolve`. I used [Insta](https://insta.rs/) for this.

### How

For tests of the failure case, we already had a text file with the
expected error, so I have turned those files into snapshot files. I
wrote a small script to move the files rather than deleting and
recreating them so I could guarantee that the contents have not changed.
(Unfortunately, Git's diff doesn't always recognise the move as a move
because Insta has added a header.)

For tests of the successful case, I added a line to snapshot the
metadata rather than discarding it.

I also rewrote the tests to use `insta::glob` so we could get rid of
`test_each`.

V3_GIT_ORIGIN_REV_ID: 41bef4cf77bddb8d20d7c101df52ae149e8b0476
2024-06-26 08:15:29 +00:00
..
src Make the internal metadata-resolve flags copyable. (#762) 2024-06-26 02:27:41 +00:00
tests Take snapshots of passing and failing metadata resolution. (#763) 2024-06-26 08:15:29 +00:00
Cargo.toml Take snapshots of passing and failing metadata resolution. (#763) 2024-06-26 08:15:29 +00:00