Skip to content

Commit

Permalink
Merge branch 'main' into impr/dispatch-queue-names
Browse files Browse the repository at this point in the history
  • Loading branch information
philipphofmann authored Oct 15, 2024
2 parents 48b0425 + f31b069 commit 27751de
Show file tree
Hide file tree
Showing 47 changed files with 825 additions and 71 deletions.
2 changes: 1 addition & 1 deletion .github/last-release-runid
Original file line number Diff line number Diff line change
@@ -1 +1 @@
11220184614
11345222588
103 changes: 103 additions & 0 deletions .github/workflows/ui-tests-critical.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: UI Tests Critical
on:
push:
branches:
- main

pull_request:
paths:
- 'Sources/**'
- '.github/workflows/ui-tests-critical.yml'
- 'fastlane/**'
- 'TestSamples/**'

# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
build-sample:
name: Build SwiftUITestSample Sample
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- run: ./scripts/ci-select-xcode.sh 16
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- run: bundle exec fastlane build_ios_swift_ui_test_sample
- uses: actions/upload-artifact@v4
with:
name: SwiftUITestSample
path: TestSamples/SwiftUITestSample/DerivedData/Build/Products/Debug-iphonesimulator/SwiftUITestSample.app

run-tests:
name: Test iOS ${{matrix.os-version}} on ${{matrix.device}} Simulator
needs: [build-sample]
runs-on: ${{matrix.runs-on}}
env:
APP_ARTIFACT_NAME: "SwiftUITestSample"
APP_PATH: "Sample.app"

MAESTRO_FLOWS_PATH: "TestSamples/SwiftUITestSample/Maestro"
MAESTRO_LOGS_PATH: "MaestroLogs"

# https://github.com/facebook/react-native/blob/24e7f7d25629a7af6d877a0b79fed2faaab96437/.github/actions/maestro-ios/action.yml#L57
MAESTRO_DRIVER_STARTUP_TIMEOUT: 1500000 # 25 min, CI can be slow at times
strategy:
fail-fast: false
matrix:
include:
- runs-on: macos-12
xcode: "13.4.1"
device: "iPhone 8"
os-version: "15.5"
create-simulator: true
- runs-on: macos-13
xcode: "14.3.1"
device: "iPhone 14"
os-version: "16.4"
create-simulator: true
- runs-on: macos-14-xlarge
# on macos-14 the iOS 17.5 simulator was unstable
# crashing and failing all UI tests
# iOS 15.5, 16.4 and 18.1 worked on the base runners
xcode: "15.4"
device: "iPhone 15"
os-version: "17.5"
- runs-on: macos-15
xcode: "16"
device: "iPhone 16"
os-version: "18.1"

steps:
- uses: actions/checkout@v4
- name: Create ${{matrix.device}} (${{matrix.os-version}}) Simulator using Xcode ${{matrix.xcode}}
if: ${{matrix.create-simulator}}
run: ./scripts/create-simulator.sh "${{matrix.xcode}}" "${{matrix.os-version}}" "${{matrix.device}}"
- name: Install Maestro
run: brew tap mobile-dev-inc/tap && brew install mobile-dev-inc/tap/maestro@1.38
- name: Install iDB Companion
run: brew tap facebook/fb && brew install facebook/fb/idb-companion

- uses: actions/download-artifact@v4
with:
name: ${{env.APP_ARTIFACT_NAME}}
path: ${{env.APP_PATH}}
- uses: futureware-tech/simulator-action@bfa03d93ec9de6dacb0c5553bbf8da8afc6c2ee9 # pin@v3
with:
model: ${{matrix.device}}
os_version: ${{matrix.os-version}}
- name: Run Maestro Flows
run: |
xcrun simctl install booted ${{env.APP_PATH}}
maestro test ${{env.MAESTRO_FLOWS_PATH}} --format junit --debug-output ${{env.MAESTRO_LOGS_PATH}}
- name: Store Maestro Logs
uses: actions/upload-artifact@v4
if: failure()
with:
name: maestro-logs-${{matrix.device}}-${{matrix.os-version}}
path: ${{env.MAESTRO_LOGS_PATH}}
10 changes: 5 additions & 5 deletions .github/workflows/ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ jobs:
path: |
~/Library/Logs/scan/*.log
./fastlane/test_output/**
ios-swift-ui-tests:
name: iOS-Swift UI Tests ${{matrix.device}}
ui-tests-swift:
name: UI Tests for iOS-Swift ${{matrix.device}} Simulator
runs-on: ${{matrix.runs-on}}
strategy:
fail-fast: false
Expand All @@ -105,10 +105,10 @@ jobs:

- name: Create iOS 16.4 simulator
if: ${{ matrix.device == 'iPhone 14 (16.4)' }}
run: ./scripts/create-simulator.sh 14.3.1 16.4 16-4
run: ./scripts/create-simulator.sh 14.3.1 16.4 "iPhone 14"

- name: Run Fastlane
run: fastlane ui_tests_ios_swift device:"${{matrix.device}}"
run: fastlane ui_tests_ios_swift device:"${{matrix.device}}"

- name: Archiving Raw Test Logs
uses: actions/upload-artifact@v4
Expand Down
7 changes: 4 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repos:
fail_fast: true
args:
- "check-versions"

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
Expand All @@ -20,6 +20,7 @@ repos:
- id: check-symlinks
- id: check-xml
- id: check-yaml
args: [--allow-multiple-documents]
- id: detect-private-key
- id: end-of-file-fixer
- id: no-commit-to-branch
Expand All @@ -30,7 +31,7 @@ repos:
- id: check-github-actions
- id: check-github-workflows
args: [--verbose]

- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
Expand All @@ -45,7 +46,7 @@ repos:
types_or: ["objective-c", "objective-c++", "c", "c++"]
args:
- "format-clang"

- id: format-swift
name: Format Swift
entry: make
Expand Down
4 changes: 4 additions & 0 deletions Brewfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ brew 'rbenv'
brew 'pre-commit'
brew 'python3'
brew 'jq'
tap 'facebook/fb'
brew 'facebook/fb/idb-companion'
tap 'mobile-dev-inc/tap'
brew 'mobile-dev-inc/tap/maestro'
16 changes: 16 additions & 0 deletions Brewfile.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,22 @@
}
}
}
},
"facebook/fb/idb-companion": {
"version": "1.1.8",
"bottle": false
},
"mobile-dev-inc/tap/maestro": {
"version": "1.38.1",
"bottle": false
}
},
"tap": {
"facebook/fb": {
"revision": "c0386793f59da10c619787f2aa18d938ef1d69c9"
},
"mobile-dev-inc/tap": {
"revision": "14a5d2ab054e7829e8028e827d35a2cc3156a4a0"
}
}
},
Expand Down
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,37 @@ via the option `swizzleClassNameExclude`.
- Swizzling RootUIViewController if ignored by `swizzleClassNameExclude` (#4407)
- Data race in SentrySwizzleInfo.originalCalled (#4434)


### Improvements

- Serializing profile on a BG Thread (#4377) to avoid potentially slightly blocking the main thread.
- Session Replay performance for SwiftUI (#4419)
- Speed up getBinaryImages (#4435) for finishing transactions and capturing events
- Align SDK dispatch queue names (#4442) to start with `io.sentry`
- Use UInts in envelope deserialization (#4441)

## 8.38.0

### Features

- Added breadcrumb.origin private field (#4358)
- Custom redact modifier for SwiftUI (#4362)
- AppHangV2 detection (#4379) Add a new algorithm for detecting app hangs that differentiates between fully blocking and non-fully blocking app hangs. Read more in-depth in our [docs](https://docs.sentry.io/platforms/apple/guides/ios/configuration/app-hangs/#app-hangs-v2).
- Add support for arm64e (#3398)
- Add mergeable libraries support to dynamic libraries (#4381)

### Improvements

- Speed up HTTP tracking for multiple requests in parallel (#4366)
- Slightly speed up SentryInAppLogic (#4370)
- Rename session replay `redact` options and APIs to `mask` (#4373)
- Stop canceling timer for manual transactions (#4380)

### Fixes

- Fix the versioning to support app release with Beta versions (#4368)
- Linking ongoing trace to crash event (#4393)
- Edge case for swizzleClassNameExclude (#4405)

## 8.38.0-beta.1

Expand Down
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ run-test-server:
cd ./test-server && swift run &
.PHONY: run-test-server

test-alamofire:
./scripts/test-alamofire.sh

test-homekit:
./scripts/test-homekit.sh

test-ui-critical:
./scripts/test-ui-critical.sh

analyze:
rm -rf analyzer
xcodebuild analyze -workspace Sentry.xcworkspace -scheme Sentry -configuration Release CLANG_ANALYZER_OUTPUT=html CLANG_ANALYZER_OUTPUT_DIR=analyzer -destination "platform=iOS Simulator,OS=latest,name=iPhone 11" CODE_SIGNING_ALLOWED="NO" | xcpretty -t && [[ -z `find analyzer -name "*.html"` ]]
Expand Down
8 changes: 4 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ let package = Package(
targets: [
.binaryTarget(
name: "Sentry",
url: "https://github.com/getsentry/sentry-cocoa/releases/download/8.38.0-beta.1/Sentry.xcframework.zip",
checksum: "ee65620084f83011c541d48dfc07054277366e200fac83cc8ba4b602fdc31fb1" //Sentry-Static
url: "https://github.com/getsentry/sentry-cocoa/releases/download/8.38.0/Sentry.xcframework.zip",
checksum: "e2467151decc3a20f1b2afd47486ff97afa5fdc99272817e3db1d491b8105caa" //Sentry-Static
),
.binaryTarget(
name: "Sentry-Dynamic",
url: "https://github.com/getsentry/sentry-cocoa/releases/download/8.38.0-beta.1/Sentry-Dynamic.xcframework.zip",
checksum: "340558f58cec3bef18d9c40f07210df0cf00d1fe1eefd8ee1238d61276496346" //Sentry-Dynamic
url: "https://github.com/getsentry/sentry-cocoa/releases/download/8.38.0/Sentry-Dynamic.xcframework.zip",
checksum: "1693d0280f08a23529640a95c49c4c975316bab442c5fa4408e6348988a33fc3" //Sentry-Dynamic
),
.target ( name: "SentrySwiftUI",
dependencies: ["Sentry", "SentryInternal"],
Expand Down
2 changes: 1 addition & 1 deletion Sentry.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "Sentry"
s.version = "8.38.0-beta.1"
s.version = "8.38.0"
s.summary = "Sentry client for cocoa"
s.homepage = "https://github.com/getsentry/sentry-cocoa"
s.license = "mit"
Expand Down
7 changes: 7 additions & 0 deletions Sentry.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion SentryPrivate.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "SentryPrivate"
s.version = "8.38.0-beta.1"
s.version = "8.38.0"
s.summary = "Sentry Private Library."
s.homepage = "https://github.com/getsentry/sentry-cocoa"
s.license = "mit"
Expand Down
4 changes: 2 additions & 2 deletions SentrySwiftUI.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "SentrySwiftUI"
s.version = "8.38.0-beta.1"
s.version = "8.38.0"
s.summary = "Sentry client for SwiftUI"
s.homepage = "https://github.com/getsentry/sentry-cocoa"
s.license = "mit"
Expand All @@ -19,5 +19,5 @@ Pod::Spec.new do |s|
s.watchos.framework = 'WatchKit'

s.source_files = "Sources/SentrySwiftUI/**/*.{swift,h,m}"
s.dependency 'Sentry', "8.38.0-beta.1"
s.dependency 'Sentry', "8.38.0"
end
12 changes: 5 additions & 7 deletions SentryTestUtils/TestCurrentDateProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ public class TestCurrentDateProvider: SentryCurrentDateProvider {
public var driftTimeInterval = 0.1
private var _systemUptime: TimeInterval = 0

public override init() {

public init() {
}

public override func date() -> Date {
public func date() -> Date {

defer {
if driftTimeForEveryRead {
Expand Down Expand Up @@ -51,15 +50,14 @@ public class TestCurrentDateProvider: SentryCurrentDateProvider {
}

public var timezoneOffsetValue = 0
public override func timezoneOffset() -> Int {
public func timezoneOffset() -> Int {
return timezoneOffsetValue
}

public override func systemTime() -> UInt64 {
public func systemTime() -> UInt64 {
return internalSystemTime
}

override public func systemUptime() -> TimeInterval {
public func systemUptime() -> TimeInterval {
_systemUptime
}
public func setSystemUptime(_ uptime: TimeInterval) {
Expand Down
3 changes: 2 additions & 1 deletion Sources/Sentry/SentryANRTrackerV1.m
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ - (void)detectANRs
NSInteger reportThreshold = 5;
NSTimeInterval sleepInterval = self.timeoutInterval / reportThreshold;

SentryCurrentDateProvider *dateProvider = SentryDependencyContainer.sharedInstance.dateProvider;
id<SentryCurrentDateProvider> dateProvider
= SentryDependencyContainer.sharedInstance.dateProvider;

// Canceling the thread can take up to sleepInterval.
while (YES) {
Expand Down
3 changes: 2 additions & 1 deletion Sources/Sentry/SentryANRTrackerV2.m
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ - (void)detectANRs
state = kSentryANRTrackerRunning;
}

SentryCurrentDateProvider *dateProvider = SentryDependencyContainer.sharedInstance.dateProvider;
id<SentryCurrentDateProvider> dateProvider
= SentryDependencyContainer.sharedInstance.dateProvider;

BOOL reported = NO;

Expand Down
4 changes: 2 additions & 2 deletions Sources/Sentry/SentryDateUtil.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

@interface SentryDateUtil ()

@property (nonatomic, strong) SentryCurrentDateProvider *currentDateProvider;
@property (nonatomic, strong) id<SentryCurrentDateProvider> currentDateProvider;

@end

@implementation SentryDateUtil

- (instancetype)initWithCurrentDateProvider:(SentryCurrentDateProvider *)currentDateProvider
- (instancetype)initWithCurrentDateProvider:(id<SentryCurrentDateProvider>)currentDateProvider
{
if (self = [super init]) {
self.currentDateProvider = currentDateProvider;
Expand Down
Loading

0 comments on commit 27751de

Please sign in to comment.