Migrate tests to Swift Testing (requires Swift 6.0)#922
Draft
Migrate tests to Swift Testing (requires Swift 6.0)#922
Conversation
Replace XCTest with the modern Swift Testing framework across all 48 test files in LiveKitCoreTests. Add framework-agnostic TestEnvironment utilities (standalone withRooms, async polling helpers) to LiveKitTestSupport so existing XCTest-based targets (LiveKitAudioTests) remain unaffected. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
…t support - Convert all 13 LiveKitAudioTests files from XCTest/LKTestCase to Swift Testing - Delete LKTestCase.swift and Assertions.swift from LiveKitTestSupport - Remove XCTest-dependent helpers from Room.swift and Tracks.swift - Add explicit `import Foundation` to ~35 test files that relied on transitive Foundation import through the now-deleted @_exported import XCTest Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
70f0cca to
1e2d4d0
Compare
Replace repetitive test functions with @test(arguments:) where tests share logic and differ only in input values: - DataStreamTests: parameterize send vs stream method - CodecTests: parameterize codec parsing and supported codec checks - FileInfoTests: parameterize MIME type and extension lookups - StringTests: parameterize byteLength cases - TimeIntervalTests: collapse ~330 lines of repeated easeOutCirc delay assertions into a table-driven parameterized test - RegionManagerTests: parameterize isCloud, URL conversion, and merge duplicate 4xx/5xx HTTP status classification tests Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Defines 9 domain tags (e2e, audio, broadcast, dataStream, dataChannel, networking, concurrency, media, e2ee) in LiveKitTestSupport and applies them to 53 test suites across both test targets. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
TranscriptionTests: Remove double handler registration that caused
handlerAlreadyRegistered error - register the stream handler once
with the confirmation callback included.
IPCChannelTests: Replace unstructured Task {} with withThrowingTaskGroup
so the confirmation body awaits task completion before checking counts.
For cancellation tests, await the task result after cancelling.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Author
|
I'll probably pause ⏸️ it for now, as we need to drop Xcode 15 first, which should happen later this year (https://developer.apple.com/news/upcoming-requirements/?id=02032026a) |
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.
Now possible with https://github.com/AvdLee/Swift-Testing-Agent-Skill