Skip to content

Commit

Permalink
feat: android e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
limpbrains committed Mar 14, 2024
1 parent b012d7a commit 3ba5659
Showing 1 changed file with 92 additions and 59 deletions.
151 changes: 92 additions & 59 deletions .github/workflows/e2e-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 3ba5659

Please sign in to comment.