From 6f2354050c19d7d7ffcb0e42944db65cfab1fafd Mon Sep 17 00:00:00 2001 From: Bruno Barbieri Date: Tue, 10 Dec 2024 14:34:15 -0500 Subject: [PATCH 1/8] e2e split into parallel and serial flows --- .github/workflows/macstadium-builds.yml | 2 +- .github/workflows/macstadium-tests.yml | 5 +++-- .../1_importAndWatchWalletsFlow.spec.ts | 4 ++-- e2e/{ => parallel}/2_newWalletFlow.spec.ts | 2 +- e2e/{ => parallel}/3_homeScreen.spec.ts | 2 +- e2e/{ => parallel}/4_discoverSheetFlow.spec.ts | 2 +- ..._watchedWalletCollectionActionsFlow.spec.ts} | 2 +- .../6_maliciousDappConnection.spec.ts} | 4 ++-- .../7_manualBackup.spec.ts} | 3 +-- .../1_sendSheetFlowContacts.spec.ts} | 2 +- e2e/{9_swaps.spec.ts => serial/2_swaps.spec.ts} | 5 ++--- scripts/run-parallel-e2e.sh | 17 +++++++++++++++++ .../{run-retry-tests.sh => run-serial-e2e.sh} | 4 ++-- 13 files changed, 35 insertions(+), 19 deletions(-) rename e2e/{ => parallel}/1_importAndWatchWalletsFlow.spec.ts (98%) rename e2e/{ => parallel}/2_newWalletFlow.spec.ts (94%) rename e2e/{ => parallel}/3_homeScreen.spec.ts (98%) rename e2e/{ => parallel}/4_discoverSheetFlow.spec.ts (99%) rename e2e/{6_watchedWalletCollectionActionsFlow.spec.ts => parallel/5_watchedWalletCollectionActionsFlow.spec.ts} (98%) rename e2e/{7_maliciousDappConnection.spec.ts => parallel/6_maliciousDappConnection.spec.ts} (96%) rename e2e/{8_manualBackup.spec.ts => parallel/7_manualBackup.spec.ts} (98%) rename e2e/{5_sendSheetFlowContacts.spec.ts => serial/1_sendSheetFlowContacts.spec.ts} (99%) rename e2e/{9_swaps.spec.ts => serial/2_swaps.spec.ts} (98%) create mode 100755 scripts/run-parallel-e2e.sh rename scripts/{run-retry-tests.sh => run-serial-e2e.sh} (70%) mode change 100755 => 100644 diff --git a/.github/workflows/macstadium-builds.yml b/.github/workflows/macstadium-builds.yml index 25d9555aafa..4c5049c377a 100644 --- a/.github/workflows/macstadium-builds.yml +++ b/.github/workflows/macstadium-builds.yml @@ -7,7 +7,7 @@ on: jobs: # Job to install dependencies build: - runs-on: ["self-hosted"] + runs-on: [] timeout-minutes: 75 if: github.event.pull_request.draft == false && github.event.pull_request.merged == false concurrency: diff --git a/.github/workflows/macstadium-tests.yml b/.github/workflows/macstadium-tests.yml index b458a442609..94d62e27d95 100644 --- a/.github/workflows/macstadium-tests.yml +++ b/.github/workflows/macstadium-tests.yml @@ -63,7 +63,7 @@ jobs: # Job for linting and unit tests linting-and-unit-tests: - runs-on: ["self-hosted"] + runs-on: [] permissions: contents: read needs: install-deps @@ -170,4 +170,5 @@ jobs: - name: Detox iOS e2e tests run: | - ./scripts/run-retry-tests.sh 3 + ./scripts/run-parallel-e2e.sh 3 + ./scripts/run-serial-e2e.sh 3 diff --git a/e2e/1_importAndWatchWalletsFlow.spec.ts b/e2e/parallel/1_importAndWatchWalletsFlow.spec.ts similarity index 98% rename from e2e/1_importAndWatchWalletsFlow.spec.ts rename to e2e/parallel/1_importAndWatchWalletsFlow.spec.ts index 311e6ce5987..0e9b30cdaab 100644 --- a/e2e/1_importAndWatchWalletsFlow.spec.ts +++ b/e2e/parallel/1_importAndWatchWalletsFlow.spec.ts @@ -9,8 +9,8 @@ import { authenticatePin, delayTime, afterAllcleanApp, -} from './helpers'; -import { WALLET_VARS } from './testVariables'; +} from '../helpers'; +import { WALLET_VARS } from '../testVariables'; const android = device.getPlatform() === 'android'; diff --git a/e2e/2_newWalletFlow.spec.ts b/e2e/parallel/2_newWalletFlow.spec.ts similarity index 94% rename from e2e/2_newWalletFlow.spec.ts rename to e2e/parallel/2_newWalletFlow.spec.ts index 0c608336562..241dcb4e5d1 100644 --- a/e2e/2_newWalletFlow.spec.ts +++ b/e2e/parallel/2_newWalletFlow.spec.ts @@ -1,5 +1,5 @@ import { device } from 'detox'; -import { beforeAllcleanApp, checkIfVisible, waitAndTap, authenticatePin, delayTime, afterAllcleanApp } from './helpers'; +import { beforeAllcleanApp, checkIfVisible, waitAndTap, authenticatePin, delayTime, afterAllcleanApp } from '../helpers'; const android = device.getPlatform() === 'android'; diff --git a/e2e/3_homeScreen.spec.ts b/e2e/parallel/3_homeScreen.spec.ts similarity index 98% rename from e2e/3_homeScreen.spec.ts rename to e2e/parallel/3_homeScreen.spec.ts index 94fea2546f0..1e32821ace8 100644 --- a/e2e/3_homeScreen.spec.ts +++ b/e2e/parallel/3_homeScreen.spec.ts @@ -8,7 +8,7 @@ import { afterAllcleanApp, tap, delayTime, -} from './helpers'; +} from '../helpers'; const RAINBOW_TEST_WALLET = 'rainbowtestwallet.eth'; diff --git a/e2e/4_discoverSheetFlow.spec.ts b/e2e/parallel/4_discoverSheetFlow.spec.ts similarity index 99% rename from e2e/4_discoverSheetFlow.spec.ts rename to e2e/parallel/4_discoverSheetFlow.spec.ts index a04abb933e8..0e2f9d632a3 100644 --- a/e2e/4_discoverSheetFlow.spec.ts +++ b/e2e/parallel/4_discoverSheetFlow.spec.ts @@ -11,7 +11,7 @@ import { delayTime, importWalletFlow, afterAllcleanApp, -} from './helpers'; +} from '../helpers'; const ios = device.getPlatform() === 'ios'; diff --git a/e2e/6_watchedWalletCollectionActionsFlow.spec.ts b/e2e/parallel/5_watchedWalletCollectionActionsFlow.spec.ts similarity index 98% rename from e2e/6_watchedWalletCollectionActionsFlow.spec.ts rename to e2e/parallel/5_watchedWalletCollectionActionsFlow.spec.ts index 405d939e303..03fa4a5ab3e 100644 --- a/e2e/6_watchedWalletCollectionActionsFlow.spec.ts +++ b/e2e/parallel/5_watchedWalletCollectionActionsFlow.spec.ts @@ -9,7 +9,7 @@ import { checkIfDoesntExist, delayTime, afterAllcleanApp, -} from './helpers'; +} from '../helpers'; describe('Watched showcase and hidden actions flow', () => { beforeAll(async () => { diff --git a/e2e/7_maliciousDappConnection.spec.ts b/e2e/parallel/6_maliciousDappConnection.spec.ts similarity index 96% rename from e2e/7_maliciousDappConnection.spec.ts rename to e2e/parallel/6_maliciousDappConnection.spec.ts index 0b6f49fd0bf..ad13c226403 100644 --- a/e2e/7_maliciousDappConnection.spec.ts +++ b/e2e/parallel/6_maliciousDappConnection.spec.ts @@ -10,8 +10,8 @@ import { delayTime, tapAtPoint, checkIfExists, -} from './helpers'; -import { WALLET_VARS } from './testVariables'; +} from '../helpers'; +import { WALLET_VARS } from '../testVariables'; describe('Check malicious dapp warning', () => { beforeAll(async () => { diff --git a/e2e/8_manualBackup.spec.ts b/e2e/parallel/7_manualBackup.spec.ts similarity index 98% rename from e2e/8_manualBackup.spec.ts rename to e2e/parallel/7_manualBackup.spec.ts index bc595e5cdf2..680e042fc4d 100644 --- a/e2e/8_manualBackup.spec.ts +++ b/e2e/parallel/7_manualBackup.spec.ts @@ -6,12 +6,11 @@ import { tap, tapByText, delayTime, - tapAtPoint, checkIfExistsByText, checkIfExists, waitAndTap, checkIfDoesntExist, -} from './helpers'; +} from '../helpers'; describe('Backups', () => { beforeAll(async () => { diff --git a/e2e/5_sendSheetFlowContacts.spec.ts b/e2e/serial/1_sendSheetFlowContacts.spec.ts similarity index 99% rename from e2e/5_sendSheetFlowContacts.spec.ts rename to e2e/serial/1_sendSheetFlowContacts.spec.ts index 65de2a28ab8..ece0ee36771 100644 --- a/e2e/5_sendSheetFlowContacts.spec.ts +++ b/e2e/serial/1_sendSheetFlowContacts.spec.ts @@ -12,7 +12,7 @@ import { tapByText, delayTime, afterAllcleanApp, -} from './helpers'; +} from '../helpers'; const android = device.getPlatform() === 'android'; diff --git a/e2e/9_swaps.spec.ts b/e2e/serial/2_swaps.spec.ts similarity index 98% rename from e2e/9_swaps.spec.ts rename to e2e/serial/2_swaps.spec.ts index 67d866e2326..9a4e3ed972c 100644 --- a/e2e/9_swaps.spec.ts +++ b/e2e/serial/2_swaps.spec.ts @@ -23,11 +23,10 @@ import { delayTime, swipeUntilVisible, tapAndLongPress, - swipe, -} from './helpers'; +} from '../helpers'; import { expect } from '@jest/globals'; -import { WALLET_VARS } from './testVariables'; +import { WALLET_VARS } from '../testVariables'; describe('Swap Sheet Interaction Flow', () => { beforeAll(async () => { diff --git a/scripts/run-parallel-e2e.sh b/scripts/run-parallel-e2e.sh new file mode 100755 index 00000000000..9caeda31bee --- /dev/null +++ b/scripts/run-parallel-e2e.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +max_retries="$1" +count=0 + +until (( count >= max_retries )) +do + ./node_modules/.bin/detox test parallel/ -c ios.sim.release --maxWorkers 4 -- --forceExit --bail 1 + ret_val=$? + if [ $ret_val -eq 0 ]; then + exit 0 + fi + ((count++)) + echo "Test failed, attempt $count/$max_retries..." +done + + diff --git a/scripts/run-retry-tests.sh b/scripts/run-serial-e2e.sh old mode 100755 new mode 100644 similarity index 70% rename from scripts/run-retry-tests.sh rename to scripts/run-serial-e2e.sh index b3584fbe9cd..dc1a1f6640e --- a/scripts/run-retry-tests.sh +++ b/scripts/run-serial-e2e.sh @@ -5,7 +5,7 @@ count=0 until (( count >= max_retries )) do - ./node_modules/.bin/detox test -c ios.sim.release --maxWorkers 2 -- --forceExit --bail 1 + ./node_modules/.bin/detox test serial/ -c ios.sim.release --maxWorkers 1 -- --forceExit --bail 1 ret_val=$? if [ $ret_val -eq 0 ]; then exit 0 @@ -15,4 +15,4 @@ do done echo "Tests failed after $max_retries attempts." -exit 1 +exit 1 \ No newline at end of file From cd6da84368fb15a36e786ba4f11ccec0ab16e4b9 Mon Sep 17 00:00:00 2001 From: Bruno Barbieri Date: Tue, 10 Dec 2024 17:30:42 -0500 Subject: [PATCH 2/8] revert config changes --- .github/workflows/macstadium-builds.yml | 2 +- .github/workflows/macstadium-tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/macstadium-builds.yml b/.github/workflows/macstadium-builds.yml index 4c5049c377a..25d9555aafa 100644 --- a/.github/workflows/macstadium-builds.yml +++ b/.github/workflows/macstadium-builds.yml @@ -7,7 +7,7 @@ on: jobs: # Job to install dependencies build: - runs-on: [] + runs-on: ["self-hosted"] timeout-minutes: 75 if: github.event.pull_request.draft == false && github.event.pull_request.merged == false concurrency: diff --git a/.github/workflows/macstadium-tests.yml b/.github/workflows/macstadium-tests.yml index 94d62e27d95..8f897d39f1f 100644 --- a/.github/workflows/macstadium-tests.yml +++ b/.github/workflows/macstadium-tests.yml @@ -63,7 +63,7 @@ jobs: # Job for linting and unit tests linting-and-unit-tests: - runs-on: [] + runs-on: ["self-hosted"] permissions: contents: read needs: install-deps From 9b431b530e752809dbfb8ea32e974346d95f314b Mon Sep 17 00:00:00 2001 From: Bruno Barbieri Date: Tue, 10 Dec 2024 18:38:51 -0500 Subject: [PATCH 3/8] downgrade to 3 runners --- scripts/run-parallel-e2e.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/run-parallel-e2e.sh b/scripts/run-parallel-e2e.sh index 9caeda31bee..bb83cec75f8 100755 --- a/scripts/run-parallel-e2e.sh +++ b/scripts/run-parallel-e2e.sh @@ -5,7 +5,7 @@ count=0 until (( count >= max_retries )) do - ./node_modules/.bin/detox test parallel/ -c ios.sim.release --maxWorkers 4 -- --forceExit --bail 1 + ./node_modules/.bin/detox test parallel/ -c ios.sim.release --maxWorkers 3 -- --forceExit --bail 1 ret_val=$? if [ $ret_val -eq 0 ]; then exit 0 From b5fc3f07409b600357035cf4e65eae964eacaed5 Mon Sep 17 00:00:00 2001 From: Bruno Barbieri Date: Tue, 10 Dec 2024 18:39:13 -0500 Subject: [PATCH 4/8] bump watchdog action to v4 --- .github/workflows/comments-watchdog.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/comments-watchdog.yml b/.github/workflows/comments-watchdog.yml index 0c5d71ee911..132b6bce74c 100644 --- a/.github/workflows/comments-watchdog.yml +++ b/.github/workflows/comments-watchdog.yml @@ -65,7 +65,7 @@ jobs: fi - name: Upload deleted comments log as artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: deleted-comments-log path: deleted_comments_log.txt \ No newline at end of file From 853b17bac4c5222146ae02b8bb565e8fcb7c63e4 Mon Sep 17 00:00:00 2001 From: Bruno Barbieri Date: Tue, 10 Dec 2024 19:22:35 -0500 Subject: [PATCH 5/8] some minor optimizations --- .github/workflows/macstadium-tests.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/macstadium-tests.yml b/.github/workflows/macstadium-tests.yml index 8f897d39f1f..ce90355ff5b 100644 --- a/.github/workflows/macstadium-tests.yml +++ b/.github/workflows/macstadium-tests.yml @@ -17,9 +17,6 @@ jobs: - name: Set up github keys run: git config core.sshCommand "ssh -i ~/.ssh/id_ed25519 -F /dev/null" - - name: Clean iOS app - run: yarn cache clean && yarn clean:ios > /dev/null 2>&1 || true - - name: Set up ENV vars & scripts env: CI_SCRIPTS: ${{ secrets.CI_SCRIPTS }} @@ -92,7 +89,7 @@ jobs: eval $CI_SCRIPTS - name: Install dependencies run: | - yarn install && yarn setup + yarn setup - name: Check for frozen lockfile run: ./scripts/check-lockfile.sh @@ -144,7 +141,7 @@ jobs: eval $CI_SCRIPTS - name: Install dependencies run: | - yarn install && yarn setup + yarn setup - name: Rebuild detox cache run: ./node_modules/.bin/detox clean-framework-cache && ./node_modules/.bin/detox build-framework-cache @@ -168,7 +165,10 @@ jobs: sed -i'' -e "s/IS_TESTING=false/IS_TESTING=true/" .env && rm -f .env-e yarn detox build --configuration ios.sim.release - - name: Detox iOS e2e tests + - name: Detox iOS e2e tests parallel run: | ./scripts/run-parallel-e2e.sh 3 + + - name: Detox iOS e2e tests serial + run: | ./scripts/run-serial-e2e.sh 3 From 763638c7ff763d80811b8c37d7e26d06d71e42f6 Mon Sep 17 00:00:00 2001 From: Bruno Barbieri Date: Tue, 10 Dec 2024 19:34:36 -0500 Subject: [PATCH 6/8] add required yarn install again --- .github/workflows/macstadium-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/macstadium-tests.yml b/.github/workflows/macstadium-tests.yml index ce90355ff5b..b4dfe0d643e 100644 --- a/.github/workflows/macstadium-tests.yml +++ b/.github/workflows/macstadium-tests.yml @@ -89,7 +89,7 @@ jobs: eval $CI_SCRIPTS - name: Install dependencies run: | - yarn setup + yarn install && yarn setup - name: Check for frozen lockfile run: ./scripts/check-lockfile.sh @@ -141,7 +141,7 @@ jobs: eval $CI_SCRIPTS - name: Install dependencies run: | - yarn setup + yarn install && yarn setup - name: Rebuild detox cache run: ./node_modules/.bin/detox clean-framework-cache && ./node_modules/.bin/detox build-framework-cache From 99bb9b5b2d71265d422c1ddb67b912db3ec1045a Mon Sep 17 00:00:00 2001 From: Bruno Barbieri Date: Tue, 10 Dec 2024 19:34:47 -0500 Subject: [PATCH 7/8] set max workers back to 2 --- scripts/run-parallel-e2e.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/run-parallel-e2e.sh b/scripts/run-parallel-e2e.sh index bb83cec75f8..71961395466 100755 --- a/scripts/run-parallel-e2e.sh +++ b/scripts/run-parallel-e2e.sh @@ -5,7 +5,7 @@ count=0 until (( count >= max_retries )) do - ./node_modules/.bin/detox test parallel/ -c ios.sim.release --maxWorkers 3 -- --forceExit --bail 1 + ./node_modules/.bin/detox test parallel/ -c ios.sim.release --maxWorkers 2 -- --forceExit --bail 1 ret_val=$? if [ $ret_val -eq 0 ]; then exit 0 From b1c6b9a130d4838d3cf744fdf2cdc92cbb18fb0f Mon Sep 17 00:00:00 2001 From: Bruno Barbieri Date: Tue, 10 Dec 2024 21:08:44 -0500 Subject: [PATCH 8/8] chmod -x new serial script --- scripts/run-serial-e2e.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 scripts/run-serial-e2e.sh diff --git a/scripts/run-serial-e2e.sh b/scripts/run-serial-e2e.sh old mode 100644 new mode 100755