test(replay): extract shared fixtures from the target-verification suite - #2249
Merged
Conversation
The 26 scenarios in session-replay-target-verification-runtime.test.ts each rebuilt the same temp root, iOS app session, written .ad script, and request-recording invoke by hand, and repeated the same one-button XCTest capture literal. Those setup pieces now live as named exports in the sibling session-replay-scenario.fixtures.ts (replayScriptScene, saveButtonCapture, emptyCapture, and the annotation constants), built on the existing test-utils builders (mkdtempForTestSync, makeIosAppSession) and the replay runtime fixtures. Every test keeps its title, comments, and expect lines, so each still reads as its own scenario. Test count (26) and expect count (128) are unchanged. jscpd (--min-tokens 80 --min-lines 8) duplicated lines within the suite drop from 1,046 (25 clone pairs) to 125 (6 pairs). The divergence and repair-empty-tail suites are left for a follow-up: this extraction alone is ~950 gross diff lines.
Size Report
npm unpacked components
Startup median (7 runs, lower is better):
Top changed chunks: no changes in the largest emitted chunks. Top changed packed filesNo changed packed files. |
Member
Author
|
READY at |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Task B1b, largest file only. The 26 scenarios in
session-replay-target-verification-runtime.test.tseach hand-built the same temp root, iOS app session, written.adscript, request-recordinginvoke, and one-button XCTest capture literal. That setup now lives as named exports in the siblingsession-replay-scenario.fixtures.ts(replayScriptScene,saveButtonCapture,emptyCapture, annotation constants), built on the existingtest-utilsbuilders and replay runtime fixtures. Assertions, titles, and comments are unchanged.vitest --reporter=jsonnumTotalTests);expect(calls: 128 -> 128.--min-tokens 80 --min-lines 8) duplicated lines within the suite: 1,046 (25 pairs) -> 125 (6 pairs).Validation
npx vitest run --project unit-core src/daemon/replay/internal/__tests__/session-replay-target-verification-runtime.test.ts: 26/26 green.pnpm check:quick,oxfmt --check,scripts/layering/check.ts,pnpm check:production-exports: green.session-replay-divergence.ts:276returns the first attempt unconditionally (retry disabled) ->a transient content-quality capture failure right after launch recovers within the bounded retry...FAIL,AssertionError: expected false to be true. Restored.session-replay-target-verification.ts:319kindidentity-unverifiable->identity-mismatch->a recorded-unverifiable annotation is an identity-unverifiable divergence with matchCount omittedFAIL,expected 'identity-mismatch' to be 'identity-unverifiable'. Restored.Tradeoffs / follow-ups
session-replay-divergence.test.ts(472 duplicated lines, 12 pairs) andsession-replay-repair-empty-tail.test.ts(490, 9 pairs) need their own extraction; the divergence suite can likely reusereplayScriptScene.