From 6da85130efdb6604b79a19abb4ee120a98594737 Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Thu, 24 Sep 2026 23:39:52 +0000 Subject: [PATCH] e2e: dump device logcat on Android flow failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OCaml lui_* FFI exceptions and [NativeEffect] drain traces land in logcat but were never captured when a Maestro flow failed — clear the buffer per flow and dump the tail on failure. Also gate the local db-sync port wait behind LOGSEQ_CHAT_ANDROID_E2E_SKIP_DB_SYNC_WAIT so the runner self-test (which never starts a server) doesn't stall 6 minutes, and update the runner test's expected module list for the 'smoke' module. --- scripts/test-android-e2e-runner.sh | 3 ++- scripts/test-android-e2e.sh | 10 +++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/test-android-e2e-runner.sh b/scripts/test-android-e2e-runner.sh index 8c5ab2f..01416d0 100755 --- a/scripts/test-android-e2e-runner.sh +++ b/scripts/test-android-e2e-runner.sh @@ -11,7 +11,7 @@ die() { } list_output=$($runner --list) || die "Android E2E runner could not list modules" -grep -Fq "Modules: all signed-out connect capture composer autocomplete outliner hierarchy audio navigation graphs settings flashcards search rich-content youtube node-tag page-actions shortcuts sharing editor-regressions sharing-image" <<<"$list_output" \ +grep -Fq "Modules: all signed-out smoke connect capture composer autocomplete outliner hierarchy audio navigation graphs settings flashcards search rich-content youtube node-tag page-actions shortcuts sharing editor-regressions sharing-image" <<<"$list_output" \ || die "Android E2E runner did not list every module" grep -Fq "tests/e2e/android-staging-connect.yaml" <<<"$list_output" \ || die "Android E2E runner did not list the connection flow" @@ -255,6 +255,7 @@ PATH="$mock_bin:$PATH" \ LOGSEQ_CHAT_E2E_USERNAME=test-user \ LOGSEQ_CHAT_E2E_PASSWORD=test-password \ LOGSEQ_CHAT_E2E_BASE_URL=http://127.0.0.1:8787 \ + LOGSEQ_CHAT_ANDROID_E2E_SKIP_DB_SYNC_WAIT=1 \ "$runner" connect >/dev/null grep -Fxq -- '-s test-device reverse tcp:8787 tcp:8787' "$adb_args" \ || die "Android E2E runner did not expose the host-local backend to the device" diff --git a/scripts/test-android-e2e.sh b/scripts/test-android-e2e.sh index ed0799c..c7a4001 100755 --- a/scripts/test-android-e2e.sh +++ b/scripts/test-android-e2e.sh @@ -380,6 +380,7 @@ seed_android_fixture() { } if [[ -n ${LOGSEQ_CHAT_E2E_BASE_URL:-} ]] \ + && [[ ${LOGSEQ_CHAT_ANDROID_E2E_SKIP_DB_SYNC_WAIT:-0} != 1 ]] \ && [[ $LOGSEQ_CHAT_E2E_BASE_URL =~ ^(http|https)://(127\.0\.0\.1|localhost)(:([0-9]+))?([/?#]|$) ]]; then # CI builds db-sync in a background process; flows must not start before # it binds the port (a bound port returns any HTTP response, incl. 401/404). @@ -455,7 +456,14 @@ for flow in "${flows[@]}"; do -e "PASSWORD=$LOGSEQ_CHAT_E2E_PASSWORD" ) fi - MAESTRO_CLI_NO_ANALYTICS=1 maestro "${maestro_args[@]}" "$flow_path" + adb -s "$device" logcat -c >/dev/null 2>&1 || true + if ! MAESTRO_CLI_NO_ANALYTICS=1 maestro "${maestro_args[@]}" "$flow_path"; then + # OCaml lui_* FFI exceptions and [NativeEffect] drain traces land in + # logcat — dump it so a wedged pipeline is diagnosable from CI output. + echo "==> $flow failed — device logcat follows" >&2 + adb -s "$device" logcat -d -v brief 2>/dev/null | tail -n 400 >&2 || true + exit 1 + fi if [[ $flow == "$sharing_image_flow" ]]; then adb -s "$device" shell run-as "$app_id" rm -f "$app_share_image" fi