Repository navigation
Migrate the test suite from XCTest to Swift Testing - #266
Merged
Merged
Conversation
Suites are structs with @test functions and #expect/#require. Server-backed tests use scoped fixtures in TestFixtures that start and shut down the mock server and client per test, replacing setUp/tearDown. Looped assertions became parameterized tests. The duplicated JWT key and device token constants now live in TestFixtures.
kylebrowning
force-pushed
the
test/swift-testing-migration
branch
from
October 8, 2026 15:30
592f86a to
bbf71a1
Compare
Swift Testing needs a 6.x toolchain. The 5.10 jobs keep verifying the library compiles but no longer run the test target.
Swift Testing needs a 6.x toolchain. Earlier tagged releases remain available for projects still on 5.10.
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.
Converts every test file to Swift Testing. Rebased onto main after #262 through #265 merged, with the tests those PRs added converted as well.
What changed
XCTestCaseclasses are nowstructsuites with@Testfunctions,#expect, and#require. Multi-word test names use raw identifiers in sentence case.Tests/APNSTests/Helpers/TestFixtures.swift.withClient,withBroadcastClient,withRawHTTPClient, andwithServerstart the mock server and client, run the test body, and shut both down even on failure. Each test gets its own server, so the suite runs fully in parallel.TestFixtures.@Test(arguments:)parameterized tests: push types, priorities, device token shapes, error reasons, interruption levels, and the forced-error-response cases for both clients.as!and!unwraps in tests becametry #require.Results
The function count dropped because loops collapsed into parameterized tests. The case count rose because each argument now runs and reports as its own case.