Skip to content

Commit

Permalink
fix: tests on Xcode 15 (#46)
Browse files Browse the repository at this point in the history
* fix: tests on Xcode 15

* Use macos-13 and xcode_15.0

* Fix VideoFiltersExample build

* Fix flaky tests

* Run tests on ios 16.2 for now
  • Loading branch information
vadymmarkov authored Sep 26, 2023
1 parent b3bd8b9 commit d64abaf
Show file tree
Hide file tree
Showing 23 changed files with 328 additions and 330 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cocoapods.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
build:
runs-on: macos-latest
runs-on: macos-13

steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ concurrency:

jobs:
build:
runs-on: macos-latest
runs-on: macos-13
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/snyk_monitor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ concurrency:

jobs:
snyk:
runs-on: macos-latest
runs-on: macos-13
steps:
- uses: actions/checkout@master

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/snyk_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ concurrency:

jobs:
snyk:
runs-on: macos-latest
runs-on: macos-13
steps:
- uses: actions/checkout@master

Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ concurrency:

jobs:
test-package:
runs-on: macos-latest
runs-on: macos-13
env:
DEVELOPER_DIR: /Applications/Xcode_15.0.app/Contents/Developer

strategy:
fail-fast: false
Expand All @@ -32,7 +34,9 @@ jobs:
clean build test | xcpretty
build-conference-example:
runs-on: macos-latest
runs-on: macos-13
env:
DEVELOPER_DIR: /Applications/Xcode_15.0.app/Contents/Developer

strategy:
fail-fast: false
Expand All @@ -54,7 +58,9 @@ jobs:
clean build CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY="" CODE_SIGN_ENTITLEMENTS="" | xcpretty
build-video-filters-example:
runs-on: macos-latest
runs-on: macos-13
env:
DEVELOPER_DIR: /Applications/Xcode_15.0.app/Contents/Developer

steps:
- name: Checkout
Expand Down
5 changes: 5 additions & 0 deletions Examples/VideoFilters/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ post_install do |installer|
if Gem::Version.new('13.0') > Gem::Version.new(config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'])
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
end

xcconfig_path = config.base_configuration_reference.real_path
xcconfig = File.read(xcconfig_path)
xcconfig_mod = xcconfig.gsub(/DT_TOOLCHAIN_DIR/, "TOOLCHAIN_DIR")
File.open(xcconfig_path, "w") { |file| file << xcconfig_mod }
end
end
end
2 changes: 1 addition & 1 deletion Examples/VideoFilters/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,6 @@ SPEC CHECKSUMS:
Protobuf: 5e6cbc143d02fe08585d86b0098f8b755d2caaab
WebRTCObjc: eafbb6955adb16faa7d369ff308796caf854abf3

PODFILE CHECKSUM: 11a385a74bd9a851ad55363a10bcfeb69acb9a95
PODFILE CHECKSUM: e37a51dc80ef8d24b557f396656deda7c8ee20d6

COCOAPODS: 1.11.3
13 changes: 11 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-snapshot-testing.git",
"state" : {
"revision" : "f8a9c997c3c1dab4e216a8ec9014e23144cbab37",
"version" : "1.9.0"
"revision" : "696b86a6d151578bca7c1a2a3ed419a5f834d40f",
"version" : "1.13.0"
}
},
{
"identity" : "swift-syntax",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-syntax.git",
"state" : {
"revision" : "74203046135342e4a4a627476dd6caf8b28fe11b",
"version" : "509.0.0"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ let package = Package(
),
.package(
url: "https://github.com/pointfreeco/swift-snapshot-testing.git",
from: "1.9.0"
from: "1.13.0"
)
],
targets: [
Expand Down
10 changes: 4 additions & 6 deletions Sources/PexipMedia/MediaConnection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,14 @@ public final class RemoteVideoTracks: ObservableObject {
self.presentationTrack = presentationTrack
}

@MainActor
public func setMainTrack(_ track: VideoTrack?) {
Task { @MainActor in
mainTrack = track
}
mainTrack = track
}

@MainActor
public func setPresentationTrack(_ track: VideoTrack?) {
Task { @MainActor in
presentationTrack = track
}
presentationTrack = track
}
}

Expand Down
7 changes: 4 additions & 3 deletions Sources/PexipRTC/Internal/WebRTCMediaConnection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ actor WebRTCMediaConnection: MediaConnection, DataSender {
mainLocalAudioTrack = nil
signalingChannel.data?.sender = nil

setRemoteTrack(nil, content: .mainVideo)
setRemoteTrack(nil, content: .presentationVideo)
await setRemoteTrack(nil, content: .mainVideo)
await setRemoteTrack(nil, content: .presentationVideo)

started = false
isMakingOffer = false
Expand Down Expand Up @@ -250,7 +250,7 @@ actor WebRTCMediaConnection: MediaConnection, DataSender {
await addOutgoingIceCandidate(candidate)
}
case let .receiverTrackUpdated(track, content):
setRemoteTrack(track, content: content)
await setRemoteTrack(track, content: content)
case let .dataReceived(data):
try await receive(data)
}
Expand Down Expand Up @@ -410,6 +410,7 @@ actor WebRTCMediaConnection: MediaConnection, DataSender {
}
}

@MainActor
private func setRemoteTrack(_ track: RTCMediaStreamTrack?, content: MediaContent) {
func videoTrack() -> WebRTCVideoTrack? {
(track as? RTCVideoTrack).map { WebRTCVideoTrack(rtcTrack: $0) }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright 2022 Pexip AS
// Copyright 2022-2023 Pexip AS
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -61,7 +61,7 @@ final class ConferenceEventServiceTests: APITestCase {
}

// 3. Assert request
assertRequest(
try assertRequest(
withMethod: .GET,
url: baseURL.appendingPathComponent("events"),
token: token,
Expand Down
Loading

0 comments on commit d64abaf

Please sign in to comment.