fix(test): PolyVoiceTests is iOS-only and broke under @MainActor - #30
Merged
Conversation
`main` currently fails `ios-build-test` — it doesn't build. Tests/PolyVoiceTests is an iOS-only target, so `swift test` on macOS never compiles it. Making PolyCall/PolyVoice.call @mainactor in the previous commit broke every call site in it, and nothing local caught that: the macOS suite skips the target entirely, and `xcodebuild build` only builds Sources. Marked the suite @mainactor, matching the API it exercises. Verified the way CI actually runs it — `xcodebuild -scheme PolyMessaging-Package -destination "platform=iOS Simulator" test`: 282 PolyMessaging + 11 PolyVoice tests, 0 failures.
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.
maindoes not currently build —ios-build-testfails on72b54a9.Tests/PolyVoiceTestsis an iOS-only target.swift teston macOS never compiles it, andxcodebuild buildonly buildsSources/— so makingPolyCall/PolyVoice.call(...)@MainActorin #29 broke every call site in that suite with nothing local to catch it.Fix: mark the suite
@MainActor, matching the API it exercises.Verification
Run exactly the way CI does:
→ 282 PolyMessaging + 11 PolyVoice tests, 0 failures, TEST SUCCEEDED.
Why this slipped
The
#if os(iOS)targets are invisible to the macOS toolchain. I checkedSources/against a real iOS build but notTests/, and the greenswift testrun was misleading — it silently skipped the whole target. Worth remembering thatswift testpassing says nothing about the iOS-only suites.Blocks the
v0.9.0tag and the CocoaPods push.