Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 41 additions & 15 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ concurrency:
cancel-in-progress: true

env:
TESTS: "FunctionTests SDKTests RoomTests PublishDataTests PublishBufferCapturerTests VideoViewTests TrackTests"
TEST_TARGETS: "LiveKitCoreTests LiveKitObjCTests"
TEST_TIMEOUT_MINUTES: 10
TEST_RETRY_ATTEMPTS: 3

jobs:
build-and-test:
Expand All @@ -43,11 +45,9 @@ jobs:
- os: macos-15
xcode: 16.4
platform: "iOS Simulator,name=iPhone 16 Pro,OS=18.5"
symbol-graph: true
- os: macos-15
xcode: 16.4
platform: "macOS"
symbol-graph: true
- os: macos-15
xcode: 16.4
platform: "macOS,variant=Mac Catalyst"
Expand All @@ -62,9 +62,19 @@ jobs:
- os: macos-26
xcode: latest
platform: "iOS Simulator,name=iPhone 17 Pro,OS=26.0"
symbol-graph: true
- os: macos-26
xcode: latest
platform: "macOS"
symbol-graph: true
- os: macos-26
xcode: latest
platform: "macOS"
asan: true
- os: macos-26
xcode: latest
platform: "macOS"
tsan: true
- os: macos-26
xcode: latest
platform: "macOS,variant=Mac Catalyst"
Expand Down Expand Up @@ -103,20 +113,36 @@ jobs:
run: |
set -o pipefail && xcodebuild build-for-testing \
-scheme LiveKit \
-destination 'platform=${{ matrix.platform }}' | xcbeautify --renderer github-actions
-destination 'platform=${{ matrix.platform }}' \
-enableAddressSanitizer ${{ matrix.asan == true && 'YES' || 'NO' }} \
-enableThreadSanitizer ${{ matrix.tsan == true && 'YES' || 'NO' }} \
| xcbeautify --renderer github-actions

# Run all tests in parallel instead of sequentially
- name: Run Tests
run: |
IFS=' ' read -r -a tests <<< "${{ env.TESTS }}"
for test in "${tests[@]}"; do
echo "::group::Running test $test"
set -o pipefail && xcodebuild test-without-building \
-scheme LiveKit \
-destination 'platform=${{ matrix.platform }}' \
-only-testing:LiveKitTests/$test | xcbeautify --renderer github-actions
echo "::endgroup::"
done
uses: nick-fields/retry@v3
with:
timeout_minutes: ${{ env.TEST_TIMEOUT_MINUTES }}
max_attempts: ${{ env.TEST_RETRY_ATTEMPTS }}
command: |
set -euo pipefail
IFS=' ' read -r -a tests <<< "${{ env.TEST_TARGETS }}"

for test in "${tests[@]}"; do
echo "::group::$test"
if ! xcodebuild test-without-building \
-scheme LiveKit \
-destination 'platform=${{ matrix.platform }}' \
-enableAddressSanitizer ${{ matrix.asan == true && 'YES' || 'NO' }} \
-enableThreadSanitizer ${{ matrix.tsan == true && 'YES' || 'NO' }} \
-only-testing:$test \
-parallel-testing-enabled YES \
| xcbeautify --renderer github-actions
then
echo "::error::Test failed: $test"
exit 1
fi
echo "::endgroup::"
done

- name: Build for Release
if: ${{ matrix.symbol-graph }}
Expand Down
49 changes: 0 additions & 49 deletions LiveKit.xctestplan

This file was deleted.

23 changes: 19 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,33 @@ let package = Package(
.enableExperimentalFeature("AccessLevelOnImport"),
]
),
.testTarget(
name: "LiveKitTests",
.target(
name: "LiveKitTestSupport",
dependencies: [
"LiveKit",
.product(name: "JWTKit", package: "jwt-kit"),
],
path: "Tests/LiveKitTestSupport"
),
.testTarget(
name: "LiveKitCoreTests",
dependencies: [
"LiveKit",
"LiveKitTestSupport",
]
),
.testTarget(
name: "LiveKitTestsObjC",
name: "LiveKitAudioTests",
dependencies: [
"LiveKit",
.product(name: "JWTKit", package: "jwt-kit"),
"LiveKitTestSupport",
]
),
.testTarget(
name: "LiveKitObjCTests",
dependencies: [
"LiveKit",
"LiveKitTestSupport",
]
),
],
Expand Down
23 changes: 19 additions & 4 deletions [email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,33 @@ let package = Package(
.enableExperimentalFeature("AccessLevelOnImport"),
]
),
.testTarget(
name: "LiveKitTests",
.target(
name: "LiveKitTestSupport",
dependencies: [
"LiveKit",
.product(name: "JWTKit", package: "jwt-kit"),
],
path: "Tests/LiveKitTestSupport"
),
.testTarget(
name: "LiveKitCoreTests",
dependencies: [
"LiveKit",
"LiveKitTestSupport",
]
),
.testTarget(
name: "LiveKitTestsObjC",
name: "LiveKitAudioTests",
dependencies: [
"LiveKit",
.product(name: "JWTKit", package: "jwt-kit"),
"LiveKitTestSupport",
]
),
.testTarget(
name: "LiveKitObjCTests",
dependencies: [
"LiveKit",
"LiveKitTestSupport",
]
),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

@preconcurrency import AVFoundation
@testable import LiveKit
import XCTest
import LiveKitTestSupport

class AudioEngineAvailabilityTests: LKTestCase {
// Check if audio engine will stop when availability is set to .none,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

@preconcurrency import AVFoundation
@testable import LiveKit
import XCTest
import LiveKitTestSupport

final class TestEngineObserver: AudioEngineObserver, @unchecked Sendable {
var next: (any LiveKit.AudioEngineObserver)?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

@preconcurrency import AVFoundation
@testable import LiveKit
import XCTest
import LiveKitTestSupport

class AudioEnginePermissionTests: LKTestCase {
#if os(iOS) || os(visionOS) || os(tvOS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

@preconcurrency import AVFoundation
@testable import LiveKit
import LiveKitTestSupport
import LiveKitWebRTC
import LKObjCHelpers
import XCTest

class AudioEngineTests: LKTestCase, @unchecked Sendable {
override func tearDown() async throws {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

@preconcurrency import AVFoundation
@testable import LiveKit
import LiveKitTestSupport
import LiveKitWebRTC
import XCTest

class AudioManagerTests: LKTestCase {
// Test legacy audio device module's startLocalRecording().
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import Foundation
import LiveKitWebRTC

@testable import LiveKit
import XCTest
import LiveKitTestSupport

class AudioProcessingTests: LKTestCase, AudioCustomProcessingDelegate, @unchecked Sendable {
var _initSampleRate: Double = 0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

@testable import LiveKit
import XCTest
import LiveKitTestSupport

class DeviceManagerTests: LKTestCase {
func testListDevices() async throws {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import AVFAudio
@testable import LiveKit
import XCTest
import LiveKitTestSupport

class LocalAudioTrackRecorderTests: LKTestCase {
func testRecording() async throws {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/

@testable import LiveKit
import LiveKitTestSupport
import LiveKitWebRTC
import XCTest

struct TestEngineTransition {
let outputEnabled: ValueOrAbsent<Bool>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

@testable import LiveKit
import XCTest
import LiveKitTestSupport

class PreConnectAudioBufferTests: LKTestCase {
func testParticipantActiveStateSendsAudioData() async throws {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

@testable import LiveKit
import XCTest
import LiveKitTestSupport

class PublishDeviceOptimizationTests: LKTestCase {
// For testing remote server:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import Combine
import CoreMedia
@testable import LiveKit
import XCTest
import LiveKitTestSupport

class PublishMicrophoneTests: LKTestCase {
func testConcurrentMicPublish() async throws {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import AVFoundation
@testable import LiveKit
import XCTest
import LiveKitTestSupport

class AVAudioPCMBufferTests: LKTestCase {
func testResample() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import AVFAudio
@testable import LiveKit
import XCTest
import LiveKitTestSupport

#if os(iOS) && targetEnvironment(macCatalyst)
// Required for UnsafeMutableAudioBufferListPointer.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import AVFAudio
@testable import LiveKit
import XCTest
import LiveKitTestSupport

class AudioConverterTests: LKTestCase {
func testConvertFormat() async throws {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import AVFAudio
import LiveKit
import XCTest
import LiveKitTestSupport

final class AudioMixRecorderTests: LKTestCase {
let audioSettings16k: [String: Any] = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

@testable import LiveKit
import XCTest
import LiveKitTestSupport

class AsyncFileStreamTests: LKTestCase {
private let testBuffer = generateTestBuffer(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

@testable import LiveKit
import XCTest
import LiveKitTestSupport

class AsyncRetryTests: LKTestCase {
override func setUpWithError() throws {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import AVFAudio
import CoreMedia
@testable import LiveKit
import XCTest
import LiveKitTestSupport

final class BroadcastAudioCodecTests: XCTestCase {
private var codec: BroadcastAudioCodec!
Expand Down
Loading
Loading