Skip to content

Commit

Permalink
chore: Bump OS versions for unit tests (#4542)
Browse files Browse the repository at this point in the history
Co-authored-by: Philip Niedertscheider <phil.niedertscheider@sentry.io>
  • Loading branch information
brustolin and philprime authored Dec 13, 2024
1 parent fce741e commit 461d953
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 7 deletions.
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,11 @@ - (void)test_NSFileManagerContentAtPath

- (void)test_NSFileManagerCreateFile
{
if (@available(iOS 18, macOS 15, tvOS 15, *)) {
XCTSkip("File IO tracking for Swift.Data is not working for this OS version. Therefore, we "
"disable this test until we fix file IO tracking: "
"https://github.com/getsentry/sentry-cocoa/issues/4546");
}
[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

0 comments on commit 461d953

Please sign in to comment.