Skip to content

Commit 61e7183

Browse files
committed
test: lock reusable Android AVD cache contract
1 parent 40dddc5 commit 61e7183

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env python3
2+
from pathlib import Path
3+
4+
ROOT = Path(__file__).resolve().parents[1]
5+
workflow = (ROOT / ".github/workflows/native-android-route-reader.yml").read_text(encoding="utf-8")
6+
prime = (ROOT / "scripts/prime_android_lab_adb.sh").read_text(encoding="utf-8")
7+
8+
# The emulator image/snapshot is a Lab infrastructure artifact. It must not be
9+
# invalidated whenever an official Nuvio app commit advances; the app is built
10+
# and installed after the AVD is available.
11+
assert "avd-v3-${{ runner.os }}-mobile-api35-google_apis-x86_64-pixel_2" in workflow
12+
assert "avd-v3-${{ runner.os }}-tv-api31-android-tv-x86-tv_1080p" in workflow
13+
for line in workflow.splitlines():
14+
if "key: avd-v3-" in line:
15+
assert "needs.resolve.outputs.mobile_sha" not in line
16+
assert "needs.resolve.outputs.tv_sha" not in line
17+
assert "needs.resolve.outputs.runtime_fingerprint" not in line
18+
19+
# Every Android emulator path primes adb before the emulator action. This
20+
# addresses the observed hosted-runner failure where emulator startup reported
21+
# no adb daemon on port 5037 before a cold boot was terminated.
22+
assert workflow.count("bash niakvio/scripts/prime_android_lab_adb.sh") >= 3
23+
assert "adb kill-server" in prime
24+
assert "adb start-server" in prime
25+
assert "adb devices" in prime
26+
assert "runtime_mutation=false" in prime
27+
28+
print("native Android AVD cache + adb bootstrap contract passed")

0 commit comments

Comments
 (0)