Skip to content

refactor(snapshot): unify review update with SnapshotState update - #11790

Merged
sheremet-va merged 4 commits into
mainfrom
snapshot-pending-update
Nov 2, 2026
Merged

sheremet-va merged 4 commits into
mainfrom
snapshot-pending-update

Conversation

@hi-ogawa

@hi-ogawa hi-ogawa commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Previously, the interactive review in #11325 rebuilt each update from the serialized test error (trimmed actual, meta, stacks[0]), even though SnapshotState already knew what the update should be for --update. The divergence can cause minor differences in how --update and review mode apply updates.

This PR makes SnapshotState return the update it would write under --update, so that the snapshot review can reuse it.

@netlify

netlify Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for vitest-dev ready!

Name Link
🔨 Latest commit c2b7424
🔍 Latest deploy log https://app.netlify.com/projects/vitest-dev/deploys/6ae84732e739a350567dd41e
😎 Deploy Preview https://deploy-preview-11790--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@flakiness-io

flakiness-io Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Test Results Summary

This comment shows the latest test results for this pull request.

Commit Status Test Results CI Runs
c2b7424 ✅ Passed 31373 passed · 235 flaky · 1179 skipped 28 runs
⚠️ 235 flaky

⚠️ win 10.0.26100 · threads test/unit/test/retry.test.ts:55 › describe object add(1, 1) › returned value not be greater than 2
⚠️ Ubuntu 24.04 · vmThreads test/unit/test/retry.test.ts:55 › describe object add(1, 1) › returned value not be greater than 2
⚠️ Ubuntu 24.04 · threads test/unit/test/retry.test.ts:55 › describe object add(1, 1) › returned value not be greater than 2
⚠️ Ubuntu 24.04 · vmThreads test/unit/test/retry.test.ts:55 › describe object add(1, 1) › returned value not be greater than 2
⚠️ Ubuntu 24.04 · forks test/unit/test/retry.test.ts:55 › describe object add(1, 1) › returned value not be greater than 2
⚠️ Ubuntu 24.04 · forks test/unit/test/retry.test.ts:55 › describe object add(1, 1) › returned value not be greater than 2
⚠️ win 10.0.26100 · vmThreads test/unit/test/retry.test.ts:55 › describe object add(1, 1) › returned value not be greater than 2
⚠️ Ubuntu 24.04 · threads test/unit/test/retry.test.ts:55 › describe object add(1, 1) › returned value not be greater than 2
⚠️ win 10.0.26100 · forks test/unit/test/retry.test.ts:55 › describe object add(1, 1) › returned value not be greater than 2
⚠️ win 10.0.26100 · threads test/unit/test/retry.test.ts:61 › describe object add(1, 1) › returned value not be less than 2
…and 225 more

View full report

ℹ️ About Flakiness.io in GitHub

Your team has set up Flakiness.io pull request comments. This comment is updated when

  • The first test results arrive for this pull request
  • A later run reports more results for the same commit
  • A new commit is pushed and tested

Flakiness.io rewrites the comment in place, so it always reflects the most recently tested commit.

SnapshotState now returns the update it would write under -u when a
snapshot mismatches, and the reviewer applies that instead of rebuilding
one from the serialized error.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@hi-ogawa
hi-ogawa force-pushed the snapshot-pending-update branch from 13e9ef4 to b79708b Compare November 2, 2026 06:53
hi-ogawa and others added 2 commits November 2, 2026 16:17
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@hi-ogawa hi-ogawa changed the title refactor(snapshot): review pending updates from state refactor(snapshot): unify review update with SnapshotState update Nov 2, 2026
@hi-ogawa
hi-ogawa marked this pull request as ready for review November 2, 2026 07:25
@hi-ogawa
hi-ogawa requested a review from macarie November 2, 2026 07:27
@sheremet-va

Copy link
Copy Markdown
Member

CONFLICT ALERT

…date

# Conflicts:
#	packages/vitest/src/node/snapshot-review.ts
@sheremet-va
sheremet-va merged commit 9e23ce5 into main Nov 2, 2026
52 of 53 checks passed
@sheremet-va
sheremet-va deleted the snapshot-pending-update branch November 2, 2026 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants