Skip to content

Commit

Permalink
E2E split into parallel and serial flows (#6317)
Browse files Browse the repository at this point in the history
* e2e split into parallel and serial flows

* revert config changes

* downgrade to 3 runners

* bump watchdog action to v4

* some minor optimizations

* add required yarn install again

* set max workers back to 2

* chmod -x new serial script
  • Loading branch information
brunobar79 authored Dec 11, 2024
1 parent 044daae commit c6da61f
Show file tree
Hide file tree
Showing 13 changed files with 38 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/comments-watchdog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 6 additions & 5 deletions .github/workflows/macstadium-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -168,6 +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-retry-tests.sh 3
./scripts/run-serial-e2e.sh 3
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
afterAllcleanApp,
tap,
delayTime,
} from './helpers';
} from '../helpers';

const RAINBOW_TEST_WALLET = 'rainbowtestwallet.eth';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
delayTime,
importWalletFlow,
afterAllcleanApp,
} from './helpers';
} from '../helpers';

const ios = device.getPlatform() === 'ios';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
checkIfDoesntExist,
delayTime,
afterAllcleanApp,
} from './helpers';
} from '../helpers';

describe('Watched showcase and hidden actions flow', () => {
beforeAll(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ import {
tap,
tapByText,
delayTime,
tapAtPoint,
checkIfExistsByText,
checkIfExists,
waitAndTap,
checkIfDoesntExist,
} from './helpers';
} from '../helpers';

describe('Backups', () => {
beforeAll(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
tapByText,
delayTime,
afterAllcleanApp,
} from './helpers';
} from '../helpers';

const android = device.getPlatform() === 'android';

Expand Down
5 changes: 2 additions & 3 deletions e2e/9_swaps.spec.ts → e2e/serial/2_swaps.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down
17 changes: 17 additions & 0 deletions scripts/run-parallel-e2e.sh
Original file line number Diff line number Diff line change
@@ -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 2 -- --forceExit --bail 1
ret_val=$?
if [ $ret_val -eq 0 ]; then
exit 0
fi
((count++))
echo "Test failed, attempt $count/$max_retries..."
done


4 changes: 2 additions & 2 deletions scripts/run-retry-tests.sh → scripts/run-serial-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -15,4 +15,4 @@ do
done

echo "Tests failed after $max_retries attempts."
exit 1
exit 1

0 comments on commit c6da61f

Please sign in to comment.