Skip to content

Commit 9a20ca0

Browse files
committed
CI: Launch emulator on instrumented tests job without gmd
1 parent 91554aa commit 9a20ca0

File tree

2 files changed

+58
-3
lines changed

2 files changed

+58
-3
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/bin/bash -u
2+
3+
echo "--- 📋 Checking Android SDK"
4+
echo "adb --version"
5+
adb --version
6+
echo "emulator -list-avds"
7+
emulator -list-avds
8+
echo ""
9+
10+
echo "--- 🤖 Launching Emulator(s)"
11+
echo "emulator -avd pixel5api34 -no-snapshot -no-boot-anim -no-audio &"
12+
emulator -avd pixel5api34 -no-snapshot -no-boot-anim -no-audio &
13+
echo ""
14+
15+
echo "--- 🤖 Waiting for Emulator(s) to Start"
16+
echo "adb wait-for-device"
17+
adb wait-for-device
18+
echo "while [ "$(adb shell getprop sys.boot_completed | tr -d '\r')" != "1" ]; do"
19+
echo " sleep 1"
20+
echo "done"
21+
while [ "$(adb shell getprop sys.boot_completed | tr -d '\r')" != "1" ]; do
22+
sleep 1
23+
done
24+
echo ""
25+
26+
echo "--- 🤖 Unlock Emulator(s)"
27+
echo "adb shell dumpsys window | grep mDreamingLockscreen"
28+
adb shell dumpsys window | grep mDreamingLockscreen
29+
echo "adb -s emulator-5554 shell input keyevent 82"
30+
adb -s emulator-5554 shell input keyevent 82
31+
echo ""
32+
33+
echo "--- 🤖 Checking Emulator(s)"
34+
echo "adb devices"
35+
adb devices
36+
echo "adb shell dumpsys window | grep mDreamingLockscreen"
37+
adb shell dumpsys window | grep mDreamingLockscreen
38+
echo ""
39+
40+
echo "--- 🧪 Testing"
41+
./gradlew :WooCommerce:connectedVanillaDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=com.woocommerce.android.e2e.tests.ui.ReviewsUITest
42+
ui_test_exit_code=$?
43+
echo ""
44+
45+
echo "--- 🤖 Checking Emulator(s)"
46+
echo "adb devices"
47+
adb devices
48+
echo ""
49+
50+
echo "--- 🤖 Stopping Emulator(s)"
51+
echo "adb -s emulator-5554 emu kill"
52+
adb -s emulator-5554 emu kill
53+
echo "adb devices"
54+
while adb devices | grep -q emulator-5554; do sleep 1; done
55+
echo ""
56+
57+
exit $ui_test_exit_code

.buildkite/pipeline.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ steps:
2222
queue: "mac-metal"
2323

2424
- label: "Instrumented tests without GMD (ReviewsUITest)"
25-
command: |
26-
echo "--- 🧪 Testing"
27-
./gradlew :WooCommerce:connectedVanillaDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=com.woocommerce.android.e2e.tests.ui.ReviewsUITest
25+
command: .buildkite/commands/run-instrumented-tests-emulator.sh
2826
plugins: [ $CI_TOOLKIT ]
2927
artifact_paths:
3028
- "**/build/reports/androidTests/connected/**/**/**/*"

0 commit comments

Comments
 (0)