Skip to content

mac: unbreak main — move PreviewV2 page-readout test into PreviewV2ShellTests (fixes #695) - #698

Closed
d-q222 wants to merge 1 commit into
mainfrom
agent/daniel-parent/fix-gh695-previewv2-test-class
Closed

d-q222 wants to merge 1 commit into
mainfrom
agent/daniel-parent/fix-gh695-previewv2-test-class

Conversation

@d-q222

@d-q222 d-q222 commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

What

Unbreak main: apps/mac/Tests/FlashTeXMacTests/PreviewV2Tests.swift fails to
compile on main (dbe3cac8), taking the whole mac app (swift build + test)
CI job down with it. Fixes #695.

PR #689 added testPageReadoutCountsTheDisplayListNotTheElidedV1Pages at the
end of PreviewV2ParityTests instead of PreviewV2ShellTests, where the
model()/load() helpers it calls actually live. This moves the test,
unchanged, into PreviewV2ShellTests and does nothing else. (PreviewV2ShellTests
is already @MainActor at the class level, so the redundant per-method
@MainActor on the moved test is dropped.)

Why

PreviewV2ParityTests has neither model() nor load(), so the new test
doesn't compile there:

Tests/FlashTeXMacTests/PreviewV2Tests.swift:807:25: error: use of local variable 'model' before its declaration
        let model = try model()
            |           `- error: use of local variable 'model' before its declaration
            `- note: 'model' declared here

Tests/FlashTeXMacTests/PreviewV2Tests.swift:809:9: error: static member 'load' cannot be used on instance of type 'PreviewV2ParityTests'
        load(model, Self.fixtures.appendingPathComponent("display-list-v2-text.json"))
        `- error: static member 'load' cannot be used on instance of type 'PreviewV2ParityTests'

swift test must compile the whole test target before running anything, so
this is a hard build break, not a flake — every open PR's Mac check is red
until this lands. See #695 for the full root-cause writeup and #689 for the
PR that introduced it (the test's intent — the page readout must read the
v2 display list's page count, not the elided v1 result.pages, and must not
be gated on which pane is showing — is preserved exactly; only its class
changed).

Overlap check

  • gh pr list --repo flash-tex/flashtex --state open --search "PreviewV2Tests" / --search "695": no open PRs.
  • python3 scripts/coord.py claims: only my own claim, GH-695-MAC-PREVIEWV2-BUILD.
  • Claimed via python3 scripts/coord.py claim GH-695-MAC-PREVIEWV2-BUILD --actor daniel-parent --machine mac-m5pro-dq222 --branch agent/daniel-parent/fix-gh695-previewv2-test-class → CLAIMED.

Test results

Reproduced the break first (origin/main content, swift test --filter '__no_such_test__', same two errors as #695 at the same lines: 807:25 and 809:9), then applied the fix and re-verified.

Before (origin/main, reproduced locally):

error: SwiftCompile normal arm64 .../PreviewV2Tests.swift failed with a nonzero exit code.
PreviewV2Tests.swift:807:25: error: use of local variable 'model' before its declaration
PreviewV2Tests.swift:809:9: error: static member 'load' cannot be used on instance of type 'PreviewV2ParityTests'
error: Build failed

After (this branch):

$ swift build
Build complete! (14.19 sec)

$ swift test --filter 'PreviewV2'
Test Suite 'PreviewV2ShellTests' passed at 2026-09-15 22:35:15.185.
Test Case '-[FlashTeXMacTests.PreviewV2ShellTests testPageReadoutCountsTheDisplayListNotTheElidedV1Pages]' passed (0.003 seconds).
...
Test Suite 'FlashTeXMacTests.xctest' passed at 2026-09-15 22:35:15.229.
	 Executed 29 tests, with 0 failures (0 unexpected) in 5.349 (5.351) seconds

All 4 PreviewV2* test classes (PreviewV2Tests, PreviewV2ShellTests,
PreviewV2LiveTests, PreviewV2ParityTests — 29 tests total) build and pass.
Did not run the full unfiltered swift test suite (shared build machine); the
known unrelated flakes (RustPDFExportPipeTests load timeout, 3 Mac
CompletionTests, machine-dependent DesignSnapshots, DocumentFilesTests helper
timeout) are out of scope for this fix and don't touch this file.

Not done

Nothing else changed. This is a pure test-class move; no production code
touched.

🤖 Generated with Claude Code

https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz

…695)

What changed:
PR #689 added testPageReadoutCountsTheDisplayListNotTheElidedV1Pages at
the end of PreviewV2ParityTests instead of PreviewV2ShellTests, where the
model()/load() helpers it calls actually live. PreviewV2ParityTests has
neither helper, so the test target failed to compile on main
(dbe3cac), taking the whole `mac app (swift build + test)` CI job down
with it. This moves the test, unchanged, into PreviewV2ShellTests (which
is already @mainactor at the class level, so the redundant per-method
@mainactor is dropped) and does nothing else.

What was run:
- `cd apps/mac && swift build` — Build complete!
- Before (origin/main content, reproduced): `swift test` failed to
  compile with the same two errors as #695:
  PreviewV2Tests.swift:807:25: error: use of local variable 'model'
  before its declaration
  PreviewV2Tests.swift:809:9: error: static member 'load' cannot be
  used on instance of type 'PreviewV2ParityTests'
- After (this fix): `swift test --filter 'PreviewV2'` — Executed 29
  tests, with 0 failures (0 unexpected), including
  testPageReadoutCountsTheDisplayListNotTheElidedV1Pages passing under
  PreviewV2ShellTests.

Next step: none; ready for review.

Implementation-Agent: claude-opus-5 subagent of daniel-parent
Commit-Executor: daniel-parent subagent
Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
@d-q222

d-q222 commented Sep 17, 2026

Copy link
Copy Markdown
Contributor Author

Superseded: the same test move landed on main via #766 (d049308). — daniel-parent (Commander)

@d-q222 d-q222 closed this Sep 17, 2026
ItsAkilesh pushed a commit to ItsAkilesh/flashtex that referenced this pull request Sep 18, 2026
… integration/2026-09-17-qol

Own commit only, rebased onto main without flash-tex#698's. CompletionLatencyTests conflict resolved to main's guard-let, which already removed the force unwrap.

Implementation-Agent: claude-opus-5 subagent of daniel-parent
Commit-Executor: daniel-parent subagent
Co-authored-by: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
ItsAkilesh pushed a commit to ItsAkilesh/flashtex that referenced this pull request Sep 18, 2026
…gration/2026-09-17-qol

Own commit only, rebased onto main without flash-tex#698's.

Implementation-Agent: claude-opus-5 subagent of daniel-parent
Commit-Executor: daniel-parent subagent
Co-authored-by: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
ItsAkilesh pushed a commit to ItsAkilesh/flashtex that referenced this pull request Sep 18, 2026
…ntegration/2026-09-17-qol

Own commit only, rebased onto main without flash-tex#698's.

Implementation-Agent: claude-opus-5 subagent of daniel-parent
Commit-Executor: daniel-parent subagent
Co-authored-by: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
ItsAkilesh pushed a commit to ItsAkilesh/flashtex that referenced this pull request Sep 18, 2026
…ntegration/2026-09-17-qol

Own commit only, rebased onto main without flash-tex#698's.

Implementation-Agent: claude-opus-5 subagent of daniel-parent
Commit-Executor: daniel-parent subagent
Co-authored-by: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
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.

mac app: PreviewV2Tests.swift fails to compile — new test landed in the wrong class (PR #689)

1 participant