fix(harness): provision the TV AVD when the phone AVD is refused - #177
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The change is narrowly scoped, preserves failure signaling, and is backed by a contract test that covers the reported mismatch scenario.
Review effort: Lite
Findings: None
What changed in this PR
This PR fixes a bootstrap edge case in the emulator harness: when creating the putio-phone AVD is refused due to a system-image mismatch, bootstrap now still provisions the putio-tv AVD so TV harness workflows can run even while the phone AVD requires manual recovery.
Changes:
- Add
provision_avds()to provision phone and TV AVDs independently, collecting failures and failing the run only after attempting both. - Update
scripts/bootstrap.shto useprovision_avds(preserving non-zero exit on any refused profile). - Extend emulator contract tests to cover the “mismatched phone must not block TV creation” scenario and document harness AVD ownership expectations.
| File | Description |
|---|---|
| scripts/test-emulator.sh | Adds a contract test ensuring TV AVD creation proceeds even when phone provisioning is refused, and verifies expected recovery messaging. |
| scripts/lib.sh | Introduces provision_avds() that attempts phone and tv provisioning independently and reports which profiles failed. |
| scripts/bootstrap.sh | Switches from a sequential provisioning loop to provision_avds, ensuring TV provisioning is attempted even if phone is refused. |
| docs/harness.md | Clarifies bootstrap behavior on mismatched AVDs and documents which AVDs the harness owns/leaves untouched. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Refs #176
On a machine whose
putio-phoneAVD predates the API 37 Google Play image,scripts/bootstrap.shexits at the phone's image-mismatch refusal before it reaches the TV profile, soputio-tvis never created andemulator.sh boot tvfails with "AVD putio-tv does not exist". Bootstrap now provisions each profile independently: a refused profile still prints its recovery command and fails the run, but the other profile is created. The harness doc also states which AVDs the harness owns, so unrelated or unloadable AVDs on the machine are expected to stay untouched.The new fake-SDK contract case fails when provisioning stops at the first refusal and passes with this change. On an Apple Silicon Mac with a stale API 36
putio-phone,main's bootstrap exited without creatingputio-tv; this branch createdputio-tv(android-36;android-tv;arm64-v8a), still exited 1 with the phone recovery command, andemulator.sh boot tv --headlessbooted it (API 36, arm64-v8a, leanback) beforestopshut it down.The Google TV profile from #176 is not part of this change.