Skip to content

Commit

Permalink
Reenable CRDU Test
Browse files Browse the repository at this point in the history
  • Loading branch information
ipavlidakis committed Sep 19, 2024
1 parent 0f62fc3 commit 1e3b0b4
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
8 changes: 8 additions & 0 deletions Sources/StreamVideo/Call.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1146,6 +1146,14 @@ public class Call: @unchecked Sendable, WSEventsSubscriber {
}
}

func transitionDueToError(_ error: Error) {
do {
try stateMachine.transition(.error(self, error: error))
} catch {
log.error(error)
}
}

// MARK: - private

private func updatePermissions(
Expand Down
3 changes: 3 additions & 0 deletions Sources/StreamVideo/Controllers/CallController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,9 @@ class CallController: @unchecked Sendable {

call?.update(reconnectionStatus: .connected)
case .error:
if let call, let errorStage = stage as? WebRTCCoordinator.StateMachine.Stage.ErrorStage {
call.transitionDueToError(errorStage.error)
}
call?.leave()
default:
break
Expand Down
1 change: 0 additions & 1 deletion StreamVideoTests/IntegrationTests/CallCRUDTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,6 @@ final class CallCRUDTest: IntegrationTest {
}

func test_joinBackstageRegularUser() async throws {
throw XCTSkip()
let startingDate = Date(timeIntervalSinceNow: 30)
let joiningDate = Date(timeInterval: -20, since: startingDate)
let firstUserCall = client.call(callType: .livestream, callId: randomCallId)
Expand Down
9 changes: 8 additions & 1 deletion StreamVideoTests/IntegrationTests/IntegrationTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import XCTest

class IntegrationTest: XCTestCase {

private static var videoConfig: VideoConfig! = .dummy()

private var apiKey: String! = ""
private var userId: String! = "thierry"
private var baseURL: URL! = .init(string: "https://pronto.getstream.io/api/auth/create-token")!
Expand All @@ -26,6 +28,11 @@ class IntegrationTest: XCTestCase {
#endif
}

override class func tearDown() {
Self.videoConfig = nil
super.tearDown()
}

override func tearDown() {
apiKey = nil
userId = nil
Expand All @@ -50,7 +57,7 @@ class IntegrationTest: XCTestCase {
apiKey: tokenResponse.apiKey,
user: User(id: userId),
token: .init(rawValue: tokenResponse.token),
videoConfig: .dummy(),
videoConfig: Self.videoConfig,
pushNotificationsConfig: .init(
pushProviderInfo: .init(name: "ios-apn", pushProvider: .apn),
voipPushProviderInfo: .init(name: "ios-voip", pushProvider: .apn)
Expand Down

0 comments on commit 1e3b0b4

Please sign in to comment.