Skip to content

ci: fix server lockfile and Swift test abort - #14

Closed
brainsparker wants to merge 8 commits into
mainfrom
fix/ci
Closed

brainsparker wants to merge 8 commits into
mainfrom
fix/ci

Conversation

@brainsparker

@brainsparker brainsparker commented Oct 21, 2026 •

Copy link
Copy Markdown
Owner

Fixes both failing CI jobs on main. All three jobs pass on this branch (Swift: 60/60 tests).

Root causes

  1. Server (Node): npm ci failed. package-lock.json was out of sync with package.json (missing @cloudflare/workers-types 5.x, esbuild 0.28.x, …). Regenerated with npm install. Verified locally on Node 20: npm ci, tsc --noEmit, and vitest (24/24) pass. Also added npm test to the job; it previously only type-checked.
  2. Swift: signal 6 abort. KeyboardLayout.keyCode(for:) calls TISCopyCurrentKeyboardLayoutInputSource, which asserts it runs on the main queue. Swift Testing runs tests in parallel on background threads, so KeyboardLayoutTests aborted the whole process. I isolated it by running each suite separately in CI. Fix: hop to the main thread when called off-main (production callers are already on main, so their behavior is unchanged).
  3. Swift: HUDPositionTests failing. #expect(origin.x == 1440 - 300 - 16) compared CGFloat with an integer literal inferred as AnyHashable, so equal values failed. The tests now compare against CGFloat(...).
  4. Package.swift force-linked Testing.framework from CommandLineTools via unsafeFlags. SwiftPM 6 toolchains supply swift-testing themselves, so I removed the flags. Check locally: confirm swift test still works on your Mac (if you only have the CLT installed, it needs Swift 6+).

No tests were skipped or guarded. The temporary diagnostics commits were removed from the workflow before the final run.

…orts on failure

- Regenerate server/package-lock.json so npm ci passes (lock was missing
  @cloudflare/workers-types 5.x, esbuild 0.28.x, etc.)
- Run vitest (npm test) in the server job; 24 tests pass locally
- On Swift job failure, print DiagnosticReports to diagnose the signal 6 abort
Package.swift links Testing.framework from CommandLineTools while CI selected
Xcode, loading two mismatched swift-testing runtimes. Equal values failed
#expect and the runner aborted with signal 6.
The test target hard-linked /Library/Developer/CommandLineTools/.../Testing.framework
via unsafeFlags. SwiftPM 6 toolchains already link swift-testing, so the test
binary loaded two Testing runtimes: #expect reported equal values as failures
and the runner aborted (signal 6). Let SwiftPM supply Testing. Revert CI to Xcode.
#expect inferred the integer literal side as AnyHashable, so CGFloat(1124.0)
never equalled AnyHashable(1124) and all four HUDPosition tests failed.
TISCopyCurrentKeyboardLayoutInputSource asserts it runs on the main queue
and aborts otherwise. Swift Testing runs tests on background threads in
parallel, so KeyboardLayoutTests crashed the whole run with signal 6.
Hop to main when called off-main. Remove temporary CI diagnostics.
@brainsparker brainsparker changed the title ci: fix server lockfile and Swift test crash ci: fix server lockfile and Swift test abort Oct 21, 2026
@brainsparker
brainsparker deleted the fix/ci branch October 29, 2026 18:04
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