From 9cc8d21a90b4df5e6f586a9889f60e6a624487e3 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Thu, 26 Oct 2023 11:30:34 +1100 Subject: [PATCH 1/5] Add placeholder step for Android E2E tests --- .buildkite/pipeline.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 447f6ea910..9bb59ca760 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -207,6 +207,19 @@ steps: - github_commit_status: context: Test iOS on Device - Canaries + - label: Android E2E Tests + command: | + echo "Hello, World!" + plugins: + - *ci_toolkit_plugin + - *nvm_plugin + - *git-cache-plugin + agents: + queue: android-staging + notify: + - github_commit_status: + context: Android E2E Tests + - block: "Full UI Tests" # Show only in branches that run the quick UI tests suite, to optionally run the full suite if: *is_branch_for_quick_ui_tests From cb2077810b684c2557bede57347a003013a881de Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Thu, 26 Oct 2023 11:39:03 +1100 Subject: [PATCH 2/5] Delete all the rest of the pipeline for faster feedback --- .buildkite/pipeline.yml | 248 ---------------------------------------- 1 file changed, 248 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 9bb59ca760..3e1b7866dd 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -33,180 +33,6 @@ x-common-params: build.branch != 'trunk' && build.branch !~ /^release.*/ && build.branch !~ /^dependabot\/submodules.*/ steps: - - label: Lint - key: lint - plugins: - - *gb-mobile-docker-container - - *git-cache-plugin - command: | - echo "--- :docker: Additional Docker image setup" - source /root/.bashrc - - echo "--- :docker::node: Setup Node environment" - nvm install && nvm use - - .buildkite/commands/lint.sh - notify: - - github_commit_status: - context: Lint - - - label: Android Unit Tests - key: android-unit-tests - plugins: - - *gb-mobile-docker-container - - *ci_toolkit_plugin - command: | - echo "--- :docker: Additional Docker image setup" - source /root/.bashrc - - echo "--- :docker::node: Setup Node environment" - nvm install && nvm use - - .buildkite/commands/unit-tests-android.sh - env: - JEST_JUNIT_OUTPUT_FILE: reports/test-results/android-test-results.xml - artifact_paths: - - ./logs/*.log - - ./reports/test-results/*.xml - notify: - - github_commit_status: - context: Android Unit Tests - - - label: iOS Unit Tests - key: ios-unit-tests - plugins: - - *gb-mobile-docker-container - - *ci_toolkit_plugin - command: | - echo "--- :docker: Additional Docker image setup" - source /root/.bashrc - - echo "--- :docker::node: Setup Node environment" - nvm install && nvm use - - .buildkite/commands/unit-tests-ios.sh - artifact_paths: - - ./logs/*.log - - ./reports/test-results/*.xml - notify: - - github_commit_status: - context: iOS Unit Tests - - - label: "Build JS Bundles" - depends_on: - - lint - - android-unit-tests - - ios-unit-tests - key: "js-bundles" - plugins: - - *gb-mobile-docker-container - - *git-cache-plugin - command: | - source /root/.bashrc - - echo "--- :node: Setup Node environment" - nvm install && nvm use - - echo "--- :npm: Install Node dependencies" - npm ci --unsafe-perm --prefer-offline --no-audit --no-progress - - if [[ -z "$BUILDKITE_TAG" ]]; then - echo "--- :package: Skip bundle prep work" - else - echo "--- :package: Run bundle prep work" - npm run prebundle:js - fi - - echo "--- :android: Build Android bundle" - npm run bundle:android - - echo "--- :arrow_up: Upload Android bundle artifact" - buildkite-agent artifact upload bundle/android/App.js - - if [[ -n "$BUILDKITE_TAG" ]]; then - echo "--- :arrow_up: Upload Android source map" - node gutenberg/node_modules/react-native/scripts/compose-source-maps.js bundle/android/App.text.js.map bundle/android/App.js.map -o bundle/android/App.composed.js.map - buildkite-agent artifact upload bundle/android/App.composed.js.map - fi - - echo "--- :ios: Build iOS bundle" - npm run bundle:ios - - echo "--- :arrow_up: Upload iOS bundle artifact" - buildkite-agent artifact upload bundle/ios/App.js - tar -czvf ios-assets.tar.gz -C ios-xcframework/Gutenberg/Resources assets/ - buildkite-agent artifact upload ios-assets.tar.gz - - if [[ -n "$BUILDKITE_TAG" ]]; then - echo "--- :arrow_up: Upload iOS source map" - node gutenberg/node_modules/react-native/scripts/compose-source-maps.js bundle/ios/App.text.js.map bundle/ios/App.js.map -o bundle/ios/App.composed.js.map - buildkite-agent artifact upload bundle/ios/App.composed.js.map - fi - - - label: "Build Android RN Aztec & Publish to S3" - depends_on: - - lint - - android-unit-tests - key: "publish-react-native-aztec-android" - plugins: - - *git-cache-plugin - - *publish-android-artifacts-docker-container - command: .buildkite/commands/publish-react-native-aztec-android-artifacts.sh - - - label: "Build Android RN Bridge & Publish to S3" - depends_on: - - "js-bundles" - - "publish-react-native-aztec-android" - plugins: - - *git-cache-plugin - - *publish-android-artifacts-docker-container - command: .buildkite/commands/publish-react-native-bridge-android-artifacts.sh - - - label: Build iOS RN XCFramework & Publish to S3 - depends_on: js-bundles - command: .buildkite/commands/publish-react-native-ios-artifacts.sh - artifact_paths: - - ios-xcframework/build/xcframeworks/*.tar.gz - plugins: - - *ci_toolkit_plugin - - *nvm_plugin - - *git-cache-plugin - agents: - queue: mac - env: *xcode_agent_env - - - label: iOS Build and Sauce Labs - key: ios-build-and-saucelabs - depends_on: - - lint - - ios-unit-tests - command: .buildkite/commands/build-ios.sh - plugins: - - *ci_toolkit_plugin - - *nvm_plugin - - *git-cache-plugin - artifact_paths: - - ./gutenberg/packages/react-native-editor/ios/GutenbergDemo.app.zip - agents: - queue: mac - env: *xcode_agent_env - - - label: Test iOS on Device – Canary Pages - depends_on: ios-build-and-saucelabs - command: .buildkite/commands/test-ios.sh --canary - plugins: - - *ci_toolkit_plugin - - *nvm_plugin - - *git-cache-plugin - artifact_paths: - - reports/test-results/ios-test-results.xml - agents: - queue: mac - env: *xcode_agent_env - notify: - - github_commit_status: - context: Test iOS on Device - Canaries - - label: Android E2E Tests command: | echo "Hello, World!" @@ -219,77 +45,3 @@ steps: notify: - github_commit_status: context: Android E2E Tests - - - block: "Full UI Tests" - # Show only in branches that run the quick UI tests suite, to optionally run the full suite - if: *is_branch_for_quick_ui_tests - key: run-full-ui-test - prompt: "Run full UI tests suites?" - depends_on: ios-build-and-saucelabs - - - label: Test iOS on Device – Full iPhone - # The quick UI tests suite version depends on the block step being unblocked - if: *is_branch_for_quick_ui_tests - depends_on: - - ios-build-and-saucelabs - - run-full-ui-test - command: .buildkite/commands/test-ios.sh - plugins: - - *ci_toolkit_plugin - - *nvm_plugin - - *git-cache-plugin - artifact_paths: - - reports/test-results/ios-test-results.xml - agents: - queue: mac - env: *xcode_agent_env - - # Same step as above, but will always run in trunk, release/, and dependabot/submodules branches - - label: Test iOS on Device – Full iPhone - # The full UI tests suite version depends only on the ios-build step, meaning it has no manual step that triggers it - if: *is_branch_for_full_ui_tests - depends_on: - - ios-build-and-saucelabs - command: .buildkite/commands/test-ios.sh - plugins: - - *ci_toolkit_plugin - - *nvm_plugin - - *git-cache-plugin - artifact_paths: - - reports/test-results/ios-test-results.xml - agents: - queue: mac - env: *xcode_agent_env - - - label: Test iOS on Device – Full iPad - # The quick UI tests suite version depends on the block step being unblocked - if: *is_branch_for_quick_ui_tests - depends_on: - - ios-build-and-saucelabs - - run-full-ui-test - command: .buildkite/commands/test-ios.sh --ipad - plugins: - - *ci_toolkit_plugin - - *nvm_plugin - - *git-cache-plugin - artifact_paths: - - reports/test-results/ios-test-results.xml - agents: - queue: mac - env: *xcode_agent_env - - - label: Test iOS on Device – Full iPad - # The full UI tests suite version depends only on the ios-build step, meaning it has no manual step that triggers it - if: *is_branch_for_full_ui_tests - depends_on: - - ios-build-and-saucelabs - command: .buildkite/commands/test-ios.sh --ipad - plugins: - - *ci_toolkit_plugin - - *nvm_plugin - - *git-cache-plugin - artifact_paths: - - reports/test-results/ios-test-results.xml - agents: - queue: mac - env: *xcode_agent_env From e3f91e8137d0448b585d01f5e4da2ce841a76888 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Thu, 26 Oct 2023 11:44:45 +1100 Subject: [PATCH 3/5] =?UTF-8?q?Add=20commands=20to=20run=20Appium=20tests?= =?UTF-8?q?=20=E2=80=93=20Might=20fail?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I'm not even sure Appium is installed there... --- .buildkite/pipeline.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 3e1b7866dd..ff76ccc0d4 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -35,7 +35,9 @@ x-common-params: steps: - label: Android E2E Tests command: | - echo "Hello, World!" + npm ci --prefer-offline --no-audit --no-progress + emulator -avd Pixel_3_XL_API_30 -noaudio + npm run test:e2e:android:local plugins: - *ci_toolkit_plugin - *nvm_plugin From 0b62ba265bfd0dbe727427a5050bc99a72dcb29f Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Thu, 26 Oct 2023 11:54:59 +1100 Subject: [PATCH 4/5] Add setup step to validate environment is okay for E2E testing --- .buildkite/pipeline.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index ff76ccc0d4..1fa1237b22 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -36,6 +36,7 @@ steps: - label: Android E2E Tests command: | npm ci --prefer-offline --no-audit --no-progress + npm run core test:e2e:setup emulator -avd Pixel_3_XL_API_30 -noaudio npm run test:e2e:android:local plugins: From 13a3bdb9c18986612e3c450b42c7afcdc21ad9b7 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Thu, 26 Oct 2023 11:55:16 +1100 Subject: [PATCH 5/5] Add step to run E2E Android on macOS queue --- .buildkite/pipeline.yml | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 1fa1237b22..82961085ea 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -33,7 +33,7 @@ x-common-params: build.branch != 'trunk' && build.branch !~ /^release.*/ && build.branch !~ /^dependabot\/submodules.*/ steps: - - label: Android E2E Tests + - label: Android E2E Tests – Android Queue command: | npm ci --prefer-offline --no-audit --no-progress npm run core test:e2e:setup @@ -47,4 +47,21 @@ steps: queue: android-staging notify: - github_commit_status: - context: Android E2E Tests + context: Android E2E Tests – Android Queue + + - label: Android E2E Tests – macOS Queue + command: | + npm ci --prefer-offline --no-audit --no-progress + npm run core test:e2e:setup + emulator -avd Pixel_3_XL_API_30 -noaudio + npm run test:e2e:android:local + plugins: + - *ci_toolkit_plugin + - *nvm_plugin + - *git-cache-plugin + agents: + queue: mac + env: *xcode_agent_env + notify: + - github_commit_status: + context: Android E2E Tests – macOS Queue