Skip to content

mac: fix the FlashTeXMacTests build break (PR #689 misplaced a test) — unblocks CI on ~70 red PRs - #766

Merged
d-q222 merged 1 commit into
mainfrom
fix/macapp-previewv2-misplaced-test
Sep 16, 2026
Merged

d-q222 merged 1 commit into
mainfrom
fix/macapp-previewv2-misplaced-test

Conversation

@d-q222

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

Copy link
Copy Markdown
Contributor

Root cause

mac app (swift build + test) fails on main itself, and therefore on every PR that branches from it. The CI log's tail (error: fatalError after NearbyReconnector-related @Sendable warnings) looked like a test-process crash, but it isn't — that line is SwiftPM's generic summary when the build fails, and no test ever runs.

The real error is two compile errors in PreviewV2Tests.swift:

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'
PreviewV2Tests.swift:809:13: error: argument passed to call that takes no arguments

#689 added testPageReadoutCountsTheDisplayListNotTheElidedV1Pages to PreviewV2ParityTests, but that class has no model()/load() instance helpers — those are private methods on the sibling class PreviewV2ShellTests. Without them in scope:

  • let model = try model() has no function called model() to bind to, so the compiler reads it as the local variable referencing itself before it exists.
  • The unqualified load(model, ...) call resolves instead to NSObject's inherited Objective-C +load class method (0-arg), which is why the diagnostic says "argument passed to call that takes no arguments."

Fix

Moved the test method (unchanged) into PreviewV2ShellTests, which already has the ShellModel-based model()/load() helpers it needs.

Verification

  • swift build --build-tests: clean, no errors (only the pre-existing, unrelated NearbyReconnector @Sendable warnings).
  • swift test --filter PreviewV2ShellTests: 9/9 passed, including the moved test.
  • swift test --filter PreviewV2ParityTests: 4/4 passed (unaffected by removing the misplaced duplicate).
  • Full local swift test run: two other targets (AutomaticCompletionTests timing, DesignSnapshots golden-image diffs) show local-environment-only failures unrelated to this file — expected without CI's controlled headless environment and without building the FLASHTEX_* Rust helpers locally.

Priority-1 fix per daniel-parent's triage on flashtex#2 — landing this on main is expected to turn ~70 red PR checks green.
🤖 Generated with Claude Code

testPageReadoutCountsTheDisplayListNotTheElidedV1Pages landed in
PreviewV2ParityTests, which has no model()/load() helpers -- so
'let model = try model()' referenced the just-declared local before its
own initializer ran, and the unqualified load(model, ...) call resolved
to NSObject's inherited +load instead. Both are compile errors, so the
whole FlashTeXMacTests target failed to build and 'swift test' never ran
a single test; SwiftPM's generic 'error: fatalError' summary line for
that build failure looked like a runtime crash.

Moved the test to PreviewV2ShellTests, which already has the ShellModel
model()/load() helpers it actually needs. 9/9 in PreviewV2ShellTests and
4/4 in PreviewV2ParityTests pass; 'swift build --build-tests' is clean.
@d-q222
d-q222 merged commit d049308 into main Sep 16, 2026
20 of 21 checks passed
d-q222 added a commit that referenced this pull request Sep 16, 2026
What changed:
Only conflict was .github/workflows/ci.yml, where #659 (already on main) and
this branch both edited the `swift test` step. Resolved to keep BOTH:

- #659's `SNAPSHOT_ARTIFACTS` env and `mkdir -p`, its `--skip
  IMECompositionTests` (so the skip stays in the shared workflow, both sides of
  any comparison carrying it), its `if-no-files-found`/`retention-days` on the
  log upload, and its `mac-snapshot-artifacts` upload step. None of #659 is lost.
- this branch's second, non-gating `--filter IMECompositionTests` step, which
  #659 does not have. Without it the skip alone converts #681's loud crash into
  a quiet absence -- the invisibility of #680, which is what hid ~59 suite files
  in the first place.

The `swift-test-ime.log` path in the upload step merged without conflict, so
both logs are uploaded.

apps/mac had no changes on main since the merge base (this branch already
carries #766 through #660), so the pipe-drain fixes applied unchanged.

What was run:
  git merge origin/main -> 1 conflict (.github/workflows/ci.yml), resolved
  build result in the following commit message / PR comment

Next step:
Build after the merge and re-run CI.

Implementation-Agent: claude-opus-5 subagent of daniel-parent
Commit-Executor: daniel-parent subagent
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.

1 participant