From 3ba56597ff77d5205a99ccd0e3f91131d2cb0794 Mon Sep 17 00:00:00 2001 From: Ivan Vershigora Date: Fri, 19 Jan 2024 18:29:04 +0000 Subject: [PATCH] feat: android e2e tests --- .github/workflows/e2e-android.yml | 151 ++++++++++++++++++------------ 1 file changed, 92 insertions(+), 59 deletions(-) diff --git a/.github/workflows/e2e-android.yml b/.github/workflows/e2e-android.yml index df0f3d503..927113125 100644 --- a/.github/workflows/e2e-android.yml +++ b/.github/workflows/e2e-android.yml @@ -108,10 +108,10 @@ jobs: # target: aosp_atd # disk-size: 2048M - - name: Test attempt 1 + - name: Run tests uses: reactivecircus/android-emulator-runner@v2 - continue-on-error: true - id: test1 + # continue-on-error: true + # id: test1 with: api-level: 31 cores: 2 @@ -123,66 +123,99 @@ jobs: script: | sleep 1 adb root - yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/onboarding.e2e.js + while true + do + for i in {1..4}; do + echo "::group::attempt $i" + yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/onboarding.e2e.js + if [ $? -eq 0 ]; then + echo "test success" + echo "::endgroup::" + exit 0 + fi + echo "test fail, attempt $i" + echo "::endgroup::" + sleep 1 + done + echo "all attempts failed" + exit 1 + done - - name: Test attempt 2 - uses: reactivecircus/android-emulator-runner@v2 - continue-on-error: true - id: test2 - if: steps.test1.outcome != 'success' - with: - api-level: 31 - cores: 2 - profile: 5.4in FWVGA - avd-name: Pixel_API_31_AOSP - force-avd-creation: false - emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none -camera-front none -partition-size 2047 - arch: x86_64 - script: | - sleep 1 - adb root - yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/onboarding.e2e.js + # - name: Test attempt 1 + # uses: reactivecircus/android-emulator-runner@v2 + # continue-on-error: true + # id: test1 + # with: + # api-level: 31 + # cores: 2 + # profile: 5.4in FWVGA + # avd-name: Pixel_API_31_AOSP + # force-avd-creation: false + # emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none -camera-front none -partition-size 2047 + # arch: x86_64 + # script: | + # sleep 1 + # adb root + # yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/onboarding.e2e.js - - name: Test attempt 3 - uses: reactivecircus/android-emulator-runner@v2 - continue-on-error: true - id: test3 - if: steps.test1.outcome != 'success' && steps.test2.outcome != 'success' - with: - api-level: 31 - cores: 2 - profile: 5.4in FWVGA - avd-name: Pixel_API_31_AOSP - force-avd-creation: false - emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none -camera-front none -partition-size 2047 - arch: x86_64 - script: | - sleep 1 - adb root - yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/onboarding.e2e.js + # - name: Test attempt 2 + # uses: reactivecircus/android-emulator-runner@v2 + # continue-on-error: true + # id: test2 + # if: steps.test1.outcome != 'success' + # with: + # api-level: 31 + # cores: 2 + # profile: 5.4in FWVGA + # avd-name: Pixel_API_31_AOSP + # force-avd-creation: false + # emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none -camera-front none -partition-size 2047 + # arch: x86_64 + # script: | + # sleep 1 + # adb root + # yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/onboarding.e2e.js - - name: Restart docker before last attempt - if: steps.test1.outcome != 'success' && steps.test2.outcome != 'success' && steps.test3.outcome != 'success' - run: | - cd docker && docker-compose down -t 60 && docker-compose up --quiet-pull -d && cd .. - while ! nc -z '127.0.0.1' 60001; do sleep 1; done + # - name: Test attempt 3 + # uses: reactivecircus/android-emulator-runner@v2 + # continue-on-error: true + # id: test3 + # if: steps.test1.outcome != 'success' && steps.test2.outcome != 'success' + # with: + # api-level: 31 + # cores: 2 + # profile: 5.4in FWVGA + # avd-name: Pixel_API_31_AOSP + # force-avd-creation: false + # emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none -camera-front none -partition-size 2047 + # arch: x86_64 + # script: | + # sleep 1 + # adb root + # yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/onboarding.e2e.js - - name: Test attempt 4 - uses: reactivecircus/android-emulator-runner@v2 - id: test4 - if: steps.test1.outcome != 'success' && steps.test2.outcome != 'success' && steps.test3.outcome != 'success' - with: - api-level: 31 - cores: 2 - profile: 5.4in FWVGA - avd-name: Pixel_API_31_AOSP - force-avd-creation: false - emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none -camera-front none -partition-size 2047 - arch: x86_64 - script: | - sleep 1 - adb root - yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/onboarding.e2e.js + # - name: Restart docker before last attempt + # if: steps.test1.outcome != 'success' && steps.test2.outcome != 'success' && steps.test3.outcome != 'success' + # run: | + # cd docker && docker-compose down -t 60 && docker-compose up --quiet-pull -d && cd .. + # while ! nc -z '127.0.0.1' 60001; do sleep 1; done + + # - name: Test attempt 4 + # uses: reactivecircus/android-emulator-runner@v2 + # id: test4 + # if: steps.test1.outcome != 'success' && steps.test2.outcome != 'success' && steps.test3.outcome != 'success' + # with: + # api-level: 31 + # cores: 2 + # profile: 5.4in FWVGA + # avd-name: Pixel_API_31_AOSP + # force-avd-creation: false + # emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none -camera-front none -partition-size 2047 + # arch: x86_64 + # script: | + # sleep 1 + # adb root + # yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all e2e/onboarding.e2e.js # - name: Test backup # uses: reactivecircus/android-emulator-runner@v2