Skip to content

Commit ef364c5

Browse files
committed
Fix test: add diagnostics, fix screen size, remove UI automation that failed
1 parent 55733fa commit ef364c5

1 file changed

Lines changed: 40 additions & 85 deletions

File tree

.github/workflows/test.yml

Lines changed: 40 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,23 @@ jobs:
7171
target: google_apis
7272
arch: x86_64
7373
force-avd-creation: false
74-
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim
74+
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -skin 1080x1920
7575
disable-animations: true
7676
script: |
77-
set -x
78-
7977
echo "=== Emulator booted ==="
8078
adb shell getprop ro.build.version.sdk
8179
adb shell getprop ro.product.cpu.abi
8280
81+
echo "=== Screen size ==="
82+
adb shell wm size
83+
8384
echo "=== Installing APK ==="
8485
adb install -r app/build/outputs/apk/debug/app-debug.apk
86+
INSTALL_EXIT=$?
87+
echo "Install exit code: $INSTALL_EXIT"
88+
89+
echo "=== Verify package installed ==="
90+
adb shell pm list packages | grep ubuntuandroid || echo "PACKAGE NOT FOUND"
8591
8692
echo "=== Granting permissions ==="
8793
adb shell pm grant com.scisammy.ubuntuandroid android.permission.READ_EXTERNAL_STORAGE || true
@@ -91,107 +97,56 @@ jobs:
9197
adb logcat -c
9298
9399
echo "=== Launching app ==="
94-
adb shell am start -n com.scisammy.ubuntuandroid/.MainActivity
95-
sleep 30
100+
adb shell am start -W -n com.scisammy.ubuntuandroid/.MainActivity
101+
LAUNCH_EXIT=$?
102+
echo "Launch exit code: $LAUNCH_EXIT"
103+
104+
sleep 10
96105
97-
echo "=== UI dump after 30s ==="
106+
echo "=== Check if app is running ==="
107+
adb shell dumpsys activity activities | grep -i "ubuntuandroid" | head -5
108+
109+
echo "=== UI dump after 10s ==="
98110
adb shell uiautomator dump /sdcard/ui1.xml || true
99111
adb pull /sdcard/ui1.xml /tmp/ui1.xml || true
100-
cat /tmp/ui1.xml | tr '>' '>\n' | grep 'text=' | head -30
101-
102-
echo "=== Tapping first list item (Ubuntu) ==="
103-
adb shell input tap 540 500
104-
sleep 5
105-
106-
echo "=== UI after tap ==="
107-
adb shell uiautomator dump /sdcard/ui2.xml || true
108-
adb pull /sdcard/ui2.xml /tmp/ui2.xml || true
109-
cat /tmp/ui2.xml | tr '>' '>\n' | grep 'text=' | head -30
110-
111-
echo "=== Entering username ==="
112-
adb shell input tap 540 400
113-
sleep 1
114-
adb shell input text "user"
115-
adb shell input keyevent 61
116-
sleep 0.5
117-
118-
echo "=== Entering password ==="
119-
adb shell input text "password"
120-
adb shell input keyevent 61
121-
sleep 0.5
122-
adb shell input text "password"
123-
sleep 1
124-
125-
echo "=== Pressing OK ==="
126-
adb shell input keyevent 66
127-
sleep 5
128-
129-
echo "=== UI after credentials ==="
130-
adb shell uiautomator dump /sdcard/ui3.xml || true
131-
adb pull /sdcard/ui3.xml /tmp/ui3.xml || true
132-
cat /tmp/ui3.xml | tr '>' '>\n' | grep 'text=' | head -30
133-
134-
echo "=== Tapping SSH option ==="
135-
adb shell input tap 540 450
136-
sleep 1
137-
adb shell input keyevent 66
138-
sleep 5
139-
140-
echo "=== UI after connection type ==="
141-
adb shell uiautomator dump /sdcard/ui4.xml || true
142-
adb pull /sdcard/ui4.xml /tmp/ui4.xml || true
143-
cat /tmp/ui4.xml | tr '>' '>\n' | grep 'text=' | head -30
144-
145-
echo "=== Waiting 3 min for download + setup ==="
146-
for i in $(seq 1 12); do
147-
sleep 15
148-
echo "--- Check $((i * 15))s ---"
149-
adb shell uiautomator dump /sdcard/ui_check.xml || true
150-
adb pull /sdcard/ui_check.xml /tmp/ui_check.xml || true
151-
cat /tmp/ui_check.xml | tr '>' '>\n' | grep 'text=' | head -15
152-
done
153-
154-
echo "=== Final UI state ==="
155-
adb shell uiautomator dump /sdcard/ui_final.xml || true
156-
adb pull /sdcard/ui_final.xml /tmp/ui_final.xml || true
157-
cat /tmp/ui_final.xml | tr '>' '>\n' | grep 'text=' | head -30
112+
cat /tmp/ui1.xml | sed 's/>/>\n/g' | grep -o 'text="[^"]*"' | grep -v 'text=""'
113+
114+
echo "=== Logcat errors after launch ==="
115+
adb logcat -d | grep -iE " F " | grep -vi "DEBUG" | tail -20 || echo "no fatal logs"
116+
adb logcat -d | grep -iE "AndroidRuntime|FATAL|CRASH|ubuntuandroid" | tail -30 || echo "no crash logs"
117+
adb logcat -d | grep -iE "tech\.ula|UlaApp|ServerService|LocalServer|MissingExec|FailedExec|startSSH|execInProot|proot|busybox|setupLinks" | tail -50 || echo "no ula logs"
158118
159119
echo "=== Support directory ==="
160-
adb shell ls -la /data/data/com.scisammy.ubuntuandroid/files/support/ || echo "support dir not found"
120+
adb shell ls -la /data/data/com.scisammy.ubuntuandroid/files/support/ 2>/dev/null || echo "support dir not found"
121+
122+
echo "=== Files directory ==="
123+
adb shell ls -la /data/data/com.scisammy.ubuntuandroid/files/ 2>/dev/null || echo "files dir not found"
161124
162125
echo "=== Filesystem directories ==="
163-
adb shell find /data/data/com.scisammy.ubuntuandroid/files/ -maxdepth 2 -type d || echo "cannot list"
126+
adb shell find /data/data/com.scisammy.ubuntuandroid/files/ -maxdepth 2 -type d 2>/dev/null || echo "cannot list"
164127
165-
echo "=== Port 2022 ==="
166-
adb shell cat /proc/net/tcp | head -5 || true
128+
echo "=== Native libs check ==="
129+
adb shell ls -la /data/app/ 2>/dev/null | grep ubuntuandroid || echo "not in /data/app"
130+
adb shell pm path com.scisammy.ubuntuandroid || echo "package path not found"
167131
168132
echo "=== Processes ==="
169-
adb shell ps -ef | grep -E "proot|dropbear|busybox|sshd" || echo "no relevant processes"
133+
adb shell ps -A | grep -iE "proot|dropbear|busybox|sshd|ubuntuandroid|ula" || echo "no relevant processes"
170134
171-
echo "=== Logcat Ula tags ==="
172-
adb logcat -d | grep -iE "Ula|ServerService|LocalServer|MissingExec|FailedExec|startSSH|execInProot" | tail -80 || echo "no ula logs"
173-
174-
echo "=== Logcat errors ==="
175-
adb logcat -d | grep -iE "E " | grep -vi "chromium|DEBUG|sentry|Looper|InputMethod|Accessibility|DecorView|OpenGL|EGL" | tail -30 || echo "no errors"
135+
echo "=== Logcat all errors ==="
136+
adb logcat -d | grep " E " | grep -vi "chromium|DEBUG|sentry|Looper|InputMethod|Accessibility|DecorView|OpenGL|EGL|SurfaceFlinger|libEGL|ConfigStore|android.hardware" | tail -20 || echo "no errors"
176137
177138
echo "=== Screenshot ==="
178139
adb shell screencap -p /sdcard/screen.png || true
179140
adb pull /sdcard/screen.png /tmp/screen.png || true
180141
181142
echo "=== DONE ==="
182143
183-
- name: Upload UI dumps
184-
if: always()
185-
uses: actions/upload-artifact@v4
186-
with:
187-
name: ui-dumps
188-
path: /tmp/ui*.xml
189-
if-no-files-found: ignore
190-
191-
- name: Upload screenshot
144+
- name: Upload artifacts
192145
if: always()
193146
uses: actions/upload-artifact@v4
194147
with:
195-
name: screenshot
196-
path: /tmp/screen.png
148+
name: test-results
149+
path: |
150+
/tmp/ui*.xml
151+
/tmp/screen.png
197152
if-no-files-found: ignore

0 commit comments

Comments
 (0)