Skip to content

Commit

Permalink
Merge branch 'master' into feat/1014-include-app-permissions
Browse files Browse the repository at this point in the history
* master:
  ci: benchmarking and profile generation improvements (#2022)
  release: 7.23.0
  fix: Bad merge on CHANGELOG.md (#2020)
  fix: Log empty samples instead of collecting stacks for idle threads (#2013)
  fix: Handle failure to read thread priority gracefully (#2015)
  fix: Remove logging that could occur while a thread is suspended (#2014)
  fix: Use constant for max thread name size instead of magic number (#2012)
  Disable flaky tesDefaultMaxEnvelopesConcurrent (#2018)
  Fix build failure in unit tests (#2019)
  Fix address sanitizer compilation error (#1996)
  fix: Sauce labs iPhone 13 pro iOS version
  feat: Add transaction to baggage and trace headers (#1992)
  ci: fix ui thread starvation in benchmarks (#2009)
  fix: Add more descriptive deprecation message for enableProfiling (#2011)
  feat: Add sampling configuration for profiling (#2004)
  fix log message option name (#2006)
  meta: add armcknight as a codeowner (#2008)
  release: 7.22.0
  fix: Disable broken LaunchUITests to unblock release (#2003)

# Conflicts:
#	Samples/iOS-Swift/iOS-Swift/ViewControllers/PerformanceViewController.swift
  • Loading branch information
kevinrenskers committed Aug 1, 2022
2 parents 9da354d + 29fe666 commit a7dd179
Show file tree
Hide file tree
Showing 60 changed files with 783 additions and 360 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @philipphofmann @brustolin
* @philipphofmann @brustolin @armcknight
6 changes: 4 additions & 2 deletions .github/workflows/benchmarking.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:

jobs:
build-benchmark-test-target:
name: Build UITests with Xcode ${{matrix.xcode}}
name: Build app and test runner
runs-on: macos-11
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -49,6 +49,8 @@ jobs:
needs: build-benchmark-test-target
strategy:
fail-fast: false
matrix:
suite: ["High-end device", "Mid-range device", "Low-end device"]
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
Expand All @@ -59,4 +61,4 @@ jobs:
env:
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
run: saucectl run --select-suite "High-end device" --config .sauce/benchmarking-config.yml --tags benchmark --retries 5
run: saucectl run --select-suite "${{matrix.suite}}" --config .sauce/benchmarking-config.yml --tags benchmark
11 changes: 5 additions & 6 deletions .github/workflows/profile-data-generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:

jobs:
build-profile-data-generator-targets:
name: Build app and UI test targets
name: Build app and test runner
runs-on: macos-12
steps:
- uses: actions/checkout@v3
Expand All @@ -30,7 +30,7 @@ jobs:
path: ./Samples/TrendingMovies/Carthage/Build
key: trendingmovies-carthage-cache-key-${{ hashFiles('Samples/TrendingMovies/Cartfile.resolved') }}
- name: Install Carthage deps
if: steps.trendingmovies-carthage-cache.cache-hit != 'true'
if: steps.trendingmovies-carthage-cache.outputs.cache-hit != 'true'
run: cd Samples/TrendingMovies && carthage update --use-xcframeworks
- run: fastlane build_profile_data_generator_ui_test
env:
Expand All @@ -43,7 +43,6 @@ jobs:
MATCH_USERNAME: ${{ secrets.MATCH_USERNAME }}
- name: Upload dSYMs
run: |
sentry-cli --auth-token ${{ secrets.SENTRY_AUTH_TOKEN }} upload-dif --org sentry-sdks --project trending-movies DerivedData/Build/Products/Debug-iphoneos/ProfileDataGeneratorUITest-Runner.app/PlugIns/ProfileDataGeneratorUITest.xctest.dSYM
sentry-cli --auth-token ${{ secrets.SENTRY_AUTH_TOKEN }} upload-dif --org sentry-sdks --project trending-movies DerivedData/Build/Products/Debug-iphoneos/TrendingMovies.app.dSYM
- name: Archiving DerivedData
uses: actions/upload-artifact@v3
Expand All @@ -54,13 +53,13 @@ jobs:
**/Debug-iphoneos/ProfileDataGeneratorUITest-Runner.app
run-profile-data-generator:
name: Run on Sauce Labs
name: Run profile generation on Sauce Labs
runs-on: ubuntu-latest
needs: build-profile-data-generator-targets
strategy:
fail-fast: false
matrix:
iOS: [15.5, 15.4, 14.8, 14.7, 13.7]
suite: ["High-end device", "Mid-range device"]
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
Expand All @@ -71,4 +70,4 @@ jobs:
env:
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
run: for i in {1..5}; do saucectl run --select-suite iOS-${{ matrix.iOS }} --config .sauce/profile-data-generator-config.yml && break ; done
run: saucectl run --select-suite "${{ matrix.suite }}" --config .sauce/profile-data-generator-config.yml --retries 5
14 changes: 13 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,18 @@ jobs:

# GitHub Actions sometimes fail to launch the UI tests. Therefore we retry
- name: Run Fastlane
run: for i in {1..2}; do fastlane ui_tests_${{matrix.target}} device:"$iPhone 8 (12.4)" && break ; done
run: for i in {1..2}; do fastlane ui_tests_${{matrix.target}} device:"$iPhone 8 (12.4)" address_sanitizer:false && break ; done
shell: sh

ui-tests-address-sanitizer:
name: UI Tests with Address Sanitizer
runs-on: macos-12

steps:
- uses: actions/checkout@v3
- run: ./scripts/ci-select-xcode.sh 13.4.1

# GitHub Actions sometimes fail to launch the UI tests. Therefore we retry
- name: Run Fastlane
run: for i in {1..2}; do fastlane ui_tests_ios_swift device:"$iPhone 8 (15.5)" address_sanitizer:true && break ; done
shell: sh
10 changes: 9 additions & 1 deletion .sauce/benchmarking-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sauce:
concurrency: 2

defaults:
timeout: 30m # empirically observed; job usually takes 20-25 minutes on iPad Pro 12.9 2021
timeout: 20m

xcuitest:
app: ./DerivedData/Build/Products/Debug-iphoneos/iOS-Swift.app
Expand All @@ -16,3 +16,11 @@ suites:
devices:
- name: "iPad Pro 12.9 2021"
platformVersion: "15.5"
- name: "Mid-range device"
devices:
- name: "iPhone 8"
platformVersion: "14.8"
- name: "Low-end device"
devices:
- name: "iPhone 6S"
platformVersion: "15.3.1"
2 changes: 1 addition & 1 deletion .sauce/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ suites:
- name: "iPhone-Pro"
devices:
- name: "iPhone 13 Pro.*"
platformVersion: "15.5"
platformVersion: "15.6"

- name: "iOS-14"
devices:
Expand Down
57 changes: 5 additions & 52 deletions .sauce/profile-data-generator-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,58 +12,11 @@ xcuitest:
testApp: ./DerivedData/Build/Products/Debug-iphoneos/ProfileDataGeneratorUITest-Runner.app

suites:

# iPhone 11
# iPhone 11 Pro Max
# iPhone 12
# iPhone 12 mini
# iPhone 13
# iPhone 13 Pro
# iPhone 13 Pro Max
# iPhone 13 mini
# iPhone XR
- name: "iOS-15.5"
devices:
- name: "iPhone.*"
platformVersion: "15.5"

# iPad 10.2 2020
# iPad Air 2022 5th Gen
# iPad Mini 2021 6th Gen
# iPhone SE 2022
# iPhone XS
- name: "iOS-15.4"
- name: "High-end device"
devices:
- name: "iPhone.*"
platformVersion: "15.4"

# iPad Air 3 (2019)
# iPhone 11
# iPhone 11 Pro
# iPhone 12
# iPhone 12 Pro
# iPhone 12 Pro Max
# iPhone 7 Plus
# iPhone 8
# iPhone SE 2020
# iPhone X
- name: "iOS-14.8"
- name: "iPhone 13 Pro Max"
platformVersion: "15.6"
- name: "Mid-range device"
devices:
- name: "iPhone.*"
- name: "iPhone 8"
platformVersion: "14.8"

# iPad Pro 12.9 2020
# iPad Pro 12.9 2021
- name: "iOS-14.7"
devices:
- name: "iPhone.*"
platformVersion: "14.7"

#iPad Pro 11 2018
#iPad Pro 12.9 2018
#iPhone SE 2020
#iPhone X
- name: "iOS-13.7"
devices:
- name: "iPhone.*"
platformVersion: "13.7"
21 changes: 20 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,27 @@

### Features

- Read free_memory when the event is captured, not only at SDK startup (#1962)
- Include app permissions with event (#1984)

## 7.23.0

### Features

- Add sampling configuration for profiling (#2004)
- Add transaction to baggage and trace headers (#1992)

### Fixes

- Log empty samples instead of collecting stacks for idle threads (#2013)
- Remove logging that could occur while a thread is suspended (#2014)
- Handle failure to read thread priority gracefully (#2015)
- Fix address sanitizer compilation error (#1996)

## 7.22.0

### Features

- Read free_memory when the event is captured, not only at SDK startup (#1962)
- Provide private access to SentryOptions for hybrid SDKs (#1991)

### Fixes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,62 +51,43 @@ - (void)testGenerateProfileData
return NO;
}

XCUIElementQuery *const tabBarButtons = app.tabBars.firstMatch.buttons;
NSUInteger consecutiveFindCellFailureCount = 0;
for (NSUInteger t = 0; t < tabBarButtons.count; t++) {
XCUIElement *const tabBarButton = [tabBarButtons elementBoundByIndex:t];
XCUIElement *const tabBar = app.tabBars.firstMatch;
if (![tabBar waitForExistenceWithTimeout:kWaitForElementTimeout]) {
XCTFail("Failed to locate tab bar");
return NO;
}

for (NSUInteger t = 0; t < 3; t++) {
XCUIElement *const tabBarButton = [tabBar.buttons elementBoundByIndex:t];
if (![tabBarButton waitForExistenceWithTimeout:kWaitForElementTimeout]) {
XCTFail("Failed to find tab bar button %llu", (unsigned long long)t);
return NO;
}
[tabBarButton doubleTap];

for (NSUInteger i = 0; i < nCellsPerTab; i++) {
[tabBarButton tap];

for (NSUInteger i = 0; i < 4; i++) {
XCUIElement *const cellElement
= app.collectionViews
.cells[[NSString stringWithFormat:@"movie %llu", (unsigned long long)i]];

NSUInteger scrollCount = 0;
BOOL retriedOnce = NO;
while (!cellElement.hittable) {
[app swipeUpWithVelocity:XCUIGestureVelocitySlow];
scrollCount++;

if (scrollCount >= kMaxScrollCount) {
if (!retriedOnce) {
// We might have overshot the cell, so scroll back up to the top and
// try again.
for (NSUInteger i = 0; i < kMaxScrollCount; i++) {
[app swipeDownWithVelocity:XCUIGestureVelocityFast];
}
scrollCount = 0;
retriedOnce = YES;
} else {
// Something's wrong, bail out.
break;
}
}
}
if (![cellElement waitForExistenceWithTimeout:kWaitForElementTimeout]) {
consecutiveFindCellFailureCount++;
break;
XCTFail("Failed to find the cell.");
return NO;
}
consecutiveFindCellFailureCount = 0;
[cellElement tap];

[NSThread sleepForTimeInterval:1.0];

XCUIElement *const backButton = [app.navigationBars.buttons elementBoundByIndex:0];
if (![backButton waitForExistenceWithTimeout:kWaitForElementTimeout]) {
XCTFail("Failed to find back button");
return NO;
// failed to find a back button; maybe we're still on the movie list screen
if (![app.tabBars.firstMatch waitForExistenceWithTimeout:kWaitForElementTimeout]) {
XCTFail("Failed to find back button");
return NO;
}
}
[backButton tap];
}

if (consecutiveFindCellFailureCount >= kMaxConsecutiveFindCellFailures) {
XCTFail("Failed to find a cell %llu times",
(unsigned long long)consecutiveFindCellFailureCount);
break;
}
}

[XCUIDevice.sharedDevice pressButton:XCUIDeviceButtonHome];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ extension Tracer {
options.tracesSampleRate = 1.0
options.enableFileIOTracking = true
options.enableCoreDataTracking = true
options.enableProfiling = true
options.profilesSampleRate = 1.0
options.attachScreenshot = true
options.enableUserInteractionTracing = true
}
Expand Down
Loading

0 comments on commit a7dd179

Please sign in to comment.