From a8ca543ea55314c8097806304ad4a95ae6767db4 Mon Sep 17 00:00:00 2001 From: Ilias Pavlidakis Date: Wed, 20 Nov 2024 19:35:00 +0200 Subject: [PATCH] Add unified tests scheme --- .github/workflows/smoke-checks.yml | 335 +++++++++++------- StreamVideo.xcodeproj/project.pbxproj | 204 ++++++++++- .../StreamVideoUnifiedTests.xcscheme | 114 ++++++ .../StreamVideoSwiftUI.xctestplan | 1 + .../StreamVideoUnifiedTests.xctestplan | 49 +++ .../SwiftUIDemoApp.xctestplan | 1 + fastlane/Fastfile | 71 +++- 7 files changed, 615 insertions(+), 160 deletions(-) create mode 100644 StreamVideo.xcodeproj/xcshareddata/xcschemes/StreamVideoUnifiedTests.xcscheme create mode 100644 StreamVideoUnifiedTests/StreamVideoUnifiedTests.xctestplan diff --git a/.github/workflows/smoke-checks.yml b/.github/workflows/smoke-checks.yml index 79195458e..cc21dd04d 100644 --- a/.github/workflows/smoke-checks.yml +++ b/.github/workflows/smoke-checks.yml @@ -45,7 +45,7 @@ jobs: INSTALL_YEETD: true SKIP_MINT_BOOTSTRAP: true - name: Run LLC Tests (Debug) - run: bundle exec fastlane test device:"${{ env.IOS_SIMULATOR_DEVICE }}" + run: bundle exec fastlane test_unified device:"${{ env.IOS_SIMULATOR_DEVICE }}" timeout-minutes: 40 env: XCODE_VERSION: "15.2" # the most stable pair of Xcode @@ -84,71 +84,71 @@ jobs: fastlane/test_output/logs/*/Diagnostics/**/*.txt fastlane/test_output/logs/*/Diagnostics/simctl_diagnostics/DiagnosticReports/* - test-swiftui-debug: - name: Test SwiftUI (Debug) - runs-on: macos-14 - needs: test-llc-debug - if: ${{ github.event_name != 'push' && github.event.inputs.swiftui_snapshots != 'false' }} - env: - GITHUB_TOKEN: ${{ secrets.CI_BOT_GITHUB_TOKEN }} # to open a PR - steps: - - uses: actions/checkout@v4.1.1 - - uses: ./.github/actions/bootstrap - env: - INSTALL_YEETD: true - SKIP_MINT_BOOTSTRAP: true - SKIP_BREW_BOOTSTRAP: true - - name: Run UI Tests (Debug) - run: bundle exec fastlane test_swiftui device:"${{ env.IOS_SIMULATOR_DEVICE }}" record:${{ github.event.inputs.swiftui_snapshots }} - timeout-minutes: 40 - env: - XCODE_VERSION: "15.2" # the most stable pair of Xcode - IOS_SIMULATOR_DEVICE: "iPhone 15 Pro (17.2)" # and iOS - - name: Parse xcresult - if: failure() - run: | - brew install chargepoint/xcparse/xcparse - xcparse screenshots fastlane/test_output/StreamVideoSwiftUI.xcresult fastlane/test_output/snapshots --test - - uses: actions/upload-artifact@v4 - if: failure() - with: - name: SwiftUI Test Data - path: | - ~/Library/Logs/scan - fastlane/test_output/snapshots + # test-swiftui-debug: + # name: Test SwiftUI (Debug) + # runs-on: macos-14 + # needs: test-llc-debug + # if: ${{ github.event_name != 'push' && github.event.inputs.swiftui_snapshots != 'false' }} + # env: + # GITHUB_TOKEN: ${{ secrets.CI_BOT_GITHUB_TOKEN }} # to open a PR + # steps: + # - uses: actions/checkout@v4.1.1 + # - uses: ./.github/actions/bootstrap + # env: + # INSTALL_YEETD: true + # SKIP_MINT_BOOTSTRAP: true + # SKIP_BREW_BOOTSTRAP: true + # - name: Run UI Tests (Debug) + # run: bundle exec fastlane test_swiftui device:"${{ env.IOS_SIMULATOR_DEVICE }}" record:${{ github.event.inputs.swiftui_snapshots }} + # timeout-minutes: 40 + # env: + # XCODE_VERSION: "15.2" # the most stable pair of Xcode + # IOS_SIMULATOR_DEVICE: "iPhone 15 Pro (17.2)" # and iOS + # - name: Parse xcresult + # if: failure() + # run: | + # brew install chargepoint/xcparse/xcparse + # xcparse screenshots fastlane/test_output/StreamVideoSwiftUI.xcresult fastlane/test_output/snapshots --test + # - uses: actions/upload-artifact@v4 + # if: failure() + # with: + # name: SwiftUI Test Data + # path: | + # ~/Library/Logs/scan + # fastlane/test_output/snapshots - test-uikit-debug: - name: Test UIKit (Debug) - runs-on: macos-14 - needs: test-swiftui-debug - if: ${{ github.event_name != 'push' && github.event.inputs.uikit_snapshots != 'false' }} - env: - GITHUB_TOKEN: ${{ secrets.CI_BOT_GITHUB_TOKEN }} # to open a PR - steps: - - uses: actions/checkout@v4.1.1 - - uses: ./.github/actions/bootstrap - env: - INSTALL_YEETD: true - SKIP_MINT_BOOTSTRAP: true - SKIP_BREW_BOOTSTRAP: true - - name: Run UI Tests (Debug) - run: bundle exec fastlane test_uikit device:"${{ env.IOS_SIMULATOR_DEVICE }}" record:${{ github.event.inputs.uikit_snapshots }} - timeout-minutes: 40 - env: - XCODE_VERSION: "15.2" # the most stable pair of Xcode - IOS_SIMULATOR_DEVICE: "iPhone 15 Pro (17.2)" # and iOS - - name: Parse xcresult - if: failure() - run: | - brew install chargepoint/xcparse/xcparse - xcparse screenshots fastlane/test_output/StreamVideoUIKit.xcresult fastlane/test_output/snapshots --test - - uses: actions/upload-artifact@v4 - if: failure() - with: - name: UIKit Test Data - path: | - ~/Library/Logs/scan - fastlane/test_output/snapshots + # test-uikit-debug: + # name: Test UIKit (Debug) + # runs-on: macos-14 + # needs: test-swiftui-debug + # if: ${{ github.event_name != 'push' && github.event.inputs.uikit_snapshots != 'false' }} + # env: + # GITHUB_TOKEN: ${{ secrets.CI_BOT_GITHUB_TOKEN }} # to open a PR + # steps: + # - uses: actions/checkout@v4.1.1 + # - uses: ./.github/actions/bootstrap + # env: + # INSTALL_YEETD: true + # SKIP_MINT_BOOTSTRAP: true + # SKIP_BREW_BOOTSTRAP: true + # - name: Run UI Tests (Debug) + # run: bundle exec fastlane test_uikit device:"${{ env.IOS_SIMULATOR_DEVICE }}" record:${{ github.event.inputs.uikit_snapshots }} + # timeout-minutes: 40 + # env: + # XCODE_VERSION: "15.2" # the most stable pair of Xcode + # IOS_SIMULATOR_DEVICE: "iPhone 15 Pro (17.2)" # and iOS + # - name: Parse xcresult + # if: failure() + # run: | + # brew install chargepoint/xcparse/xcparse + # xcparse screenshots fastlane/test_output/StreamVideoUIKit.xcresult fastlane/test_output/snapshots --test + # - uses: actions/upload-artifact@v4 + # if: failure() + # with: + # name: UIKit Test Data + # path: | + # ~/Library/Logs/scan + # fastlane/test_output/snapshots automated-code-review: name: Automated Code Review @@ -174,7 +174,6 @@ jobs: build-xcode15: name: Build SDKs (Xcode 15.0) runs-on: macos-13 - needs: test-llc-debug if: ${{ github.event_name != 'push' && github.event.inputs.snapshots != 'true' }} env: XCODE_VERSION: "15.0.1" @@ -193,17 +192,83 @@ jobs: - uses: ./.github/actions/ruby-cache - name: List Xcode versions run: mdfind "kMDItemCFBundleIdentifier = 'com.apple.dt.Xcode'" - - name: Build LLC - run: bundle exec fastlane test device:"iPhone 15" build_for_testing:true - timeout-minutes: 40 - - name: Build SwiftUI - run: bundle exec fastlane test_swiftui device:"iPhone 15" build_for_testing:true - - name: Build UIKit - run: bundle exec fastlane test_uikit device:"iPhone 15" build_for_testing:true - timeout-minutes: 40 - - name: Build XCFrameworks - run: bundle exec fastlane build_xcframeworks - timeout-minutes: 40 + - name: Build SDKs + run: bundle exec fastlane test_unified device:"iPhone 15" build_for_testing:true + + build-xcode15-xcframework-stream-video: + name: Build StreamVideo XCframework (Xcode 15.0) + needs: build-xcode15 + runs-on: macos-13 + if: ${{ github.event_name != 'push' && github.event.inputs.snapshots != 'true' }} + env: + XCODE_VERSION: "15.0.1" + steps: + - name: Connect Bot + uses: webfactory/ssh-agent@v0.7.0 + with: + ssh-private-key: ${{ secrets.BOT_SSH_PRIVATE_KEY }} + - uses: actions/checkout@v3.1.0 + - name: Cache Xcode Derived Data + uses: irgaly/xcode-cache@v1 + with: + key: xcode-15-cache-deriveddata-${{ github.workflow }}-${{ github.sha }} + deriveddata-directory: derived_data + sourcepackages-directory: spm_cache + - uses: ./.github/actions/ruby-cache + - name: Build StreamVideo XCFramework + run: bundle exec fastlane build_xcframeworks_concurrent scheme:"StreamVideo" + env: + MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} + APPSTORE_API_KEY: ${{ secrets.APPSTORE_API_KEY }} + + build-xcode15-xcframework-stream-video-swiftui: + name: Build StreamVideoSwiftUI XCframework (Xcode 15.0) + needs: build-xcode15 + runs-on: macos-13 + if: ${{ github.event_name != 'push' && github.event.inputs.snapshots != 'true' }} + env: + XCODE_VERSION: "15.0.1" + steps: + - name: Connect Bot + uses: webfactory/ssh-agent@v0.7.0 + with: + ssh-private-key: ${{ secrets.BOT_SSH_PRIVATE_KEY }} + - uses: actions/checkout@v3.1.0 + - name: Cache Xcode Derived Data + uses: irgaly/xcode-cache@v1 + with: + key: xcode-15-cache-deriveddata-${{ github.workflow }}-${{ github.sha }} + deriveddata-directory: derived_data + sourcepackages-directory: spm_cache + - uses: ./.github/actions/ruby-cache + - name: Build StreamVideo XCFramework + run: bundle exec fastlane build_xcframeworks_concurrent scheme:"StreamVideoSwiftUI" + env: + MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} + APPSTORE_API_KEY: ${{ secrets.APPSTORE_API_KEY }} + + build-xcode15-xcframework-stream-video-uikit: + name: Build StreamVideoUIKit XCframework (Xcode 15.0) + needs: build-xcode15 + runs-on: macos-13 + if: ${{ github.event_name != 'push' && github.event.inputs.snapshots != 'true' }} + env: + XCODE_VERSION: "15.0.1" + steps: + - name: Connect Bot + uses: webfactory/ssh-agent@v0.7.0 + with: + ssh-private-key: ${{ secrets.BOT_SSH_PRIVATE_KEY }} + - uses: actions/checkout@v3.1.0 + - name: Cache Xcode Derived Data + uses: irgaly/xcode-cache@v1 + with: + key: xcode-15-cache-deriveddata-${{ github.workflow }}-${{ github.sha }} + deriveddata-directory: derived_data + sourcepackages-directory: spm_cache + - uses: ./.github/actions/ruby-cache + - name: Build StreamVideo XCFramework + run: bundle exec fastlane build_xcframeworks_concurrent scheme:"StreamVideoUIKit" env: MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} APPSTORE_API_KEY: ${{ secrets.APPSTORE_API_KEY }} @@ -211,7 +276,7 @@ jobs: build-test-app-and-frameworks: name: Build Test App and Frameworks runs-on: macos-14 - needs: test-uikit-debug + needs: test-llc-debug if: ${{ github.event_name != 'push' && github.event.inputs.swiftui_snapshots != 'true' && github.event.inputs.uikit_snapshots != 'true' }} steps: - uses: actions/checkout@v4.1.1 @@ -236,8 +301,6 @@ jobs: INSTALL_YEETD: true SKIP_MINT_BOOTSTRAP: true SKIP_BREW_BOOTSTRAP: true - - name: Build SwiftUI Demo App - run: bundle exec fastlane build_swiftui_demo - name: Build UIKit Demo App run: bundle exec fastlane build_uikit_demo - name: Build Docs Test Project @@ -246,7 +309,7 @@ jobs: cache-update: name: Update cache runs-on: macos-14 - needs: build-apps + needs: build-test-app-and-frameworks steps: - uses: irgaly/xcode-cache@v1 with: @@ -276,58 +339,58 @@ jobs: run: echo "launch_id=${{env.LAUNCH_ID}}" >> $GITHUB_OUTPUT if: env.LAUNCH_ID != '' - # test-e2e-debug: - # name: Test E2E UI (Debug) - # runs-on: macos-14 - # if: ${{ github.event_name != 'push' && github.event.inputs.swiftui_snapshots != 'true' && github.event.inputs.uikit_snapshots != 'true' }} - # needs: allure_testops_launch - # env: - # LAUNCH_ID: ${{ needs.allure_testops_launch.outputs.launch_id }} - # ALLURE_TOKEN: ${{ secrets.ALLURE_TOKEN }} - # strategy: - # matrix: - # batch: [0, 1] - # fail-fast: false - # steps: - # - uses: actions/checkout@v4.1.1 - # - uses: ./.github/actions/bootstrap - # env: - # INSTALL_ALLURE: true - # INSTALL_VIDEO_BUDDY: true - # INSTALL_YEETD: true - # SKIP_MINT_BOOTSTRAP: true - # SKIP_BREW_BOOTSTRAP: true - # - name: Run UI Tests (Debug) - # run: bundle exec fastlane test_e2e device:"${{ env.IOS_SIMULATOR_DEVICE }}" batch:'${{ matrix.batch }}' test_without_building:true - # timeout-minutes: 60 - # env: - # XCODE_VERSION: "15.2" # the most stable pair of Xcode - # IOS_SIMULATOR_DEVICE: "iPhone 15 Pro (17.2)" # and iOS - # MATRIX_SIZE: ${{ strategy.job-total }} - # STREAM_SDK_TEST_APP: ${{ secrets.STREAM_SDK_TEST_APP }} - # STREAM_SDK_TEST_ACCOUNT_EMAIL: ${{ secrets.STREAM_SDK_TEST_ACCOUNT_EMAIL }} - # STREAM_SDK_TEST_ACCOUNT_PASSWORD: ${{ secrets.STREAM_SDK_TEST_ACCOUNT_PASSWORD }} - # STREAM_SDK_TEST_ACCOUNT_OTP_SECRET: ${{ secrets.STREAM_SDK_TEST_ACCOUNT_OTP_SECRET }} - # STREAM_VIDEO_SECRET: ${{ secrets.STREAM_VIDEO_SECRET }} - # - name: Allure TestOps Upload - # if: env.LAUNCH_ID != '' && (success() || failure()) - # run: bundle exec fastlane allure_upload launch_id:$LAUNCH_ID - # - name: Allure TestOps Launch Removal - # if: env.LAUNCH_ID != '' && cancelled() - # run: bundle exec fastlane allure_launch_removal launch_id:$LAUNCH_ID - # - name: Parse xcresult - # if: failure() - # run: | - # brew install chargepoint/xcparse/xcparse - # xcparse logs fastlane/test_output/DemoApp.xcresult fastlane/test_output/logs/ - # - uses: actions/upload-artifact@v4 - # if: failure() - # with: - # name: E2E Test Data ${{ matrix.batch }} - # path: | - # ~/Library/Logs/scan - # fastlane/recordings - # fastlane/*.log - # fastlane/test_output/report.junit - # fastlane/test_output/logs/*/Diagnostics/**/*.txt - # fastlane/test_output/logs/*/Diagnostics/simctl_diagnostics/DiagnosticReports/* + test-e2e-debug: + name: Test E2E UI (Debug) + needs: allure_testops_launch + runs-on: macos-14 + if: ${{ github.event_name != 'push' && github.event.inputs.swiftui_snapshots != 'true' && github.event.inputs.uikit_snapshots != 'true' }} + env: + LAUNCH_ID: ${{ needs.allure_testops_launch.outputs.launch_id }} + ALLURE_TOKEN: ${{ secrets.ALLURE_TOKEN }} + # strategy: + # matrix: + # batch: [0, 1] + # fail-fast: false + steps: + - uses: actions/checkout@v4.1.1 + - uses: ./.github/actions/bootstrap + env: + INSTALL_ALLURE: true + INSTALL_VIDEO_BUDDY: true + INSTALL_YEETD: true + SKIP_MINT_BOOTSTRAP: true + SKIP_BREW_BOOTSTRAP: true + - name: Run UI Tests (Debug) + run: bundle exec fastlane test_e2e device:"${{ env.IOS_SIMULATOR_DEVICE }}" batch:'${{ matrix.batch }}' test_without_building:false + timeout-minutes: 60 + env: + XCODE_VERSION: "15.2" # the most stable pair of Xcode + IOS_SIMULATOR_DEVICE: "iPhone 15 Pro (17.2)" # and iOS + MATRIX_SIZE: ${{ strategy.job-total }} + STREAM_SDK_TEST_APP: ${{ secrets.STREAM_SDK_TEST_APP }} + STREAM_SDK_TEST_ACCOUNT_EMAIL: ${{ secrets.STREAM_SDK_TEST_ACCOUNT_EMAIL }} + STREAM_SDK_TEST_ACCOUNT_PASSWORD: ${{ secrets.STREAM_SDK_TEST_ACCOUNT_PASSWORD }} + STREAM_SDK_TEST_ACCOUNT_OTP_SECRET: ${{ secrets.STREAM_SDK_TEST_ACCOUNT_OTP_SECRET }} + STREAM_VIDEO_SECRET: ${{ secrets.STREAM_VIDEO_SECRET }} + - name: Allure TestOps Upload + if: env.LAUNCH_ID != '' && (success() || failure()) + run: bundle exec fastlane allure_upload launch_id:$LAUNCH_ID + - name: Allure TestOps Launch Removal + if: env.LAUNCH_ID != '' && cancelled() + run: bundle exec fastlane allure_launch_removal launch_id:$LAUNCH_ID + - name: Parse xcresult + if: failure() + run: | + brew install chargepoint/xcparse/xcparse + xcparse logs fastlane/test_output/DemoApp.xcresult fastlane/test_output/logs/ + - uses: actions/upload-artifact@v4 + if: failure() + with: + name: E2E Test Data ${{ matrix.batch }} + path: | + ~/Library/Logs/scan + fastlane/recordings + fastlane/*.log + fastlane/test_output/report.junit + fastlane/test_output/logs/*/Diagnostics/**/*.txt + fastlane/test_output/logs/*/Diagnostics/simctl_diagnostics/DiagnosticReports/* diff --git a/StreamVideo.xcodeproj/project.pbxproj b/StreamVideo.xcodeproj/project.pbxproj index cdfda69aa..967ceda4c 100644 --- a/StreamVideo.xcodeproj/project.pbxproj +++ b/StreamVideo.xcodeproj/project.pbxproj @@ -184,6 +184,9 @@ 404C27CB2BF2552800DF2937 /* XCTestCase+PredicateFulfillment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 409CA7982BEE21720045F7AA /* XCTestCase+PredicateFulfillment.swift */; }; 404C27CC2BF2552900DF2937 /* XCTestCase+PredicateFulfillment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 409CA7982BEE21720045F7AA /* XCTestCase+PredicateFulfillment.swift */; }; 404CAEE72B8F48F6007087BC /* DemoBackgroundEffectSelector.swift in Sources */ = {isa = PBXBuildFile; fileRef = 40A0E95F2B88ABC80089E8D3 /* DemoBackgroundEffectSelector.swift */; }; + 4050B4352CEE509200691C24 /* StreamVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84F737ED287C13AC00A363F4 /* StreamVideo.framework */; }; + 4050B4412CEE5BDE00691C24 /* StreamSwiftTestHelpers in Frameworks */ = {isa = PBXBuildFile; productRef = 4050B4402CEE5BDE00691C24 /* StreamSwiftTestHelpers */; }; + 4050B4432CEE5BDE00691C24 /* StreamWebRTC in Frameworks */ = {isa = PBXBuildFile; productRef = 4050B4422CEE5BDE00691C24 /* StreamWebRTC */; }; 4059C3422AAF0CE40006928E /* DemoChatViewModel+Injection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4059C3412AAF0CE40006928E /* DemoChatViewModel+Injection.swift */; }; 4063033F2AD847EC0091AE77 /* CallState_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4063033E2AD847EC0091AE77 /* CallState_Tests.swift */; }; 406303422AD848000091AE77 /* CallParticipant_Mock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 406303412AD848000091AE77 /* CallParticipant_Mock.swift */; }; @@ -1264,6 +1267,27 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + 4050B4362CEE509200691C24 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 842D8BBB2865B31B00801910 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 84F737EC287C13AC00A363F4; + remoteInfo = StreamVideo; + }; + 4050B4442CEE5BEB00691C24 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 842D8BBB2865B31B00801910 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 84F73806287C141000A363F4; + remoteInfo = StreamVideoSwiftUI; + }; + 4050B4462CEE5BEB00691C24 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 842D8BBB2865B31B00801910 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 84F73827287C146D00A363F4; + remoteInfo = StreamVideoUIKit; + }; 40C4DF542C1C60A80035DBC2 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 842D8BBB2865B31B00801910 /* Project object */; @@ -1560,6 +1584,8 @@ 4049CE812BBBF74C003D07D2 /* LegacyAsyncImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LegacyAsyncImage.swift; sourceTree = ""; }; 4049CE832BBBF8EF003D07D2 /* StreamAsyncImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StreamAsyncImage.swift; sourceTree = ""; }; 404A5CFA2AD5648100EF1C62 /* DemoChatModifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DemoChatModifier.swift; sourceTree = ""; }; + 4050B4312CEE509200691C24 /* StreamVideoUnifiedTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = StreamVideoUnifiedTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 4050B43F2CEE5ABD00691C24 /* StreamVideoUnifiedTests.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = StreamVideoUnifiedTests.xctestplan; sourceTree = ""; }; 4059C3412AAF0CE40006928E /* DemoChatViewModel+Injection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "DemoChatViewModel+Injection.swift"; sourceTree = ""; }; 4063033E2AD847EC0091AE77 /* CallState_Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CallState_Tests.swift; sourceTree = ""; }; 406303412AD848000091AE77 /* CallParticipant_Mock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CallParticipant_Mock.swift; sourceTree = ""; }; @@ -2495,6 +2521,16 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 4050B42E2CEE509200691C24 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 4050B4412CEE5BDE00691C24 /* StreamSwiftTestHelpers in Frameworks */, + 4050B4432CEE5BDE00691C24 /* StreamWebRTC in Frameworks */, + 4050B4352CEE509200691C24 /* StreamVideo.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 82392D4E2993C9E100941435 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -3096,6 +3132,14 @@ path = AsyncImage; sourceTree = ""; }; + 4050B43D2CEE50A600691C24 /* StreamVideoUnifiedTests */ = { + isa = PBXGroup; + children = ( + 4050B43F2CEE5ABD00691C24 /* StreamVideoUnifiedTests.xctestplan */, + ); + path = StreamVideoUnifiedTests; + sourceTree = ""; + }; 4063033D2AD847E60091AE77 /* CallState */ = { isa = PBXGroup; children = ( @@ -4513,6 +4557,7 @@ 842D8BBA2865B31B00801910 = { isa = PBXGroup; children = ( + 4050B43D2CEE50A600691C24 /* StreamVideoUnifiedTests */, 8427FF652A03D1D100AFD2C3 /* CallIntent */, 842D8BD42865B37800801910 /* DemoApp */, 8493224D2908378A0013C029 /* DemoAppUIKit */, @@ -4543,6 +4588,7 @@ 82392D512993C9E100941435 /* SwiftUIDemoAppUITests.xctest */, 8427FF622A03D1D100AFD2C3 /* CallIntent.appex */, 848C46A22A6ABF7E00E5AC09 /* ScreenSharing.appex */, + 4050B4312CEE509200691C24 /* StreamVideoUnifiedTests.xctest */, ); name = Products; sourceTree = ""; @@ -5570,6 +5616,30 @@ /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ + 4050B4302CEE509200691C24 /* StreamVideoUnifiedTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 4050B43B2CEE509200691C24 /* Build configuration list for PBXNativeTarget "StreamVideoUnifiedTests" */; + buildPhases = ( + 4050B42D2CEE509200691C24 /* Sources */, + 4050B42E2CEE509200691C24 /* Frameworks */, + 4050B42F2CEE509200691C24 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 4050B4452CEE5BEB00691C24 /* PBXTargetDependency */, + 4050B4472CEE5BEB00691C24 /* PBXTargetDependency */, + 4050B4372CEE509200691C24 /* PBXTargetDependency */, + ); + name = StreamVideoUnifiedTests; + packageProductDependencies = ( + 4050B4402CEE5BDE00691C24 /* StreamSwiftTestHelpers */, + 4050B4422CEE5BDE00691C24 /* StreamWebRTC */, + ); + productName = StreamVideoUnifiedTests; + productReference = 4050B4312CEE509200691C24 /* StreamVideoUnifiedTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; 82392D502993C9E100941435 /* SwiftUIDemoAppUITests */ = { isa = PBXNativeTarget; buildConfigurationList = 82392D5B2993C9E100941435 /* Build configuration list for PBXNativeTarget "SwiftUIDemoAppUITests" */; @@ -5828,9 +5898,12 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = 1; - LastSwiftUpdateCheck = 1430; + LastSwiftUpdateCheck = 1610; LastUpgradeCheck = 1530; TargetAttributes = { + 4050B4302CEE509200691C24 = { + CreatedOnToolsVersion = 16.1; + }; 82392D502993C9E100941435 = { CreatedOnToolsVersion = 14.2; TestTargetID = 842D8BC22865B31B00801910; @@ -5905,11 +5978,19 @@ 82392D502993C9E100941435 /* SwiftUIDemoAppUITests */, 8427FF612A03D1D100AFD2C3 /* CallIntent */, 848C46A12A6ABF7E00E5AC09 /* ScreenSharing */, + 4050B4302CEE509200691C24 /* StreamVideoUnifiedTests */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ + 4050B42F2CEE509200691C24 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 82392D4F2993C9E100941435 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -6052,6 +6133,13 @@ /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + 4050B42D2CEE509200691C24 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 82392D4D2993C9E100941435 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -7297,6 +7385,21 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + 4050B4372CEE509200691C24 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 84F737EC287C13AC00A363F4 /* StreamVideo */; + targetProxy = 4050B4362CEE509200691C24 /* PBXContainerItemProxy */; + }; + 4050B4452CEE5BEB00691C24 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 84F73806287C141000A363F4 /* StreamVideoSwiftUI */; + targetProxy = 4050B4442CEE5BEB00691C24 /* PBXContainerItemProxy */; + }; + 4050B4472CEE5BEB00691C24 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 84F73827287C146D00A363F4 /* StreamVideoUIKit */; + targetProxy = 4050B4462CEE5BEB00691C24 /* PBXContainerItemProxy */; + }; 40C4DF552C1C60A80035DBC2 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 84F737EC287C13AC00A363F4 /* StreamVideo */; @@ -7397,6 +7500,67 @@ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ + 4050B4382CEE509200691C24 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = EHV7XZLAHA; + GCC_C_LANGUAGE_STANDARD = gnu17; + GENERATE_INFOPLIST_FILE = YES; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = io.getsteram.StreamVideoUnifiedTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 4050B4392CEE509200691C24 /* Test */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = EHV7XZLAHA; + GCC_C_LANGUAGE_STANDARD = gnu17; + GENERATE_INFOPLIST_FILE = YES; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = io.getsteram.StreamVideoUnifiedTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Test; + }; + 4050B43A2CEE509200691C24 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = EHV7XZLAHA; + GCC_C_LANGUAGE_STANDARD = gnu17; + GENERATE_INFOPLIST_FILE = YES; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = io.getsteram.StreamVideoUnifiedTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; 820EB3112A7A8A56009FDCA5 /* Test */ = { isa = XCBuildConfiguration; buildSettings = { @@ -7508,7 +7672,6 @@ isa = XCBuildConfiguration; baseConfigurationReference = 8206D84F2A5DB9300099F5EC /* Credentials.xcconfig */; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = EHV7XZLAHA; @@ -7530,7 +7693,6 @@ 820EB3142A7A8A56009FDCA5 /* Test */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; BUILD_LIBRARY_FOR_DISTRIBUTION = NO; CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; @@ -7569,7 +7731,6 @@ 820EB3152A7A8A56009FDCA5 /* Test */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = EHV7XZLAHA; @@ -7588,7 +7749,6 @@ 820EB3162A7A8A56009FDCA5 /* Test */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; BUILD_LIBRARY_FOR_DISTRIBUTION = NO; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = ""; @@ -7627,7 +7787,6 @@ 820EB3172A7A8A56009FDCA5 /* Test */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = EHV7XZLAHA; @@ -7647,7 +7806,6 @@ isa = XCBuildConfiguration; baseConfigurationReference = 8206D84F2A5DB9300099F5EC /* Credentials.xcconfig */; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = "${TARGET_NAME}/Resources/Entitlements/${TARGET_NAME}-Debug.entitlements"; @@ -8065,7 +8223,6 @@ isa = XCBuildConfiguration; baseConfigurationReference = 8206D84F2A5DB9300099F5EC /* Credentials.xcconfig */; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = "${TARGET_NAME}/Resources/Entitlements/${TARGET_NAME}-Debug.entitlements"; @@ -8114,7 +8271,6 @@ 842D8BD32865B31D00801910 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = "${TARGET_NAME}/Resources/Entitlements/${TARGET_NAME}.entitlements"; @@ -8416,7 +8572,6 @@ 84F73800287C13AD00A363F4 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = EHV7XZLAHA; @@ -8435,7 +8590,6 @@ 84F73801287C13AD00A363F4 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = EHV7XZLAHA; @@ -8453,7 +8607,6 @@ 84F7381D287C141000A363F4 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; BUILD_LIBRARY_FOR_DISTRIBUTION = NO; CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; @@ -8493,7 +8646,6 @@ 84F7381E287C141000A363F4 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; BUILD_LIBRARY_FOR_DISTRIBUTION = NO; CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; @@ -8531,7 +8683,6 @@ 84F73821287C141000A363F4 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = EHV7XZLAHA; @@ -8550,7 +8701,6 @@ 84F73822287C141000A363F4 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = EHV7XZLAHA; @@ -8569,7 +8719,6 @@ 84F73838287C146D00A363F4 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; BUILD_LIBRARY_FOR_DISTRIBUTION = NO; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = ""; @@ -8609,7 +8758,6 @@ 84F73839287C146D00A363F4 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; BUILD_LIBRARY_FOR_DISTRIBUTION = NO; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = ""; @@ -8647,7 +8795,6 @@ 84F7383B287C146D00A363F4 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = EHV7XZLAHA; @@ -8666,7 +8813,6 @@ 84F7383C287C146D00A363F4 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = EHV7XZLAHA; @@ -8684,6 +8830,16 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 4050B43B2CEE509200691C24 /* Build configuration list for PBXNativeTarget "StreamVideoUnifiedTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 4050B4382CEE509200691C24 /* Debug */, + 4050B4392CEE509200691C24 /* Test */, + 4050B43A2CEE509200691C24 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 82392D5B2993C9E100941435 /* Build configuration list for PBXNativeTarget "SwiftUIDemoAppUITests" */ = { isa = XCConfigurationList; buildConfigurations = ( @@ -8902,6 +9058,16 @@ package = 4046DEEC2A9F404300CA6D2F /* XCRemoteSwiftPackageReference "GDPerformanceView-Swift" */; productName = "GDPerformanceView-Swift"; }; + 4050B4402CEE5BDE00691C24 /* StreamSwiftTestHelpers */ = { + isa = XCSwiftPackageProductDependency; + package = 40F445C32A9E1D91004BE3DA /* XCRemoteSwiftPackageReference "stream-chat-swift-test-helpers" */; + productName = StreamSwiftTestHelpers; + }; + 4050B4422CEE5BDE00691C24 /* StreamWebRTC */ = { + isa = XCSwiftPackageProductDependency; + package = 82EB8F552B0277730038B5A2 /* XCRemoteSwiftPackageReference "stream-video-swift-webrtc" */; + productName = StreamWebRTC; + }; 406303442AD942ED0091AE77 /* GoogleSignInSwift */ = { isa = XCSwiftPackageProductDependency; package = 844ADA612AD3F1AB00769F6A /* XCRemoteSwiftPackageReference "GoogleSignIn-iOS" */; diff --git a/StreamVideo.xcodeproj/xcshareddata/xcschemes/StreamVideoUnifiedTests.xcscheme b/StreamVideo.xcodeproj/xcshareddata/xcschemes/StreamVideoUnifiedTests.xcscheme new file mode 100644 index 000000000..721e04d26 --- /dev/null +++ b/StreamVideo.xcodeproj/xcshareddata/xcschemes/StreamVideoUnifiedTests.xcscheme @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/StreamVideoSwiftUITests/StreamVideoSwiftUI.xctestplan b/StreamVideoSwiftUITests/StreamVideoSwiftUI.xctestplan index 9fb437bd3..07088d4cf 100644 --- a/StreamVideoSwiftUITests/StreamVideoSwiftUI.xctestplan +++ b/StreamVideoSwiftUITests/StreamVideoSwiftUI.xctestplan @@ -13,6 +13,7 @@ }, "testTargets" : [ { + "parallelizable" : true, "target" : { "containerPath" : "container:StreamVideo.xcodeproj", "identifier" : "84F7380D287C141000A363F4", diff --git a/StreamVideoUnifiedTests/StreamVideoUnifiedTests.xctestplan b/StreamVideoUnifiedTests/StreamVideoUnifiedTests.xctestplan new file mode 100644 index 000000000..4d33a7d82 --- /dev/null +++ b/StreamVideoUnifiedTests/StreamVideoUnifiedTests.xctestplan @@ -0,0 +1,49 @@ +{ + "configurations" : [ + { + "id" : "D9252195-ABF5-4767-AA49-8D5CE0006C9A", + "name" : "Test Scheme Action", + "options" : { + "environmentVariableEntries" : [ + { + "key" : "STREAM_VIDEO_SECRET", + "value" : "$(STREAM_VIDEO_SECRET)" + } + ] + } + } + ], + "defaultOptions" : { + "targetForVariableExpansion" : { + "containerPath" : "container:StreamVideo.xcodeproj", + "identifier" : "84F737F3287C13AD00A363F4", + "name" : "StreamVideoTests" + } + }, + "testTargets" : [ + { + "parallelizable" : true, + "target" : { + "containerPath" : "container:StreamVideo.xcodeproj", + "identifier" : "84F737F3287C13AD00A363F4", + "name" : "StreamVideoTests" + } + }, + { + "parallelizable" : true, + "target" : { + "containerPath" : "container:StreamVideo.xcodeproj", + "identifier" : "84F7380D287C141000A363F4", + "name" : "StreamVideoSwiftUITests" + } + }, + { + "target" : { + "containerPath" : "container:StreamVideo.xcodeproj", + "identifier" : "84F7382E287C146D00A363F4", + "name" : "StreamVideoUIKitTests" + } + } + ], + "version" : 1 +} diff --git a/SwiftUIDemoAppUITests/SwiftUIDemoApp.xctestplan b/SwiftUIDemoAppUITests/SwiftUIDemoApp.xctestplan index fa8503f93..22e63fc05 100644 --- a/SwiftUIDemoAppUITests/SwiftUIDemoApp.xctestplan +++ b/SwiftUIDemoAppUITests/SwiftUIDemoApp.xctestplan @@ -24,6 +24,7 @@ }, "testTargets" : [ { + "parallelizable" : true, "target" : { "containerPath" : "container:StreamVideo.xcodeproj", "identifier" : "82392D502993C9E100941435", diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 60f1fabfb..6d09324d9 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -220,6 +220,40 @@ lane :build_test_app_and_frameworks do ) end +desc 'Runs Unified tests' +lane :test_unified do |options| + next unless is_check_required(sources: sources_matrix[:unit], force_check: @force_check) + + update_testplan_on_ci(path: "StreamVideoUnifiedTests/StreamVideoUnifiedTests.xctestplan") + + scan_options = { + project: xcode_project, + scheme: 'StreamVideoUnifiedTests', + testplan: 'StreamVideoUnifiedTests', + clean: is_localhost, + derived_data_path: derived_data_path, + cloned_source_packages_path: source_packages_path, + devices: options[:device], + number_of_retries: 3, + skip_build: options[:skip_build], + build_for_testing: options[:build_for_testing], + xcargs: is_ci ? "#{buildcache_xcargs} STREAM_VIDEO_SECRET=#{app_secret}" : buildcache_xcargs, + parallel_testing: true, + concurrent_workers: 4, + prelaunch_simulator: true + } + + begin + scan(scan_options) + rescue StandardError => e + UI.user_error!(e) unless options[:cron] + + failed_tests = retreive_failed_tests + UI.important("Re-running #{failed_tests.size} failed tests ⌛️") + scan(scan_options.merge(only_testing: failed_tests)) + end +end + desc 'Runs LLC tests' lane :test do |options| next unless is_check_required(sources: sources_matrix[:unit], force_check: @force_check) @@ -354,6 +388,27 @@ lane :restart_video_buddy do start_video_buddy end +lane :build_xcframeworks_concurrent do |options| + match_me + output_directory = File.absolute_path("#{Dir.pwd}/../Products") + team_id = File.read('Matchfile').match(/team_id\("(.*)"\)/)[1] + codesign = ["codesign --timestamp -v --sign 'Apple Distribution: Stream.io Inc (#{team_id})'"] + create_xcframework( + project: xcode_project, + scheme: options[:scheme], + destinations: ['iOS'], + include_BCSymbolMaps: true, + include_debug_symbols: true, + xcframework_output_directory: output_directory, + remove_xcarchives: true, + enable_bitcode: false + ) + sh('../Scripts/removeUnneededSymbols.sh', options[:scheme], output_directory) + codesign << lane_context[SharedValues::XCFRAMEWORK_OUTPUT_PATH] + remove_stream_video_module_shadow(output_directory: output_directory) + sh(codesign.join(' ')) # We need to sign all frameworks at once +end + lane :build_xcframeworks do match_me output_directory = File.absolute_path("#{Dir.pwd}/../Products") @@ -404,19 +459,24 @@ lane :test_e2e do |options| result_bundle: true, derived_data_path: derived_data_path, cloned_source_packages_path: source_packages_path, - clean: is_localhost, test_without_building: options[:test_without_building], build_for_testing: options[:build_for_testing], devices: options[:device], prelaunch_simulator: is_ci, number_of_retries: 3, + parallel_testing: true, + concurrent_workers: 4, xcargs: is_ci ? "#{buildcache_xcargs} STREAM_VIDEO_SECRET=#{app_secret}" : buildcache_xcargs } - if is_localhost + begin scan(scan_options) - else - parallelize_tests_on_ci(scan: scan_options, batch: options[:batch], cron: options[:cron]) + rescue StandardError => e + UI.user_error!(e) unless options[:cron] + + failed_tests = retreive_failed_tests + UI.important("Re-running #{failed_tests.size} failed tests ⌛️") + scan(scan_options.merge(only_testing: failed_tests)) end end @@ -505,7 +565,8 @@ private_lane :build_example_app do |options| scheme: options[:scheme], clean: is_localhost, configuration: 'Debug', - derived_data_path: options[:derived_data_path], + derived_data_path: derived_data_path, + # derived_data_path: options[:derived_data_path], cloned_source_packages_path: source_packages_path, xcargs: buildcache_xcargs, build_for_testing: true