Skip to content

Commit 4483491

Browse files
ci: Run unit tests on macOS and tvOS 26 (#6136)
Add running unit tests for macOS 26.0, and tvOS 26.
1 parent c30e401 commit 4483491

File tree

4 files changed

+37
-19
lines changed

4 files changed

+37
-19
lines changed

.github/workflows/test.yml

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,11 @@ jobs:
134134

135135
# iOS 26 with Xcode 26
136136
- name: iOS 26 Sentry
137-
runs-on: macos-15
137+
runs-on: macos-26
138138
platform: "iOS"
139139
xcode: "26.0"
140-
test-destination-os: "26.0"
141-
device: "iPhone 16 Pro"
140+
test-destination-os: "latest"
141+
device: "iPhone 17 Pro"
142142
scheme: "Sentry"
143143

144144
# We don't run the unit tests on macOS 13 cause we run them on all on GH actions available iOS versions.
@@ -161,6 +161,14 @@ jobs:
161161
test-destination-os: "latest"
162162
scheme: "Sentry"
163163

164+
# macOS 26
165+
- name: macOS 26 Sentry
166+
runs-on: macos-26
167+
platform: "macOS"
168+
xcode: "26.0"
169+
test-destination-os: "latest"
170+
scheme: "Sentry"
171+
164172
# Catalyst. We test the latest version, as the risk something breaking on Catalyst and not
165173
# on an older iOS or macOS version is low.
166174
# In addition we are running tests on macOS 14, as there were OS-internal changes introduced in succeeding versions.
@@ -207,6 +215,15 @@ jobs:
207215
test-destination-os: "18.4"
208216
scheme: "Sentry"
209217

218+
# tvOS 26
219+
- name: tvOS 26 Sentry
220+
runs-on: macos-26
221+
platform: "tvOS"
222+
xcode: "26.0"
223+
test-destination-os: "latest"
224+
device: "Apple TV"
225+
scheme: "Sentry"
226+
210227
steps:
211228
- uses: actions/checkout@v5
212229
- uses: actions/download-artifact@v5
@@ -217,13 +234,6 @@ jobs:
217234
run: ./scripts/start-test-server.sh
218235
- run: ./scripts/ci-select-xcode.sh ${{matrix.xcode}}
219236

220-
- name: Install required platforms for Xcode 26
221-
if: matrix.xcode == '26.0' && matrix.platform != ''
222-
run: ./scripts/ci-install-xOS-26-platforms.sh --platforms "${{matrix.platform}}"
223-
224-
- name: Create simulator device for Xcode 26
225-
if: matrix.xcode == '26.0' && matrix.platform != ''
226-
run: ./scripts/ci-create-simulator.sh --platform "${{matrix.platform}}" --os-version "${{matrix.test-destination-os}}" --device-name "${{matrix.device}}"
227237
- name: Install Slather
228238
run: gem install slather
229239

Tests/SentryTests/Integrations/SessionReplay/SentrySessionReplayIntegrationTests.swift

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@ import XCTest
77

88
@available(*, deprecated, message: "This is deprecated because SentryOptions integrations is deprecated")
99
class SentrySessionReplayIntegrationTests: XCTestCase {
10-
10+
11+
private var uiApplication: TestSentryUIApplication!
12+
private var globalEventProcessor: SentryGlobalEventProcessor!
13+
1114
private class TestCrashWrapper: SentryCrashWrapper {
1215
let traced: Bool
13-
16+
1417
init(traced: Bool = true) {
1518
self.traced = traced
1619
super.init(processInfoWrapper: ProcessInfo.processInfo, systemInfo: [:]) // Call the test designated initializer
@@ -22,16 +25,18 @@ class SentrySessionReplayIntegrationTests: XCTestCase {
2225
}
2326

2427
override func setUpWithError() throws {
25-
guard #available(iOS 16.0, tvOS 16.0, *) else {
28+
guard #available(iOS 16.0, tvOS 16.0, *) else {
2629
throw XCTSkip("iOS version not supported")
2730
}
28-
}
29-
30-
private var uiApplication = TestSentryUIApplication()
31-
private var globalEventProcessor = SentryGlobalEventProcessor()
3231

33-
override func setUp() {
32+
if #available(iOS 26.0, tvOS 26.0, macCatalyst 26.0, *) {
33+
throw XCTSkip("When running the unit tests on iOS 26.0, tvOS 26 or macCatalyst 26.0 with Xcode 26.0, we get warning log messages on the console: 'nw_socket_set_connection_idle [C1.1.1.1:3] setsockopt SO_CONNECTION_IDLE failed [42: Protocol not available]'. This leads to test failures in CI. Therefore, we skip these for now. We are going to fix this with https://github.com/getsentry/sentry-cocoa/issues/6165.")
34+
}
35+
36+
uiApplication = TestSentryUIApplication()
37+
globalEventProcessor = SentryGlobalEventProcessor()
3438
uiApplication.windows = [UIWindow()]
39+
3540
SentryDependencyContainer.sharedInstance().application = uiApplication
3641
SentryDependencyContainer.sharedInstance().reachability = TestSentryReachability()
3742
SentryDependencyContainer.sharedInstance().globalEventProcessor = globalEventProcessor

Tests/SentryTests/Networking/SentrySpotlightTransportTests.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ final class SentrySpotlightTransportTests: XCTestCase {
101101

102102
// Compressing with GZip doesn't always produce the same results
103103
// We only want to know if the attachment got removed. Therefore, a comparison with a range is acceptable.
104-
XCTAssert((expectedDataCountLower...expectedDataCountUpper).contains(try XCTUnwrap(request.httpBody?.count)))
104+
let expectedBodyCountRange = (expectedDataCountLower...expectedDataCountUpper)
105+
let actualBodyCount = try XCTUnwrap(request.httpBody?.count)
106+
XCTAssertTrue(expectedBodyCountRange.contains(actualBodyCount), "Expected body size to be in range of \(expectedBodyCountRange), but was \(actualBodyCount)")
105107
}
106108

107109
@available(*, deprecated, message: "This is only marked as deprecated because enableAppLaunchProfiling is marked as deprecated. Once that is removed this can be removed.")

scripts/ci-select-xcode.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# - https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md
55
# - https://github.com/actions/runner-images/blob/main/images/macos/macos-14-Readme.md
66
# - https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md
7+
# - https://github.com/actions/runner-images/blob/main/images/macos/macos-26-arm64-Readme.md
78

89
set -euo pipefail
910

0 commit comments

Comments
 (0)