Skip to content

Migrate tests to Swift Testing (requires Swift 6.0)#922

Draft
pblazej wants to merge 5 commits intomainfrom
blaze/swift-testing
Draft

Migrate tests to Swift Testing (requires Swift 6.0)#922
pblazej wants to merge 5 commits intomainfrom
blaze/swift-testing

Conversation

@pblazej
Copy link
Contributor

@pblazej pblazej commented Feb 19, 2026

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>
@github-actions
Copy link

github-actions bot commented Feb 19, 2026

⚠️ This PR does not contain any files in the .changes directory.

@pblazej pblazej changed the title Blaze/swift testing Swift Testing Feb 19, 2026
@pblazej pblazej changed the title Swift Testing Migrate tests to Swift Testing Feb 19, 2026
…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>
@pblazej pblazej force-pushed the blaze/swift-testing branch from 70f0cca to 1e2d4d0 Compare February 19, 2026 13:09
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>
@pblazej pblazej changed the title Migrate tests to Swift Testing Migrate tests to Swift Testing (requires Swift 6.0) Feb 19, 2026
pblazej and others added 2 commits February 19, 2026 14:37
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>
@pblazej
Copy link
Contributor Author

pblazej commented Feb 19, 2026

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)

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