70 Commits
Author SHA1 Message Date
Davide Depau 948598d92c fix(appium-tests): make sure system dialog taps actually took
A tap that lands while a dialog is still animating in is dropped, and
the click call succeeds either way, so the test walked on believing the
dialog was dismissed. It was not: the recording shows the notification
permission dialog still covering a success screen the test then spent
two minutes failing to find, because a system dialog on top is the only
window in the accessibility tree.

Click these until the dialog is actually gone.
2026-08-16 22:31:18 +02:00
Davide Depau 4c3505039d fix(appium-tests): stop racing the job in the notification tests
Two races, same cause: the tests had to complete a slow detour through
system UI before the job outran them. The banner only exists while the
job runs, and the skip-verification button only during verification, so
on CI the job was often over first.

Give both jobs room to outlast the detour, and drop the skip click from
these two -- they are about the banner, and test_skip_verification
already covers the button, so waiting for success removes the second
race entirely.

Lower the image size cap as well: with seconds-based windows, a fast
host turns a longer window into gigabytes of pointless I/O, while CI
stays far below the cap.
2026-08-16 21:54:48 +02:00
Davide Depau 2605ba04ce fix(appium-tests): re-find the notifications button after the permission dialog
Returning from the system dialog recomposes the banner, so the saved
element reference is stale by the time it is clicked again.
2026-08-16 19:40:54 +02:00
Davide Depau 99965a7f3c fix(appium-tests): don't let the lay-flat wait eat the write phase
On CI the sheet auto-proceeds -- the emulated gravity sensor reads flat
and the job starts on its own -- so waiting the full timeout for a
button that is already gone burned 15-30s of a ~28s job. The test then
went looking for a write phase that had already finished, which is why
the unplug tests failed while their job ran to a clean FINISHED.

Wait briefly instead: confirm_write_image already established that the
sheet was up, so the button is either there now or the job is running.
2026-08-16 19:40:49 +02:00
Davide Depau 6d0fa6b0c2 fix(appium-tests): run the write-speed calibration once per session
A fixture imported into two test modules becomes two definitions with
separate caches, so the session-scoped calibration write ran once per
module -- about 70s wasted on CI. Re-export it from conftest instead.
2026-08-16 17:39:39 +02:00
Davide Depau 8216fc91d1 fix(appium-tests): stop waiting 50s for a USB dialog Android never shows
Android often grants USB permission silently, so waiting out the dialog
timeout on every attempt burned ~150s per test on CI and left the
confirmation screen in a state where the next tap was dropped, so the
job never started at all. Keep the retry, but make the dialog wait
short: the grant button disappearing is the real signal that permission
landed, however it was granted.

Verify the 'write image' tap took as well, by waiting for what must
follow it -- the lay-flat sheet, or the progress screen when the sheet
auto-proceeds on a device with a working gravity sensor.
2026-08-16 17:39:34 +02:00
Davide Depau 608695d500 fix(appium-tests): pass unmap flags when re-adding drives
Mirrors the boot-time attach in scripts/vm-config.sh: without them a
re-plugged drive allocates its zero writes for real, and the qcow2
balloons until the host disk fills and QEMU pauses the VM.
2026-08-16 16:20:13 +02:00
Davide Depau c678633bdd fix(appium-tests): wait for real enumeration and always restore the stick
Poll dumpsys usb after a hot-plug instead of sleeping a fixed 2s: the
framework's view is what the app sees, and a fixed sleep loses the race
on slow hosts, so the flow started while the detach had been processed
but not the attach.

Restore the original drive when a setup or reconnect step fails. A
fixture that fails during setup never runs its teardown, so one failure
left every later test with no USB drive at all.

Also drop the over-sized unplug images: both unplugs happen in
different phases (one during the write, one during verification), so
one window is enough, and the bigger job pushed wait_for_success past
its 120s cap because each resume replays work.
2026-08-16 16:20:07 +02:00
Davide Depau f21a74000c fix(appium-tests): retry taps that get swallowed during activity transitions
The USB permission tap is dropped if it lands while the confirmation
activity is still settling, leaving the app with no permission request
at all and the test staring at a screen that will never change.

The lay-flat skip button needs a retry on stale for the same reason:
the sheet moves under the tap while animating in, and on CI no gravity
sensor ever fires the sheet's onReady, so nobody else will.
2026-08-16 16:20:00 +02:00
Davide Depau deb8538c93 fix(appium-tests): re-tap 'Write an image' if the file picker did not open
The tap is occasionally swallowed when a USB hot-plug recomposes the
device list under it, leaving the harness waiting for a picker that
never opened.
2026-08-16 14:36:17 +02:00
Davide Depau df96ab45fd fix(appium-tests): give the USB permission dialog a real timeout after replug
Re-enumeration and the system permission dialog can lag several
seconds while the guest is under heavy write I/O; the previous 1s
wait made the unplug tests flaky.
2026-08-16 14:35:57 +02:00
Davide Depau 18d09ef762 feat(appium-tests): speed-scale the qemu tests and generate random data on-device
Apply the measured-speed image sizing to the unplug tests, and
replace the fixed 10 MB pushed payload with dd from /dev/urandom on
the device: pushing speed-scaled amounts of data through Appium as
base64 would take longer than the test itself. Written data is now
verified via sha256 instead of a byte-for-byte payload comparison,
and the host-side raw target image is sized to match (sparse: a
zeroed target cannot false-match a random source).
2026-08-16 14:35:37 +02:00
Davide Depau 8a462f377b feat(appium-tests): size test images from a measured write speed
Emulated USB speed varies by orders of magnitude between hosts, and
fixed image sizes made the timing-sensitive tests flaky: on a fast
host the write finished before the harness could click the skip
verification button.

Measure the drive's throughput once per session with a small
app-driven speedtest write, timed from the app's own logcat
timestamps so UI latency cannot skew it, and size each generic test's
image so the write phase lasts TARGET_WRITE_SECONDS (env-tunable).
The calibration flow retries once, absorbing a known first-boot file
picker flake that would otherwise error every test in the session.
2026-08-16 14:35:19 +02:00
Davide Depau 2e932651de feat(appium-tests): grow the USB stick without ballooning its qcow2
Speed-scaled test images (next commit) reach multiple GB, so the 2G
stick is too small. The qcow2 is sparse and recreated on every VM
start, so the size costs nothing up front; discard=unmap and
detect-zeroes=unmap keep the mostly-zero test images from allocating
real host disk space, which previously filled the disk and made QEMU
pause the VM on ENOSPC.
2026-08-16 14:35:09 +02:00
Davide Depau 549018d2f5 fix(appium-tests): replace the uhci slow path with ehci
The LineageOS guest kernels ship no uhci_hcd (neither x86_64 nor
arm64), so uhci-attached devices never enumerate and the slow-bus
tests fail before the app ever sees the drive. Use an EHCI controller
instead, which both kernels support.

The default stick moves to ehci too: its moderate emulated throughput
keeps UI interaction windows wide. QEMU_USB_BUS must match the bus the
stick boots on, or the replug tests re-add the device on a different
controller than they removed it from, and the guest takes tens of
seconds to notice the new device.
2026-08-16 14:03:37 +02:00
Davide Depau 875c885c32 fix(appium-tests): tolerate the lay-flat sheet auto-proceeding mid-click 2026-08-15 23:58:22 +02:00
Davide Depau b428a492c5 feat(appium-tests): make CI recordings navigable 2026-08-15 22:35:05 +02:00
Davide Depau fc7eb9bc85 fix(appium-tests): don't abort under set -e when GL is off 2026-08-15 22:26:43 +02:00
Davide Depau 4ff825e153 fix(appium-tests): use virtio-vga on x86_64
virtio-vga is virtio-gpu plus VGA compatibility and exists only on x86;
arm's virt machine has none, so it needs the plain PCI device. Using
virtio-gpu-pci on x86 left the display frozen from the moment the kernel
took over scanout from UEFI, so CI recordings stopped at the GRUB handoff
even though the guest booted and the tests ran.
2026-08-15 21:55:35 +02:00
Davide Depau 71f9e0621f fix(appium): unbound localhost host on macos 2026-08-15 21:51:39 +02:00
Davide Depau bdf16f60d9 fix(appium-tests): share the ephemeral disk reset with CI
Creating the throwaway overlays lived inside run-vm.sh, but that script is
only the local entry point: in CI qemu-kvm-action starts QEMU itself, so it
was handed disk paths that nothing had created. Moves the logic into
vm_reset_disks in vm-config.sh, which both entry points already source.

The reset has to run after the guest images are in place, and must not end
up in any cache: the overlays are throwaway, so restoring them would carry
stale guest state into the next run and quietly undo the ephemerality the
suite depends on.
2026-08-15 20:49:02 +02:00
Davide Depau 4b46223dc6 refactor(appium-tests): split the QEMU flags the action supplies itself
qemu-kvm-action always builds -cpu, -m, -smp and -enable-kvm from its own
inputs, so a flags list that also carries them produces a command line with
each specified twice, where which one wins depends on argument order.

Separates them into VM_ACCEL_FLAGS, which run-vm.sh passes and CI leaves to
the action's inputs, from VM_QEMU_FLAGS, which is the shared device list and
is safe for both. -machine stays in the shared list because the action has
no input for it.
2026-08-15 20:30:36 +02:00
Davide Depau d3d1174fff fix: use wait-until-ready for tradeinmode commands 2026-08-15 20:25:33 +02:00
Davide Depau 8386bd5e5a feat(appium-tests): pick the display per platform and open a viewer on macOS
The display backend defaulted to `none`, which meant a local run showed
nothing at all. The options genuinely differ per platform, so default them
rather than making everyone remember: Linux has `sdl`, which opens its own
window and takes gl=on; macOS QEMU from Homebrew has neither sdl nor gtk,
and `cocoa` needs OpenGL that build lacks -- under it SurfaceFlinger
SIGABRTs in a loop and nothing ever draws -- so macOS uses VNC and this
opens Screen Sharing against it automatically. GL follows the same
reasoning: on for local Linux, off under CI and on macOS.

Stopping the viewer needed the final QEMU invocation to stop being an
`exec`, which replaced the shell and left nothing able to clean up
afterwards. QEMU now runs as a child that is waited on, so the EXIT trap
fires on a normal exit and on Ctrl-C alike while still propagating QEMU's
status.

Screen Sharing is one shared app for every session and exposes no
scriptable window list, so closing just our window is not possible. It is
quit only when this run is what launched it, leaving sessions the user
already had open alone. VM_VIEWER=0 opts out entirely.
2026-08-15 19:54:28 +02:00
Davide Depau 1797883b77 feat(appium-tests): bypass Android 16 trade-in mode on startup
An ephemeral VM always boots unprovisioned, and Android 16 then runs adbd
in trade-in mode: the transport looks healthy and advertises shell_v2, but
every command except `tradeinmode` is refused with "error: closed".

wait-vm-startup.sh now waits for a usable transport rather than merely a
connected one, detects the condition, and escapes it with the single
command trade-in mode permits -- `tradeinmode evaluate` -- before marking
the device provisioned, which is what actually turns trade-in mode off.
All steps are idempotent, so it is a no-op on a provisioned guest.
2026-08-12 23:24:47 +02:00
Davide Depau c2ff510c00 feat(appium-tests): replace Bliss OS with LineageOS, multi-arch and ephemeral
Bliss OS is x86_64-only, so the e2e VM couldn't run on Apple Silicon at
all: there is no hardware virt for x86 guests, and QEMU disables MTTCG for
a strongly-ordered guest on a weakly-ordered host, so it would be
single-threaded TCG regardless of -smp.

Switch to LineageOS 23.2 packaged for upstream QEMU, which ships the same
image for arm64 and x86_64. vm-config.sh now derives the qemu binary,
machine, accel and cpu from VM_GUEST_ARCH (default: the host's, the only
case that gets hardware acceleration) and locates UEFI firmware across
Homebrew, Debian and Fedora layouts. The guest boots from disk over UEFI,
so kernel/initrd/cmdline are gone.

The VM is now ephemeral: run-vm.sh branches fresh qcow2 overlays off the
pristine bases on every start, so guest state never persists and tests
cannot leak into each other. Note efi_vars.fd is itself a sparse qcow2
whose virtual size matches the pflash unit, so it must be attached as
qcow2 rather than raw.
2026-08-12 23:24:47 +02:00
Davide Depau 1bf2e9975e test(appium): scale element waits in CI 2026-08-12 16:31:40 +02:00
Davide Depau d13b7ab6c4 ci: drop host GL unless the host has a real GPU 2026-08-12 15:45:18 +02:00
Davide Depau c1dc3169dc refactor(appium-tests): extract shared VM config into vm-config.sh 2026-08-12 15:23:49 +02:00
Davide Depau c0817eb8ba fix(appium-tests): read QEMU_USB_SLOW_BUS for the slow USB bus 2026-08-12 15:18:05 +02:00
Davide Depau 02c431a0ed feat: use more concise python exception logs 2026-06-30 23:29:13 +02:00
Davide Depau 6cbf00872a feat: custom pytest report for e2e test failures with logcat 2026-06-30 23:20:20 +02:00
Davide Depau d042342cb1 feat: add logcat filtering and denoising 2026-06-30 23:04:32 +02:00
dependabot[bot] 3e80405651 Bump idna from 3.10 to 3.15 in /appium-tests
Bumps [idna](https://github.com/kjd/idna) from 3.10 to 3.15.
- [Release notes](https://github.com/kjd/idna/releases)
- [Changelog](https://github.com/kjd/idna/blob/master/HISTORY.md)
- [Commits](https://github.com/kjd/idna/compare/v3.10...v3.15)

---
updated-dependencies:
- dependency-name: idna
  dependency-version: '3.15'
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-28 19:03:50 +02:00
dependabot[bot] 561c70f5c8 Bump urllib3 from 2.6.3 to 2.7.0 in /appium-tests
Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.6.3 to 2.7.0.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/2.6.3...2.7.0)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-version: 2.7.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-13 21:25:43 +02:00
dependabot[bot] f9d8b9d6b2 Bump fast-uri from 3.1.0 to 3.1.2 in /appium-tests
Bumps [fast-uri](https://github.com/fastify/fast-uri) from 3.1.0 to 3.1.2.
- [Release notes](https://github.com/fastify/fast-uri/releases)
- [Commits](https://github.com/fastify/fast-uri/compare/v3.1.0...v3.1.2)

---
updated-dependencies:
- dependency-name: fast-uri
  dependency-version: 3.1.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-11 14:03:07 +02:00
Davide Depau 32c2090e5b fix: pin appium version 2026-04-30 15:59:13 +02:00
Davide Depau 6d4271dfa8 test: add debug logs 2026-04-30 14:50:57 +02:00
Davide Depau 48205cde2d test: fix tests for recent Appium versions 2026-04-30 14:50:46 +02:00
Davide Depau 68f43a9a9b docs: Explain how to install appium 2026-04-30 01:03:50 +02:00
Davide Depau 34e4f16983 chore: Update development instructions 2026-04-30 00:48:40 +02:00
Davide Depau 3d79e05c4f ci: Move VM preparation to separate scripts 2026-04-30 00:16:43 +02:00
dependabot[bot] 6873618e66 Bump pygments from 2.19.1 to 2.20.0 in /appium-tests
Bumps [pygments](https://github.com/pygments/pygments) from 2.19.1 to 2.20.0.
- [Release notes](https://github.com/pygments/pygments/releases)
- [Changelog](https://github.com/pygments/pygments/blob/master/CHANGES)
- [Commits](https://github.com/pygments/pygments/compare/2.19.1...2.20.0)

---
updated-dependencies:
- dependency-name: pygments
  dependency-version: 2.20.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-19 23:24:51 +02:00
dependabot[bot] 60a5528628 Bump urllib3 from 2.3.0 to 2.6.3 in /appium-tests
Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.3.0 to 2.6.3.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/2.3.0...2.6.3)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-version: 2.6.3
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-19 23:24:36 +02:00
dependabot[bot] f9d1237917 Bump h11 from 0.14.0 to 0.16.0 in /appium-tests
Bumps [h11](https://github.com/python-hyper/h11) from 0.14.0 to 0.16.0.
- [Commits](https://github.com/python-hyper/h11/compare/v0.14.0...v0.16.0)

---
updated-dependencies:
- dependency-name: h11
  dependency-version: 0.16.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-19 23:24:04 +02:00
dependabot[bot] 3d23de862e Bump pytest from 8.3.5 to 9.0.3 in /appium-tests
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.3.5 to 9.0.3.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.3.5...9.0.3)

---
updated-dependencies:
- dependency-name: pytest
  dependency-version: 9.0.3
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-19 23:22:34 +02:00
Davide Depau 8c3000774d gha: Increase adb timeout time 2025-04-04 17:54:26 +02:00
Davide Depau cbe08d6922 gha: Show pointer location in VM recording 2025-04-04 17:54:26 +02:00
Davide Depau 39c03ca0b4 appium: Reduce image sizes to speed up tests 2025-04-04 17:54:26 +02:00
Davide Depau 9002df11af appium: Wait longer for selecting first device if using open_file
test_image_too_large sometimes fails when it's not given enough time to
wait to select the USB device.
2025-04-04 17:54:26 +02:00