Repository navigation
ci: fix server lockfile and Swift test abort - #14
Closed
brainsparker wants to merge 8 commits into
Closed
brainsparker wants to merge 8 commits into
brainsparker wants to merge 8 commits into
Conversation
…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.
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.
Fixes both failing CI jobs on
main. All three jobs pass on this branch (Swift: 60/60 tests).Root causes
npm cifailed.package-lock.jsonwas out of sync withpackage.json(missing @cloudflare/workers-types 5.x, esbuild 0.28.x, …). Regenerated withnpm install. Verified locally on Node 20:npm ci,tsc --noEmit, andvitest(24/24) pass. Also addednpm testto the job; it previously only type-checked.KeyboardLayout.keyCode(for:)callsTISCopyCurrentKeyboardLayoutInputSource, which asserts it runs on the main queue. Swift Testing runs tests in parallel on background threads, soKeyboardLayoutTestsaborted 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).#expect(origin.x == 1440 - 300 - 16)compared CGFloat with an integer literal inferred asAnyHashable, so equal values failed. The tests now compare againstCGFloat(...).Testing.frameworkfrom CommandLineTools viaunsafeFlags. SwiftPM 6 toolchains supply swift-testing themselves, so I removed the flags. Check locally: confirmswift teststill 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.