Skip to content

chore: Fix watchOS tests and add them to nightly job#7633

Open
itaybre wants to merge 10 commits intomainfrom
itay/fix_watchos_tests_2
Open

chore: Fix watchOS tests and add them to nightly job#7633
itaybre wants to merge 10 commits intomainfrom
itay/fix_watchos_tests_2

Conversation

@itaybre
Copy link
Contributor

@itaybre itaybre commented Mar 6, 2026

📜 Description

Fixes watchOS tests

💡 Motivation and Context

💚 How did you test it?

📝 Checklist

You have to check all boxes before merging:

  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

Closes #7634

@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2026

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

  • (SPM) Add package traits for UI framework opt-out and macOS CLI sample by philprime in #7578
  • Use full flamegraph for metrickit app hangs by noahsmartin in #7185

Bug Fixes 🐛

  • Capture transactions during launch profiling window by philipphofmann in #7602

Internal Changes 🔧

Deps

  • Bump actions/setup-node from 6.2.0 to 6.3.0 by dependabot in #7627
  • Bump getsentry/craft/.github/workflows/changelog-preview.yml from 2.23.0 to 2.23.2 by dependabot in #7628
  • Bump getsentry/craft from 2.23.0 to 2.23.2 by dependabot in #7629
  • Bump ruby/setup-ruby from 1.288.0 to 1.290.0 by dependabot in #7631

Samples

  • Restructure watchOS-Swift sample by philprime in #7614
  • Restructure visionOS-Swift sample by philprime in #7616
  • Restructure visionOS-SwiftUI-SPM sample by philprime in #7615

Other

  • (ci) Adds a Nightly Job with unit tests for less frequent devices by itaybre in #7632
  • (test-samples) Restructure SwiftUITestSample and SwiftUICrashTest by philprime in #7612
  • Fix watchOS tests and add them to nightly job by itaybre in #7633
  • Fix flaky HangTracker deallocated test by noahsmartin in #7639

🤖 This preview updates automatically when you update the PR.

@itaybre itaybre added the ready-to-merge Use this label to trigger all PR workflows label Mar 6, 2026
@codecov
Copy link

codecov bot commented Mar 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.360%. Comparing base (3fcdded) to head (e6bbc5b).
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@                 Coverage Diff                 @@
##           itay/cron_job     #7633       +/-   ##
===================================================
+ Coverage         85.314%   85.360%   +0.045%     
===================================================
  Files                483       483               
  Lines              28750     28750               
  Branches           12492     12501        +9     
===================================================
+ Hits               24528     24541       +13     
+ Misses              4175      4163       -12     
+ Partials              47        46        -1     
Files with missing lines Coverage Δ
...tils/Sources/TestNSNotificationCenterWrapper.swift 100.000% <ø> (ø)
Sources/Sentry/SentryDevice.m 22.619% <ø> (ø)

... and 7 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3fcdded...e6bbc5b. Read the comment docs.

@sentry
Copy link

sentry bot commented Mar 6, 2026

Sentry Build Distribution

App Version Configuration
SDK-Size 9.6.0 (1) Release

@itaybre itaybre marked this pull request as ready for review March 6, 2026 19:56
@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2026

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1224.26 ms 1254.07 ms 29.80 ms
Size 24.14 KiB 1.12 MiB 1.09 MiB

Previous results on branch: itay/fix_watchos_tests_2

Startup times

Revision Plain With Sentry Diff
1a87189 1207.36 ms 1242.32 ms 34.96 ms

App size

Revision Plain With Sentry Diff
1a87189 24.14 KiB 1.12 MiB 1.10 MiB

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

@sentry
Copy link

sentry bot commented Mar 6, 2026

Sentry Build Distribution

App Version Configuration
SDK-Size 9.6.0 (1) Release

./scripts/check-clang-format.py -r Sources Tests
ruby ./scripts/check-objc-id-usage.rb -r Sources/Sentry
@if [ -n "$(STAGED_SWIFT_FILES)" ]; then \
swiftlint --strict --quiet --config .swiftlint.yml $(STAGED_SWIFT_FILES); \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, forcing ./.swiftlint.yml on every check failed, because it was not picking up the more specific config for each subfolder (see https://github.com/getsentry/sentry-cocoa/blob/main/SentryTestUtils/.swiftlint.yml and https://github.com/getsentry/sentry-cocoa/blob/main/Tests/.swiftlint.yml)

ruby ./scripts/check-objc-id-usage.rb -r Sources/Sentry
@if [ -n "$(STAGED_SWIFT_FILES)" ]; then \
swiftlint --strict --quiet --config .swiftlint.yml $(STAGED_SWIFT_FILES); \
swiftlint --strict --quiet $(STAGED_SWIFT_FILES); \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

m: We should prefer explicit configuration over defaults

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Swiftlint already looks for the config in the current folder and subfolders: https://github.com/realm/SwiftLint?tab=readme-ov-file#nested-configurations

We shouldn't need to add it manually

#elif TARGET_OS_WATCH
// TODO: create a watch UI test target to test this branch
SENTRY_ASSERT_PREFIX(osVersion, @"2.", @"3.", @"4.", @"5.", @"6.", @"7.", @"8.", @"9.", @"26.");
XCTAssertEqualObjects(osVersion, @"");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

m: I don't fully understand why this is now an assertion to an empty string, instead of actually getting an version string

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

watchOS always returned an empty string:

It was always broken

Base automatically changed from itay/cron_job to main March 9, 2026 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Use this label to trigger all PR workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore: Fix watchOS tests and add them to nightly job

3 participants