Skip to content

Commit c9255ab

Browse files
committed
fix(workflows): enhance emulator readiness checks and update test command in android-tests workflow
1 parent dc60a86 commit c9255ab

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

.github/workflows/android-tests.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,17 @@ jobs:
4747
profile: Nexus 6
4848
disable-animations: true
4949
script: |
50-
echo "Emulator setup complete"
50+
echo "Waiting for device to be ready..."
51+
adb wait-for-device
52+
echo "Device is ready"
5153
adb devices
54+
# Wait for boot to complete
55+
adb shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done; input keyevent 82'
56+
# Disable animations
5257
adb shell settings put global window_animation_scale 0.0
5358
adb shell settings put global transition_animation_scale 0.0
5459
adb shell settings put global animator_duration_scale 0.0
60+
echo "Emulator is ready"
5561
5662
- name: Make gradlew executable
5763
run: chmod +x ./gradlew
@@ -61,9 +67,16 @@ jobs:
6167
working-directory: ./android
6268
run: ./gradlew test
6369

70+
- name: Verify emulator is ready
71+
working-directory: ./android
72+
run: |
73+
adb wait-for-device
74+
adb shell getprop sys.boot_completed | grep -q 1
75+
6476
- name: Run instrumentation tests
6577
working-directory: ./android
66-
run: ./gradlew connectedAndroidTest
78+
run: |
79+
./gradlew connectedDebugAndroidTest
6780
6881
- name: Upload test results
6982
if: always()

0 commit comments

Comments
 (0)