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: Fix tests for Xcode 16 #4433

Merged
merged 6 commits into from
Oct 15, 2024
Merged

chore: Fix tests for Xcode 16 #4433

merged 6 commits into from
Oct 15, 2024

Conversation

brustolin
Copy link
Contributor

@brustolin brustolin commented Oct 14, 2024

Our tests are broken when running with Xcode 16.

Our setup is a little different:

  • We have the SDK
  • Two test targets
  • A library used to share code in the tests

We use @testable import Sentry inside the library to create mock classes that we want to use in the tests. Essentially, we are trying to access an SDK private class from a test target by making it public through the library.

This used to work with Xcode 15, but it no longer works in Xcode 16. Maybe the Swift compiler changed something. I don’t think Apple will release a fix for this (I’m not even sure if this is a bug).

#skip-changelog

Copy link

codecov bot commented Oct 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.333%. Comparing base (a2cf26e) to head (dbc8d3e).
Report is 7 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #4433       +/-   ##
=============================================
- Coverage   91.335%   91.333%   -0.002%     
=============================================
  Files          610       610               
  Lines        49927     49928        +1     
  Branches     18032     18046       +14     
=============================================
  Hits         45601     45601               
- Misses        4234      4235        +1     
  Partials        92        92               
Files with missing lines Coverage Δ
SentryTestUtils/TestCurrentDateProvider.swift 91.176% <100.000%> (ø)
Sources/Sentry/SentryANRTrackerV1.m 100.000% <100.000%> (ø)
Sources/Sentry/SentryANRTrackerV2.m 99.122% <100.000%> (+0.007%) ⬆️
Sources/Sentry/SentryDateUtil.m 100.000% <ø> (ø)
Sources/Sentry/SentryDefaultRateLimits.m 100.000% <ø> (ø)
Sources/Sentry/SentryDelayedFramesTracker.m 99.074% <ø> (ø)
Sources/Sentry/SentryDependencyContainer.m 96.319% <100.000%> (ø)
Sources/Sentry/SentryFramesTracker.m 99.354% <ø> (ø)
Sources/Sentry/SentryRateLimitParser.m 100.000% <ø> (ø)
Sources/Sentry/SentryRetryAfterHeaderParser.m 100.000% <ø> (ø)
... and 3 more

... and 3 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 a2cf26e...dbc8d3e. Read the comment docs.

Copy link

github-actions bot commented Oct 14, 2024

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1244.02 ms 1259.77 ms 15.74 ms
Size 21.90 KiB 707.51 KiB 685.61 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
4bad5f9 1237.20 ms 1250.51 ms 13.31 ms
728804f 1235.26 ms 1254.20 ms 18.94 ms
861d361 1227.90 ms 1231.45 ms 3.55 ms
add8416 1270.72 ms 1300.38 ms 29.66 ms
af1f4dd 1225.39 ms 1245.48 ms 20.09 ms
ed49f0c 1245.67 ms 1261.15 ms 15.48 ms
7bc3c0d 1259.74 ms 1268.45 ms 8.71 ms
02a972c 1207.08 ms 1221.78 ms 14.70 ms
c59914b 1342.08 ms 1375.73 ms 33.65 ms
6943de0 1235.98 ms 1246.88 ms 10.90 ms

App size

Revision Plain With Sentry Diff
4bad5f9 21.58 KiB 678.20 KiB 656.61 KiB
728804f 22.85 KiB 411.76 KiB 388.91 KiB
861d361 20.76 KiB 435.65 KiB 414.89 KiB
add8416 21.58 KiB 541.91 KiB 520.33 KiB
af1f4dd 22.85 KiB 414.71 KiB 391.86 KiB
ed49f0c 21.58 KiB 632.13 KiB 610.55 KiB
7bc3c0d 20.76 KiB 427.35 KiB 406.59 KiB
02a972c 22.85 KiB 413.42 KiB 390.57 KiB
c59914b 21.58 KiB 671.90 KiB 650.32 KiB
6943de0 20.76 KiB 393.33 KiB 372.57 KiB

Previous results on branch: chore/Fix-Test

Startup times

Revision Plain With Sentry Diff
ba7eabf 1240.39 ms 1255.73 ms 15.34 ms
a92ece4 1222.53 ms 1246.72 ms 24.19 ms

App size

Revision Plain With Sentry Diff
ba7eabf 21.58 KiB 706.06 KiB 684.48 KiB
a92ece4 21.58 KiB 707.51 KiB 685.93 KiB

@philipphofmann
Copy link
Member

I guess this PR should fix this issue #4351.

Copy link
Member

@philipphofmann philipphofmann left a comment

Choose a reason for hiding this comment

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

Maybe a protocol is the better choice here?

Sources/Swift/Helper/SentryCurrentDateProvider.swift Outdated Show resolved Hide resolved
Copy link
Member

@philipphofmann philipphofmann left a comment

Choose a reason for hiding this comment

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

Thanks.

Copy link
Member

@philipphofmann philipphofmann left a comment

Choose a reason for hiding this comment

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

LGTM.

@brustolin brustolin merged commit 7642702 into main Oct 15, 2024
68 of 70 checks passed
@brustolin brustolin deleted the chore/Fix-Test branch October 15, 2024 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants