Skip to content

test(replay): extract shared fixtures from the target-verification suite - #2249

Merged
thymikee merged 1 commit into
mainfrom
claude/test-fixtures-replay-suites
Sep 3, 2026
Merged

test(replay): extract shared fixtures from the target-verification suite#2249
thymikee merged 1 commit into
mainfrom
claude/test-fixtures-replay-suites

Conversation

@thymikee

@thymikee thymikee commented Sep 2, 2026

Copy link
Copy Markdown
Member

Summary

Task B1b, largest file only. The 26 scenarios in session-replay-target-verification-runtime.test.ts each hand-built the same temp root, iOS app session, written .ad script, request-recording invoke, and one-button XCTest capture literal. That setup now lives as named exports in the sibling session-replay-scenario.fixtures.ts (replayScriptScene, saveButtonCapture, emptyCapture, annotation constants), built on the existing test-utils builders and replay runtime fixtures. Assertions, titles, and comments are unchanged.

  • Tests: 26 -> 26 (vitest --reporter=json numTotalTests); expect( calls: 128 -> 128.
  • jscpd (--min-tokens 80 --min-lines 8) duplicated lines within the suite: 1,046 (25 pairs) -> 125 (6 pairs).
  • Gross diff: 949 lines, so the other two suites did not fit the 1,000-line budget.

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.
  • Planted red 1: production session-replay-divergence.ts:276 returns 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.
  • Planted red 2: production session-replay-target-verification.ts:319 kind identity-unverifiable -> identity-mismatch -> a recorded-unverifiable annotation is an identity-unverifiable divergence with matchCount omitted FAIL, expected 'identity-mismatch' to be 'identity-unverifiable'. Restored.
  • Full affected gate: green at 8021503 (pnpm check:affected --run; gates run: format, lint, typecheck, fallow, vitest-related)

Tradeoffs / follow-ups

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.
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
JS raw 2.58 MB 2.58 MB 0 B
JS gzip 868.4 kB 868.4 kB 0 B
npm bundled raw 2.58 MB 2.58 MB 0 B
npm bundled gzip 868.4 kB 868.4 kB 0 B
npm tarball 1.02 MB 1.02 MB -8 B
npm unpacked 3.46 MB 3.46 MB 0 B
npm clean-installed 3.46 MB 3.46 MB 0 B

npm unpacked components

Component Base Current Diff
JS / dist source 2.74 MB 2.74 MB 0 B
Apple runner source/project 544.4 kB 544.4 kB 0 B
Apple snapshot presentation source 33.8 kB 33.8 kB 0 B
macOS helper source 54.8 kB 54.8 kB 0 B
Android helper artifacts 43.3 kB 43.3 kB 0 B
Other package files 46.3 kB 46.3 kB 0 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 32.0 ms 32.1 ms +0.1 ms
CLI --help 83.9 ms 81.9 ms -2.0 ms

Top changed chunks: no changes in the largest emitted chunks.

Top changed packed files

No changed packed files.

@thymikee thymikee changed the title test(replay): extract shared fixtures from the replay verification and divergence suites test(replay): extract shared fixtures from the target-verification suite Sep 2, 2026
@thymikee

thymikee commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

READY at 0ea4b3b369428bb7dfaef420b4cfa52c8c968cad. The reviewed fixture extraction preserves all 26 scenarios and 128 assertions in the test file, with no expectations hidden in helpers and no production route change. Exact-head CI is green, merge state clean, size decreases, and no device proof is owed. The title now correctly matches the target-verification-only scope.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Sep 2, 2026
@thymikee
thymikee merged commit 8021503 into main Sep 3, 2026
17 checks passed
@thymikee
thymikee deleted the claude/test-fixtures-replay-suites branch September 3, 2026 06:02
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-09-03 06:02 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant