From 9888a7d0f941c2fccfaa01e171cb476d165b2a11 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Mon, 28 Sep 2026 08:50:56 +0000 Subject: [PATCH] docs: describe running the Android integration tests Updates tailscale/tailscale#15660 --- cmd/hi/README.md | 20 ++++++++++++++++++++ integration/README.md | 5 ++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/cmd/hi/README.md b/cmd/hi/README.md index c6485b032..99821946d 100644 --- a/cmd/hi/README.md +++ b/cmd/hi/README.md @@ -148,6 +148,26 @@ docker ps --filter "label=hi.run-id=20260409-104215-mdjtzx" The run ID appears at the top of the `hi run` output — copy it from there rather than trying to reconstruct it. +## Android tests + +`TestAndroid*` (in `integration/android/`) boot the official Tailscale +Android app in an emulator. They need an x86_64 Docker host exposing +`/dev/kvm` (`hi doctor` warns when it is missing) and skip unless an +APK is given: + +```bash +export HEADSCALE_INTEGRATION_ANDROID_APK=https://pkgs.tailscale.com/stable/tailscale-android-universal-1.102.4.apk +go run ./cmd/hi run "^TestAndroid" --failfast=false +``` + +The APK may also be an absolute path under the repository. +`HEADSCALE_INTEGRATION_ANDROID_UPGRADE_FROM` names an older APK for +`TestAndroidUpgrade` to start from; it must share the APK's signing key. The first +run builds `Dockerfile.android-integration` (SDK + system image, ~13 GB); +set `HEADSCALE_INTEGRATION_ANDROID_IMAGE` to reuse a pre-built one. On +UI failures the run saves `android-*-missing-*.png`/`.xml` (screenshot +and uiautomator dump) and `android-*.logcat.log` to the artefacts dir. + ## Artefacts Every run saves debugging artefacts under `control_logs/{runID}/`: diff --git a/integration/README.md b/integration/README.md index b3089a061..1f5e470c1 100644 --- a/integration/README.md +++ b/integration/README.md @@ -34,7 +34,7 @@ regenerated `test-integration.yaml`. ## Framework overview -The integration framework has four layers: +The integration framework has these layers: - **`scenario.go`** — `Scenario` orchestrates a test environment: a Headscale server, one or more users, and a collection of Tailscale @@ -43,6 +43,9 @@ The integration framework has four layers: server in Docker. Options for config, DB backend, DERP, OIDC, etc. - **`tsic/`** — "Tailscale Integration Container": wraps a single Tailscale client. Options for version, hostname, auth method, etc. +- **`androidic/`** — "Android Integration Container": the official + Tailscale Android app in an emulator, driven over adb/uiautomator. + Tests live in `android/`; see `cmd/hi/README.md` for requirements. - **`dockertestutil/`** — low-level Docker helpers (networks, container lifecycle, `IsRunningInContainer()` detection).