Skip to content

Commit

Permalink
Feature/emulator test (#161)
Browse files Browse the repository at this point in the history
* Try sdk34

* Add logs

* Try bigger ram

* Try pixel 8

* Disable wifi and use pixel 6

* Increase timeout

* Hide network
  • Loading branch information
michaeltroger authored Nov 3, 2023
1 parent d8f9516 commit 28ebb9d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/ui_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@ jobs:
- name: run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 31
api-level: 34
arch: x86_64
target: default
profile: pixel_6_pro
emulator-boot-timeout: 1000
sdcard-path-or-size: 1000M
disk-size: 8G
ram-size: 4048M
force-avd-creation: true
disable-spellchecker: true
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fun waitUntilIdle() {
.waitForIdle()
}

fun waitUntilNoException(timeoutMs: Long = 5000, function: () -> Any?) {
fun waitUntilNoException(timeoutMs: Long = 50000, function: () -> Any?) {
val startTimeMs = System.currentTimeMillis()
while (true) {
try {
Expand Down
6 changes: 2 additions & 4 deletions scripts/run_ui_tests
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@ adb push testdata /sdcard/
adb shell settings put global sysui_demo_allowed 1
adb shell am broadcast -a com.android.systemui.demo -e command clock -e hhmm 1200
adb shell am broadcast -a com.android.systemui.demo -e command notifications -e visible false
adb shell am broadcast -a com.android.systemui.demo -e command network -e mobile show -e datatype none -e level 4
adb shell am broadcast -a com.android.systemui.demo -e command network -e wifi show -e level 4
adb shell am broadcast -a com.android.systemui.demo -e command network -e mobile hide
adb shell am broadcast -a com.android.systemui.demo -e command network -e wifi hide
adb shell am broadcast -a com.android.systemui.demo -e command battery -e plugged false
adb shell am broadcast -a com.android.systemui.demo -e command battery -e level 100
# run a second time since this one seems to be flaky on the emulator:
adb shell am broadcast -a com.android.systemui.demo -e command network -e mobile show -e datatype none -e level 4

set +e # don't fail on errors

Expand Down

0 comments on commit 28ebb9d

Please sign in to comment.