Commit 55b0789
Fix functional tests failing under nextest (mitsuhiko#824)
## Summary
- Fix `test_pending_snapshot_deletion` failing when run under nextest
- Clear `NEXTEST_RUN_ID` environment variable in functional test setup
When running functional tests under nextest, the `NEXTEST_RUN_ID`
environment variable was inherited by child `cargo insta test`
invocations. Since insta uses this variable as the `RUN_ID` for pending
snapshots (see `insta/src/snapshot.rs:18`), all pending inline snapshots
ended up sharing the same run_id.
This broke the cleanup mechanism in `load_batch()` which keeps all
entries with the last run_id. When a test passed and wrote a NULL entry
to mark the snapshot as clean, the previous failing entry was also kept
(same run_id), preventing the `.pending-snap` file from being deleted.
## Test plan
- [x] `cargo test --package cargo-insta` passes
- [x] `cargo nextest run --package cargo-insta` passes (previously
failed on `test_pending_snapshot_deletion`)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>1 parent de0f73d commit 55b0789
1 file changed
+3
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
219 | 222 | | |
220 | 223 | | |
221 | 224 | | |
| |||
0 commit comments