fix(perf): preflight the Android Release fixture and automate its install

Merged
TH
5d ago
+437-17

Summary

A benchmark emulator that held a dev-client build of com.callstack.agentdevicelab produced garbage timings and opaque failures: the deep links the suites drive do nothing in a dev client. pnpm perf and pnpm bench:android:automation now run a preflight before the first timed sample. It reads adb shell dumpsys package and fails with one line that names pnpm test-app:android:fixture --serial <serial>, the new command that automates the recipe scripts/perf/README.md documented by hand: resolve the fingerprint artifact name, download a trusted artifact into fresh empty directories, repack with the current JS, adb install -r, then re-check. It reuses the .github/actions/setup-fixture-app owners; downloaded archives are treated as untrusted data.

Scope expansion: the repack's signer check only parsed the build-tools ≤36 apksigner label, so a local repack with build-tools 37 was rejected. Its regex now matches both label shapes.

Before / after

$ pnpm bench:android:automation . .tmp/bench.json   # dev-client build
- AssertionError: The current test-app Checkout form must expose field-email
+ Android fixture preflight: com.callstack.agentdevicelab on emulator-5560 is a debuggable build, not the Release fixture. Install it: pnpm test-app:android:fixture --serial emulator-5560

$ pnpm test-app:android:fixture --serial emulator-5560
+ Release fixture fingerprint.22184ce….android installed on emulator-5560

Validation

Head b3de676b3b, emulator-5560 (API 37). Preflight failed on the dev build, passed after the install. pnpm build && pnpm build:android, then BENCH_ROUNDS=5 pnpm bench:android:automation: open p50 2087 ms, restart 1301, observe 38, tap 71, fill 322, screenshot 90. pnpm perf --platform android --scenarios lifecycle --rounds 3 exited 0. scripts/perf/fixture-preflight.test.ts (8) and pnpm test:fixture-cache (16) pass; the new repack cases fail without the fix. CI owns the rest.


Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.