Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 30 additions & 5 deletions .github/workflows/test-native-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ jobs:
adb -s "$FIXTURE_SERIAL" shell getprop ro.build.version.sdk
# a failing suite saves its logcat; the default ring drops a suite's start.
adb -s "$FIXTURE_SERIAL" logcat -G 16M
# a system app that stops responding on the busy emulator raises a
# dialog over the fixture app, and the suites read only that window.
# android then ends the stalled app without a dialog; the suite loop
# fails a suite on the fixture app's own crash or hang.
adb -s "$FIXTURE_SERIAL" shell settings put global hide_error_dialogs 1
# a fresh image opens chrome on its first-run screen, which covers the
# auth tab the browser suite drives; chrome reads these flags from
# /data/local/tmp once it is the debug app.
Expand All @@ -187,18 +192,38 @@ jobs:
failed=()
for suite in $FIXTURE_SUITES; do
echo "::group::$suite"
adb -s "$FIXTURE_SERIAL" logcat -b all -c
if bun scripts/one-native-conformance.android.ts --device-id "$FIXTURE_SERIAL" \
evidence="$RUNNER_TEMP/fixtures/$suite"
mkdir -p "$evidence"
status=0
adb -s "$FIXTURE_SERIAL" logcat -b all -c > "$evidence/logcat-clear.txt" 2>&1 || status=$?
bun scripts/one-native-conformance.android.ts --device-id "$FIXTURE_SERIAL" \
--package-id "$FIXTURE_PACKAGE" --suite "$suite" \
--artifact-dir "$RUNNER_TEMP/fixtures/$suite"; then
--artifact-dir "$RUNNER_TEMP/fixtures/$suite" || status=$?
# error dialogs are hidden, so the fixture app's own crash or hang,
# even one after its last check passed, fails the suite from the event log.
observer_status=0
adb -s "$FIXTURE_SERIAL" logcat -d -b events -s am_crash am_anr \
> "$evidence/events.txt" 2> "$evidence/events-error.txt" || observer_status=$?
if [ "$observer_status" != 0 ]; then
echo "event log read failed: $observer_status"
status=1
else
match_status=0
# event fields begin with user id, pid, and the exact process name.
grep -E "\[[0-9]+,[0-9]+,${FIXTURE_PACKAGE//./\\.}(:[^,]+)?," \
"$evidence/events.txt" 2> "$evidence/events-match-error.txt" || match_status=$?
if [ "$match_status" != 1 ]; then
echo "fixture crash/ANR match status: $match_status"
status=1
fi
fi
if [ "$status" = 0 ]; then
echo "SUITE PASS $suite"
else
echo "SUITE FAIL $suite"
failed+=("$suite")
# what the device saw: launched intents, input and focus moves,
# touch mode and the input method's target.
evidence="$RUNNER_TEMP/fixtures/$suite"
mkdir -p "$evidence"
adb -s "$FIXTURE_SERIAL" logcat -d -v threadtime -b main,system,events,crash > "$evidence/logcat.txt" || true
adb -s "$FIXTURE_SERIAL" shell dumpsys window > "$evidence/dumpsys-window.txt" || true
adb -s "$FIXTURE_SERIAL" shell dumpsys input_method > "$evidence/dumpsys-input-method.txt" || true
Expand Down
Loading