Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Bump OS versions for unit tests #4542

Merged
merged 8 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from 7 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
32 changes: 30 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ jobs:
matrix:
# Can't run tests on watchOS because XCTest is not available
include:
# We are running tests on iOS 17 and later, as there were OS-internal changes introduced in succeeding versions.

# iOS 16
- runs-on: macos-13
platform: "iOS"
Expand All @@ -90,32 +92,58 @@ jobs:
test-destination-os: "17.2"
device: "iPhone 15"

# iOS 18
- runs-on: macos-15
platform: "iOS"
xcode: "16.1"
test-destination-os: "18.1"
device: "iPhone 16"

# We don't run the unit tests on macOS 13 cause we run them on all on GH actions available iOS versions.
# The chance of missing a bug solely on tvOS 16 that doesn't occur on iOS, macOS 12 or macOS 14 is minimal.
# We are running tests on macOS 14 and later, as there were OS-internal changes introduced in succeeding versions.

# macOS 14
- runs-on: macos-14
platform: "macOS"
xcode: "15.4"
test-destination-os: "latest"

# Catalyst. We only test the latest version, as
# the risk something breaking on Catalyst and not
# macOS 15
- runs-on: macos-15
platform: "macOS"
xcode: "16.1"
test-destination-os: "latest"

# Catalyst. We test the latest version, as the risk something breaking on Catalyst and not
# on an older iOS or macOS version is low.
# In addition we are running tests on macOS 14, as there were OS-internal changes introduced in succeeding versions.
- runs-on: macos-14
platform: "Catalyst"
xcode: "15.4"
test-destination-os: "latest"

- runs-on: macos-15
platform: "Catalyst"
xcode: "16.1"
test-destination-os: "latest"

# We don't run the unit tests on tvOS 16 cause we run them on all on GH actions available iOS versions.
# The chance of missing a bug solely on tvOS 16 that doesn't occur on iOS, tvOS 15 or tvOS 16 is minimal.
# We are running tests on tvOS 17 and latest, as there were OS-internal changes introduced in succeeding versions.

# tvOS 17
- runs-on: macos-14
platform: "tvOS"
xcode: "15.4"
test-destination-os: "17.5"

# tvOS 18
- runs-on: macos-15
platform: "tvOS"
xcode: "16.1"
test-destination-os: "18.1"

steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ - (void)test_NSFileManagerContentAtPath

- (void)test_NSFileManagerCreateFile
{
if (@available(iOS 18, macOS 15, tvOS 15, *)) {
XCTSkip("File IO tracking for NSFileManager is disabled for this OS version");
}
[self assertTransactionForOperation:SENTRY_FILE_WRITE_OPERATION
block:^{
[NSFileManager.defaultManager createFileAtPath:self->filePath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,20 @@ class SentryFileIOTrackingIntegrationTests: XCTestCase {
assertWriteWithNoSpans()
}

func test_Writing_Tracking() {
func test_Writing_Tracking() throws {
if #available(iOS 18, macOS 15, tvOS 15, *) {
throw XCTSkip("File IO tracking for Swift.Data is disabled for this OS version")
}
SentrySDK.start(options: fixture.getOptions())
assertSpans(1, "file.write") {
try? fixture.data.write(to: fixture.fileURL)
}
}

func test_WritingWithOption_Tracking() {
func test_WritingWithOption_Tracking() throws {
if #available(iOS 18, macOS 15, tvOS 15, *) {
throw XCTSkip("File IO tracking for Swift.Data is disabled for this OS version")
}
SentrySDK.start(options: fixture.getOptions())
assertSpans(1, "file.write") {
try? fixture.data.write(to: fixture.fileURL, options: .atomic)
Expand Down Expand Up @@ -115,14 +121,20 @@ class SentryFileIOTrackingIntegrationTests: XCTestCase {
assertWriteWithNoSpans()
}

func test_ReadingURL_Tracking() {
func test_ReadingURL_Tracking() throws {
if #available(iOS 18, macOS 15, tvOS 15, *) {
throw XCTSkip("File IO tracking for Swift.Data is disabled for this OS version")
}
SentrySDK.start(options: fixture.getOptions())
assertSpans(1, "file.read") {
let _ = try? Data(contentsOf: fixture.fileURL)
}
}

func test_ReadingURLWithOption_Tracking() {
func test_ReadingURLWithOption_Tracking() throws {
if #available(iOS 18, macOS 15, tvOS 15, *) {
throw XCTSkip("File IO tracking for Swift.Data is disabled for this OS version")
}
SentrySDK.start(options: fixture.getOptions())
assertSpans(1, "file.read") {
let data = try? Data(contentsOf: fixture.fileURL, options: .uncached)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ class SentryStacktraceBuilderTests: XCTestCase {
XCTAssertFalse(result, "The stacktrace should not contain the function that builds the stacktrace")
}

func testFramesOrder() {
func testFramesOrder() throws {
if #available(iOS 18, macOS 15, tvOS 15, *) {
throw XCTSkip("Stacktrace frames order testing is disabled for this OS version")
}
let actual = fixture.sut.buildStacktraceForCurrentThread()

// Make sure the first 4 frames contain main
Expand Down
Loading