Skip to content

Commit

Permalink
ci: Remove caching for UI tests (#2210)
Browse files Browse the repository at this point in the history
The UI tests were using caches that stopped the UI tests from
recompiling when there were changes in the library code.
Instead, we need to recompile the test sample apps with their
UI tests when there are changes in the library code to be able
to catch bugs. This is fixed now by removing the cache.
  • Loading branch information
philipphofmann authored Sep 22, 2022
1 parent 9fc2dd0 commit 5025d2e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 44 deletions.
18 changes: 0 additions & 18 deletions .github/workflows/benchmarking.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,7 @@ jobs:
- name: Install SentryCli
run: brew install getsentry/tools/sentry-cli
- run: git apply ./scripts/set-device-tests-environment.patch
- name: Cache iOS-Swift App and dSYM build products
id: ios-swift-cache
uses: actions/cache@v3
with:
path: |
DerivedData/Build/Products/Debug-iphoneos/iOS-Swift.app.dSYM
DerivedData/Build/Products/Debug-iphoneos/iOS-Swift.app
key: ios-swift-for-ui-testing-cache-key-${{ hashFiles('Samples/iOS-Swift/iOS-Swift/**') }}
- name: Cache iOS-Swift UI Test Runner App build product
id: ios-swift-benchmark-runner-cache
uses: actions/cache@v3
with:
path: |
DerivedData/Build/Products/Debug-iphoneos/PerformanceBenchmarks-Runner.app
key: ios-swift-for-ui-testing-cache-key-${{ hashFiles('Samples/iOS-Swift/PerformanceBenchmarks/**') }}
- run: fastlane build_ios_swift_for_tests
if: steps.ios-swift-cache.outputs.cache-hit != 'true'
env:
APP_STORE_CONNECT_KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }}
APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
Expand All @@ -56,7 +40,6 @@ jobs:
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
MATCH_USERNAME: ${{ secrets.MATCH_USERNAME }}
- run: fastlane build_ios_benchmark_test
if: steps.ios-swift-benchmark-runner-cache.outputs.cache-hit != 'true'
env:
APP_STORE_CONNECT_KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }}
APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
Expand All @@ -66,7 +49,6 @@ jobs:
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
MATCH_USERNAME: ${{ secrets.MATCH_USERNAME }}
- name: Upload dSYMs
if: steps.ios-swift-cache.outputs.cache-hit != 'true'
run: |
sentry-cli --auth-token ${{ secrets.SENTRY_AUTH_TOKEN }} upload-dif --org sentry-sdks --project sentry-cocoa DerivedData/Build/Products/Debug-iphoneos/iOS-Swift.app.dSYM
- name: Archiving DerivedData
Expand Down
18 changes: 0 additions & 18 deletions .github/workflows/saucelabs-UI-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,7 @@ jobs:
- name: Install SentryCli
run: brew install getsentry/tools/sentry-cli
- run: git apply ./scripts/set-device-tests-environment.patch
- name: Cache iOS-Swift App and dSYM build products
id: ios-swift-cache
uses: actions/cache@v3
with:
path: |
DerivedData/Build/Products/Debug-iphoneos/iOS-Swift.app.dSYM
DerivedData/Build/Products/Debug-iphoneos/iOS-Swift.app
key: ios-swift-for-ui-testing-cache-key-${{ hashFiles('Samples/iOS-Swift/iOS-Swift/**') }}-Xcode-${{ matrix.xcode }}
- name: Cache iOS-Swift UI Test Runner App build product
id: ios-swift-uitest-runner-cache
uses: actions/cache@v3
with:
path: |
DerivedData/Build/Products/Debug-iphoneos/iOS-SwiftUITests-Runner.app
key: ios-swift-for-ui-testing-cache-key-${{ hashFiles('Samples/iOS-Swift/iOS-SwiftUITests/**') }}-Xcode-${{ matrix.xcode }}
- run: fastlane build_ios_swift_for_tests
if: steps.ios-swift-cache.outputs.cache-hit != 'true'
env:
APP_STORE_CONNECT_KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }}
APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
Expand All @@ -63,7 +47,6 @@ jobs:
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
MATCH_USERNAME: ${{ secrets.MATCH_USERNAME }}
- run: fastlane build_ios_swift_ui_test
if: steps.ios-swift-uitest-runner-cache.outputs.cache-hit != 'true'
env:
APP_STORE_CONNECT_KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }}
APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
Expand All @@ -73,7 +56,6 @@ jobs:
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
MATCH_USERNAME: ${{ secrets.MATCH_USERNAME }}
- name: Upload dSYMs
if: steps.ios-swift-cache.outputs.cache-hit != 'true'
run: |
sentry-cli --auth-token ${{ secrets.SENTRY_AUTH_TOKEN }} upload-dif --org sentry-sdks --project sentry-cocoa DerivedData/Build/Products/Debug-iphoneos/iOS-Swift.app.dSYM
- name: Archiving DerivedData
Expand Down
14 changes: 8 additions & 6 deletions Samples/iOS-Swift/iOS-Swift.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1071,8 +1071,9 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = "iOS-Swift/iOS-Swift.entitlements";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 97JCY7859U;
INFOPLIST_FILE = "iOS-Swift/Info.plist";
Expand All @@ -1084,7 +1085,8 @@
MARKETING_VERSION = 7.25.1;
PRODUCT_BUNDLE_IDENTIFIER = "io.sentry.sample.iOS-Swift";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
PROVISIONING_PROFILE_SPECIFIER = "match Development io.sentry.sample.iOS-Swift";
"PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = "";
SUPPORTS_MACCATALYST = YES;
SWIFT_OBJC_BRIDGING_HEADER = "iOS-Swift/Tools/iOS-Swift-Bridging-Header.h";
SWIFT_VERSION = 5.0;
Expand Down Expand Up @@ -1289,8 +1291,8 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = "iOS-SwiftClip/iOS_SwiftClip.entitlements";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 97JCY7859U;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -1311,7 +1313,7 @@
MARKETING_VERSION = 7.25.1;
PRODUCT_BUNDLE_IDENTIFIER = "io.sentry.sample.iOS-Swift.Clip";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
PROVISIONING_PROFILE_SPECIFIER = "match Development io.sentry.sample.iOS-Swift.Clip";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down
9 changes: 7 additions & 2 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,17 @@ platform :ios do
force: true
)

sync_code_signing(
type: "development",
readonly: true,
app_identifier: ["io.sentry.sample.iOS-Swift", "io.sentry.sample.iOS-Swift.Clip"]
)

build_app(
workspace: "Sentry.xcworkspace",
scheme: "iOS-Swift",
derived_data_path: "DerivedData",
skip_archive: true,
skip_codesigning: true
skip_archive: true
)

delete_keychain(name: "fastlane_tmp_keychain") unless is_ci
Expand Down

0 comments on commit 5025d2e

Please sign in to comment.