Skip to content

Commit 0440e22

Browse files
authored
Fix test execution (#600)
Test execution currently fails due to logging being bootstrapped both in `AudioEngineTests` and `VideoViewTests`. This PR defines `LKTestCase`, a subclass of `XCTestCase`, which performs global initialization once per execution. All existing test cases now use this as their superclass.
1 parent 61e5bd1 commit 0440e22

34 files changed

+66
-42
lines changed

Tests/LiveKitTests/AVAudioPCMRingBufferTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import XCTest
2323
import CoreAudio
2424
#endif
2525

26-
final class AVAudioPCMRingBufferTests: XCTestCase {
26+
final class AVAudioPCMRingBufferTests: LKTestCase {
2727
var format: AVAudioFormat!
2828

2929
override func setUp() {

Tests/LiveKitTests/AsyncRetryTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
@testable import LiveKit
1818
import XCTest
1919

20-
class AsyncRetryTests: XCTestCase {
20+
class AsyncRetryTests: LKTestCase {
2121
override func setUpWithError() throws {}
2222

2323
override func tearDown() async throws {}

Tests/LiveKitTests/AudioConverterTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import AVFAudio
1818
@testable import LiveKit
1919
import XCTest
2020

21-
class AudioConverterTests: XCTestCase {
21+
class AudioConverterTests: LKTestCase {
2222
func testConvertFormat() async throws {
2323
// Sample audio
2424
let audioDownloadUrl = URL(string: "https://github.com/rafaelreis-hotmart/Audio-Sample-files/raw/refs/heads/master/sample.wav")!

Tests/LiveKitTests/AudioEngineTests.swift

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,7 @@
1919
import LiveKitWebRTC
2020
import XCTest
2121

22-
class AudioEngineTests: XCTestCase {
23-
override class func setUp() {
24-
LiveKitSDK.setLoggerStandardOutput()
25-
RTCSetMinDebugLogLevel(.info)
26-
}
27-
22+
class AudioEngineTests: LKTestCase {
2823
override func tearDown() async throws {}
2924

3025
#if !targetEnvironment(simulator)

Tests/LiveKitTests/AudioProcessingTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import LiveKitWebRTC
2222
@testable import LiveKit
2323
import XCTest
2424

25-
class AudioProcessingTests: XCTestCase, AudioCustomProcessingDelegate {
25+
class AudioProcessingTests: LKTestCase, AudioCustomProcessingDelegate {
2626
var _initSampleRate: Double = 0.0
2727
var _initChannels: Int = 0
2828

Tests/LiveKitTests/Broadcast/BroadcastImageCodecTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
@testable import LiveKit
2020
import XCTest
2121

22-
final class BroadcastImageCodecTests: XCTestCase {
22+
final class BroadcastImageCodecTests: LKTestCase {
2323
private var codec: BroadcastImageCodec!
2424

2525
override func setUpWithError() throws {

Tests/LiveKitTests/Broadcast/IPCChannelTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import Network
2121
import XCTest
2222

23-
final class IPCChannelTests: XCTestCase {
23+
final class IPCChannelTests: LKTestCase {
2424
private var socketPath: SocketPath!
2525

2626
enum TestSetupError: Error {

Tests/LiveKitTests/Broadcast/SocketPathTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
@testable import LiveKit
2020
import XCTest
2121

22-
final class SocketPathTests: XCTestCase {
22+
final class SocketPathTests: LKTestCase {
2323
func testValid() throws {
2424
let path = "/tmp/a.sock"
2525
let socketPath = try XCTUnwrap(SocketPath(path))

Tests/LiveKitTests/BroadcastManagerTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import Combine
2020
@testable import LiveKit
2121
import XCTest
2222

23-
class BroadcastManagerTests: XCTestCase {
23+
class BroadcastManagerTests: LKTestCase {
2424
private var manager: BroadcastManager!
2525

2626
override func setUp() {

Tests/LiveKitTests/CompleterTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
@testable import LiveKit
1818
import XCTest
1919

20-
class CompleterTests: XCTestCase {
20+
class CompleterTests: LKTestCase {
2121
override func setUpWithError() throws {}
2222

2323
override func tearDown() async throws {}

0 commit comments

Comments
 (0)