From 96f0688c5a1e6ef029d570651e52b430be4ecd42 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 | 252 +++++++++--------- StreamVideo.xcodeproj/project.pbxproj | 204 ++++++++++++-- .../StreamVideoUnifiedTests.xcscheme | 114 ++++++++ .../StreamVideoUnifiedTests.xctestplan | 49 ++++ fastlane/Fastfile | 37 ++- 5 files changed, 507 insertions(+), 149 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 5ce788024..a7884e609 100644 --- a/.github/workflows/smoke-checks.yml +++ b/.github/workflows/smoke-checks.yml @@ -46,7 +46,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 @@ -85,71 +85,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 @@ -194,14 +194,8 @@ 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 SDKs + run: bundle exec fastlane test_unified device:"iPhone 15" build_for_testing:true - name: Build XCFrameworks run: bundle exec fastlane build_xcframeworks timeout-minutes: 40 @@ -212,7 +206,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 @@ -277,58 +271,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) + 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/* diff --git a/StreamVideo.xcodeproj/project.pbxproj b/StreamVideo.xcodeproj/project.pbxproj index bbeb87d58..79c72d6a5 100644 --- a/StreamVideo.xcodeproj/project.pbxproj +++ b/StreamVideo.xcodeproj/project.pbxproj @@ -178,6 +178,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 */; }; @@ -1258,6 +1261,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 */; @@ -1548,6 +1572,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 = ""; }; @@ -2483,6 +2509,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; @@ -3057,6 +3093,14 @@ path = AsyncImage; sourceTree = ""; }; + 4050B43D2CEE50A600691C24 /* StreamVideoUnifiedTests */ = { + isa = PBXGroup; + children = ( + 4050B43F2CEE5ABD00691C24 /* StreamVideoUnifiedTests.xctestplan */, + ); + path = StreamVideoUnifiedTests; + sourceTree = ""; + }; 4063033D2AD847E60091AE77 /* CallState */ = { isa = PBXGroup; children = ( @@ -4472,6 +4516,7 @@ 842D8BBA2865B31B00801910 = { isa = PBXGroup; children = ( + 4050B43D2CEE50A600691C24 /* StreamVideoUnifiedTests */, 8427FF652A03D1D100AFD2C3 /* CallIntent */, 842D8BD42865B37800801910 /* DemoApp */, 8493224D2908378A0013C029 /* DemoAppUIKit */, @@ -4502,6 +4547,7 @@ 82392D512993C9E100941435 /* SwiftUIDemoAppUITests.xctest */, 8427FF622A03D1D100AFD2C3 /* CallIntent.appex */, 848C46A22A6ABF7E00E5AC09 /* ScreenSharing.appex */, + 4050B4312CEE509200691C24 /* StreamVideoUnifiedTests.xctest */, ); name = Products; sourceTree = ""; @@ -5528,6 +5574,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" */; @@ -5786,9 +5856,12 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = 1; - LastSwiftUpdateCheck = 1430; + LastSwiftUpdateCheck = 1610; LastUpgradeCheck = 1530; TargetAttributes = { + 4050B4302CEE509200691C24 = { + CreatedOnToolsVersion = 16.1; + }; 82392D502993C9E100941435 = { CreatedOnToolsVersion = 14.2; TestTargetID = 842D8BC22865B31B00801910; @@ -5863,11 +5936,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; @@ -6010,6 +6091,13 @@ /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + 4050B42D2CEE509200691C24 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 82392D4D2993C9E100941435 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -7249,6 +7337,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 */; @@ -7349,6 +7452,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 = { @@ -7460,7 +7624,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; @@ -7482,7 +7645,6 @@ 820EB3142A7A8A56009FDCA5 /* Test */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; BUILD_LIBRARY_FOR_DISTRIBUTION = NO; CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; @@ -7521,7 +7683,6 @@ 820EB3152A7A8A56009FDCA5 /* Test */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = EHV7XZLAHA; @@ -7540,7 +7701,6 @@ 820EB3162A7A8A56009FDCA5 /* Test */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; BUILD_LIBRARY_FOR_DISTRIBUTION = NO; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = ""; @@ -7579,7 +7739,6 @@ 820EB3172A7A8A56009FDCA5 /* Test */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = EHV7XZLAHA; @@ -7599,7 +7758,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"; @@ -8017,7 +8175,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"; @@ -8066,7 +8223,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"; @@ -8368,7 +8524,6 @@ 84F73800287C13AD00A363F4 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = EHV7XZLAHA; @@ -8387,7 +8542,6 @@ 84F73801287C13AD00A363F4 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = EHV7XZLAHA; @@ -8405,7 +8559,6 @@ 84F7381D287C141000A363F4 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; BUILD_LIBRARY_FOR_DISTRIBUTION = NO; CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; @@ -8445,7 +8598,6 @@ 84F7381E287C141000A363F4 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; BUILD_LIBRARY_FOR_DISTRIBUTION = NO; CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; @@ -8483,7 +8635,6 @@ 84F73821287C141000A363F4 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = EHV7XZLAHA; @@ -8502,7 +8653,6 @@ 84F73822287C141000A363F4 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = EHV7XZLAHA; @@ -8521,7 +8671,6 @@ 84F73838287C146D00A363F4 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; BUILD_LIBRARY_FOR_DISTRIBUTION = NO; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = ""; @@ -8561,7 +8710,6 @@ 84F73839287C146D00A363F4 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; BUILD_LIBRARY_FOR_DISTRIBUTION = NO; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = ""; @@ -8599,7 +8747,6 @@ 84F7383B287C146D00A363F4 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = EHV7XZLAHA; @@ -8618,7 +8765,6 @@ 84F7383C287C146D00A363F4 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = EHV7XZLAHA; @@ -8636,6 +8782,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 = ( @@ -8854,6 +9010,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/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/fastlane/Fastfile b/fastlane/Fastfile index 70022d8be..276888137 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) @@ -505,7 +539,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