From 155d9f7576081ce38c39d4eb34b9430c870f2b29 Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Tue, 14 May 2024 00:06:01 -0700 Subject: [PATCH 1/8] ci: use newer instance --- .github/workflows/functional-test.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/functional-test.yml b/.github/workflows/functional-test.yml index e5c1ebad9..8407ac4a6 100644 --- a/.github/workflows/functional-test.yml +++ b/.github/workflows/functional-test.yml @@ -8,11 +8,11 @@ jobs: env: CI: true _FORCE_LOGS: 1 - XCODE_VERSION: 13.4 - DEVICE_NAME: iPhone 11 - PLATFORM_VERSION: 15.5 - # https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md - runs-on: macos-12 + XCODE_VERSION: 15.3 + DEVICE_NAME: iPhone 15 Plus + PLATFORM_VERSION: 17.4 + # https://github.com/actions/runner-images/blob/main/images/macos/macos-14-Readme.md + runs-on: macos-14 steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 From 9deca13211e657f1014e26fd06a004e82794a5d3 Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Tue, 14 May 2024 00:23:45 -0700 Subject: [PATCH 2/8] Update functional-test.yml --- .github/workflows/functional-test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/functional-test.yml b/.github/workflows/functional-test.yml index 8407ac4a6..9b0c4f094 100644 --- a/.github/workflows/functional-test.yml +++ b/.github/workflows/functional-test.yml @@ -26,6 +26,8 @@ jobs: mkdir -p ./Resources/WebDriverAgent.bundle name: Install dev dependencies + - run: xcrun simctl list devices available + - run: | target_sim_id=$(xcrun simctl list devices available | grep "$DEVICE_NAME (" | cut -d "(" -f2 | cut -d ")" -f1) open -Fn "$(xcode-select -p)/Applications/Simulator.app" From 6eb704b0aac3f3bc1ab6fd67716686d38034fa26 Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Tue, 14 May 2024 00:50:38 -0700 Subject: [PATCH 3/8] Update functional-test.yml --- .github/workflows/functional-test.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/functional-test.yml b/.github/workflows/functional-test.yml index 9b0c4f094..fdda3d4fc 100644 --- a/.github/workflows/functional-test.yml +++ b/.github/workflows/functional-test.yml @@ -26,12 +26,12 @@ jobs: mkdir -p ./Resources/WebDriverAgent.bundle name: Install dev dependencies - - run: xcrun simctl list devices available - - - run: | - target_sim_id=$(xcrun simctl list devices available | grep "$DEVICE_NAME (" | cut -d "(" -f2 | cut -d ")" -f1) - open -Fn "$(xcode-select -p)/Applications/Simulator.app" - xcrun simctl bootstatus $target_sim_id -b + - uses: futureware-tech/simulator-action@v3 + with: + model: ${{ env.DEVICE_NAME }} + os: iOS + os_version: ${{ env.PLATFORM_VERSION }} + erase_before_boot: true name: Preboot Simulator - run: npm run e2e-test From 32454f1e19734b325a6c27a07bd834ac035bbb3d Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Tue, 14 May 2024 01:09:07 -0700 Subject: [PATCH 4/8] add matrix --- .github/workflows/functional-test.yml | 19 ++++++++++++++++--- WebDriverAgent.xcodeproj/project.pbxproj | 12 ++++++++---- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/.github/workflows/functional-test.yml b/.github/workflows/functional-test.yml index fdda3d4fc..a47b048fe 100644 --- a/.github/workflows/functional-test.yml +++ b/.github/workflows/functional-test.yml @@ -5,6 +5,17 @@ on: [pull_request] jobs: test: + strategy: + fail-fast: false + matrix: + test_targets: + - XCODE_VERSION: 15.3 + IOS_VERSION: 17.4 + IOS_MODEL: iPhone 15 Plus + - XCODE_VERSION: 14.3.1 + IOS_VERSION: 16.4 + IOS_MODEL: iPhone 14 Plus + env: CI: true _FORCE_LOGS: 1 @@ -20,7 +31,7 @@ jobs: node-version: lts/* - uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: "${{ env.XCODE_VERSION }}" + xcode-version:${{matrix.test_targets.XCODE_VERSION}} - run: | npm install mkdir -p ./Resources/WebDriverAgent.bundle @@ -28,10 +39,12 @@ jobs: - uses: futureware-tech/simulator-action@v3 with: - model: ${{ env.DEVICE_NAME }} + model: ${{matrix.test_targets.IOS_MODEL}} os: iOS - os_version: ${{ env.PLATFORM_VERSION }} + os_version: ${{matrix.test_targets.IOS_VERSION}} erase_before_boot: true + # to prevent unexpected shutdown failure error + shutdown_after_job: false name: Preboot Simulator - run: npm run e2e-test diff --git a/WebDriverAgent.xcodeproj/project.pbxproj b/WebDriverAgent.xcodeproj/project.pbxproj index db4465848..840412893 100644 --- a/WebDriverAgent.xcodeproj/project.pbxproj +++ b/WebDriverAgent.xcodeproj/project.pbxproj @@ -4200,12 +4200,13 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ANALYZER_NONNULL = YES; DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_TEAM = 47PCFA586Q; INFOPLIST_FILE = WebDriverAgentTests/IntegrationApp/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.facebook.IntegrationApp; + PRODUCT_BUNDLE_IDENTIFIER = com.kazucocoa.IntegrationApp; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; @@ -4216,13 +4217,14 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ANALYZER_NONNULL = YES; + DEVELOPMENT_TEAM = 47PCFA586Q; INFOPLIST_FILE = WebDriverAgentTests/IntegrationApp/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); ONLY_ACTIVE_ARCH = YES; - PRODUCT_BUNDLE_IDENTIFIER = com.facebook.IntegrationApp; + PRODUCT_BUNDLE_IDENTIFIER = com.kazucocoa.IntegrationApp; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; @@ -4271,6 +4273,7 @@ buildSettings = { CLANG_STATIC_ANALYZER_MODE = deep; DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_TEAM = 47PCFA586Q; ENABLE_TESTING_SEARCH_PATHS = YES; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = WebDriverAgentRunner/Info.plist; @@ -4287,7 +4290,7 @@ "$(inherited)", "-all_load", ); - PRODUCT_BUNDLE_IDENTIFIER = com.facebook.WebDriverAgentRunner; + PRODUCT_BUNDLE_IDENTIFIER = com.kazucocoa.WebDriverAgentRunner; PRODUCT_NAME = "$(TARGET_NAME)"; USES_XCTRUNNER = YES; WARNING_CFLAGS = ( @@ -4323,6 +4326,7 @@ baseConfigurationReference = EEE5CABF1C80361500CBBDD9 /* IOSSettings.xcconfig */; buildSettings = { CLANG_STATIC_ANALYZER_MODE = deep; + DEVELOPMENT_TEAM = 47PCFA586Q; ENABLE_TESTING_SEARCH_PATHS = YES; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = WebDriverAgentRunner/Info.plist; @@ -4340,7 +4344,7 @@ "$(inherited)", "-all_load", ); - PRODUCT_BUNDLE_IDENTIFIER = com.facebook.WebDriverAgentRunner; + PRODUCT_BUNDLE_IDENTIFIER = com.kazucocoa.WebDriverAgentRunner; PRODUCT_NAME = "$(TARGET_NAME)"; USES_XCTRUNNER = YES; WARNING_CFLAGS = ( From d59673dbf315c8cce861993930bc8a7b9ab3938f Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Tue, 14 May 2024 01:13:05 -0700 Subject: [PATCH 5/8] move env --- .github/workflows/functional-test.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/functional-test.yml b/.github/workflows/functional-test.yml index a47b048fe..b356b4417 100644 --- a/.github/workflows/functional-test.yml +++ b/.github/workflows/functional-test.yml @@ -16,12 +16,6 @@ jobs: IOS_VERSION: 16.4 IOS_MODEL: iPhone 14 Plus - env: - CI: true - _FORCE_LOGS: 1 - XCODE_VERSION: 15.3 - DEVICE_NAME: iPhone 15 Plus - PLATFORM_VERSION: 17.4 # https://github.com/actions/runner-images/blob/main/images/macos/macos-14-Readme.md runs-on: macos-14 steps: @@ -31,7 +25,7 @@ jobs: node-version: lts/* - uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version:${{matrix.test_targets.XCODE_VERSION}} + xcode-version: ${{matrix.test_targets.XCODE_VERSION}} - run: | npm install mkdir -p ./Resources/WebDriverAgent.bundle @@ -46,6 +40,11 @@ jobs: # to prevent unexpected shutdown failure error shutdown_after_job: false name: Preboot Simulator + env: + CI: true + _FORCE_LOGS: 1 + DEVICE_NAME: ${{matrix.test_targets.IOS_MODEL}} + PLATFORM_VERSION: ${{matrix.test_targets.IOS_VERSION}} - run: npm run e2e-test name: Run functional tests From e1b8910805f64680094bacc0575c0b7b1d7e54c3 Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Tue, 14 May 2024 01:15:05 -0700 Subject: [PATCH 6/8] revert project changes --- WebDriverAgent.xcodeproj/project.pbxproj | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/WebDriverAgent.xcodeproj/project.pbxproj b/WebDriverAgent.xcodeproj/project.pbxproj index 840412893..db4465848 100644 --- a/WebDriverAgent.xcodeproj/project.pbxproj +++ b/WebDriverAgent.xcodeproj/project.pbxproj @@ -4200,13 +4200,12 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ANALYZER_NONNULL = YES; DEBUG_INFORMATION_FORMAT = dwarf; - DEVELOPMENT_TEAM = 47PCFA586Q; INFOPLIST_FILE = WebDriverAgentTests/IntegrationApp/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.kazucocoa.IntegrationApp; + PRODUCT_BUNDLE_IDENTIFIER = com.facebook.IntegrationApp; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; @@ -4217,14 +4216,13 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ANALYZER_NONNULL = YES; - DEVELOPMENT_TEAM = 47PCFA586Q; INFOPLIST_FILE = WebDriverAgentTests/IntegrationApp/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); ONLY_ACTIVE_ARCH = YES; - PRODUCT_BUNDLE_IDENTIFIER = com.kazucocoa.IntegrationApp; + PRODUCT_BUNDLE_IDENTIFIER = com.facebook.IntegrationApp; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; @@ -4273,7 +4271,6 @@ buildSettings = { CLANG_STATIC_ANALYZER_MODE = deep; DEBUG_INFORMATION_FORMAT = dwarf; - DEVELOPMENT_TEAM = 47PCFA586Q; ENABLE_TESTING_SEARCH_PATHS = YES; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = WebDriverAgentRunner/Info.plist; @@ -4290,7 +4287,7 @@ "$(inherited)", "-all_load", ); - PRODUCT_BUNDLE_IDENTIFIER = com.kazucocoa.WebDriverAgentRunner; + PRODUCT_BUNDLE_IDENTIFIER = com.facebook.WebDriverAgentRunner; PRODUCT_NAME = "$(TARGET_NAME)"; USES_XCTRUNNER = YES; WARNING_CFLAGS = ( @@ -4326,7 +4323,6 @@ baseConfigurationReference = EEE5CABF1C80361500CBBDD9 /* IOSSettings.xcconfig */; buildSettings = { CLANG_STATIC_ANALYZER_MODE = deep; - DEVELOPMENT_TEAM = 47PCFA586Q; ENABLE_TESTING_SEARCH_PATHS = YES; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = WebDriverAgentRunner/Info.plist; @@ -4344,7 +4340,7 @@ "$(inherited)", "-all_load", ); - PRODUCT_BUNDLE_IDENTIFIER = com.kazucocoa.WebDriverAgentRunner; + PRODUCT_BUNDLE_IDENTIFIER = com.facebook.WebDriverAgentRunner; PRODUCT_NAME = "$(TARGET_NAME)"; USES_XCTRUNNER = YES; WARNING_CFLAGS = ( From 49e12ae41b24725b946670ad1ede9011db8889ad Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Tue, 14 May 2024 01:16:34 -0700 Subject: [PATCH 7/8] add cancel --- .github/workflows/functional-test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/functional-test.yml b/.github/workflows/functional-test.yml index b356b4417..5adf7c4c0 100644 --- a/.github/workflows/functional-test.yml +++ b/.github/workflows/functional-test.yml @@ -2,6 +2,9 @@ name: Functional Tests on: [pull_request] +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true jobs: test: From e5de3fc2ed4e6569012e7b6dbb5a85a8634a7a77 Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Tue, 14 May 2024 01:24:49 -0700 Subject: [PATCH 8/8] ci: fix env place --- .github/workflows/functional-test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/functional-test.yml b/.github/workflows/functional-test.yml index 5adf7c4c0..90bacdc9a 100644 --- a/.github/workflows/functional-test.yml +++ b/.github/workflows/functional-test.yml @@ -43,11 +43,11 @@ jobs: # to prevent unexpected shutdown failure error shutdown_after_job: false name: Preboot Simulator + + - run: npm run e2e-test + name: Run functional tests env: CI: true _FORCE_LOGS: 1 DEVICE_NAME: ${{matrix.test_targets.IOS_MODEL}} PLATFORM_VERSION: ${{matrix.test_targets.IOS_VERSION}} - - - run: npm run e2e-test - name: Run functional tests