Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatible with nextest #242

Closed
untitaker opened this issue Jul 20, 2022 · 1 comment · Fixed by #251
Closed

Incompatible with nextest #242

untitaker opened this issue Jul 20, 2022 · 1 comment · Fixed by #251
Labels
bug Something isn't working

Comments

@untitaker
Copy link
Contributor

What happened?

with nextest, cargo insta approve only writes back changes for a single test. the repro steps have to be repeated 8-9 times until all dirty changes disappear from the git repo.

presumably because nextest runs each test in its own process and pending-snaps gets overwritten by each process.

Reproduction steps

  1. check out https://github.com/untitaker/quickenv
  2. change all snapshots in tests/acceptance.rs by a character or so
  3. INSTA_FORCE_PASS=1 cargo nextest run
  4. cargo insta approve

Insta Version

1.15.0

rustc Version

rustc 1.64.0-nightly

What did you expect?

one invocation of cargo insta approve should've captured all snapshot changes from all tests and approven them at once, undoing all uncommitted changes.


I wonder if .pending-snaps could:

  1. become append-only (i.e. insta acquires a file lock and appends instead of overwriting file)
  2. each entry contain hash of old/new snapshot content, so insta approve knows whether a "pending snap" is still relevant or can be skipped
@untitaker untitaker added the bug Something isn't working label Jul 20, 2022
@untitaker
Copy link
Contributor Author

untitaker commented Jul 20, 2022

FWIW I don't think this is really worth fixing. I mostly found nextest useful for debugging flaky tests. cargo insta test works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants