test(snapshots): add path for snapshots predating .recentBatchInfo blob#27380
test(snapshots): add path for snapshots predating .recentBatchInfo blob#27380dannimad wants to merge 1 commit into
Conversation
…BatchInfo blob Extracts the snapshot-validation infrastructure from the reverted PR microsoft#27262 so that re-enabling batch ID tracking later can ship as a focused diff (runtime config flip + content submodule bump) without carrying replay-tool refactors. - replay-tool: export normalizePackageVersions (refactored out of compareWithReferenceSnapshot; behavior unchanged). - validateSnapshots: when the source snapshot predates the .recentBatchInfo blob, strip the blob from both produced and reference before strict-equal comparison so test fixtures generated before batch ID tracking was enabled still validate against current references. No runtime behavior change; no public API surface change.
|
Hi! Thank you for opening this PR. Want me to review it? Based on the diff (172 lines, 3 files), I've queued these reviewers:
How this works
|
There was a problem hiding this comment.
Pull request overview
This PR extracts snapshot-normalization logic from a reverted change set and updates snapshot validation to handle older fixtures that predate the introduction of the .recentBatchInfo summary blob, so back-compat snapshot tests can continue to validate against current references.
Changes:
@fluid-internal/replay-tool: factor out and exportnormalizePackageVersions()and reuse it fromcompareWithReferenceSnapshot().- Snapshot validation: when the source snapshot lacks
.recentBatchInfo, strip that blob from both produced and reference snapshots before strict comparison.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/tools/replay-tool/src/index.ts | Re-exports normalizePackageVersions from the helpers module for external use by snapshot tests. |
| packages/tools/replay-tool/src/helpers.ts | Extracts packageVersion normalization into normalizePackageVersions() and uses it in snapshot comparisons. |
| packages/test/snapshots/src/validateSnapshots.ts | Adds logic to detect older snapshots and compare snapshots while ignoring .recentBatchInfo in that back-compat case. |
| /* eslint-disable @typescript-eslint/no-unsafe-call */ | ||
| import { strict } from "assert"; | ||
| import fs from "fs"; |
Extracts the snapshot-validation infrastructure from the reverted PR #27262 so that re-enabling batch ID tracking later can ship as a focused diff (runtime config flip + content submodule bump) without carrying replay-tool refactors.