automate_observation: report manual-intervention prompts in --events - #35
Merged
Merged
Conversation
Two steps wait for a person: the manual Hubble install on Xiaomi
phones (Enter on stdin) and the `adb backup` confirmation (on the
device). A parent process could see neither. Report each as a new
`prompt` event {device, kind, message, expects_input}, always followed
by `prompt_resolved` with an `outcome` (done, failed, stdin_closed,
interrupted, ...). Kinds: xiaomi_manual_install (write a newline to
stdin to continue) and adb_backup_confirm (nothing to send).
If stdin closes during the Xiaomi wait, the device now fails with
reason stdin_closed and the run continues, logging a plain error
instead of an "Unexpected error" traceback (exit code still 1).
New event types only, so v stays 1. Without --events, log text and
exit codes are unchanged except for the stdin-closed case, and the
Xiaomi wait's log lines now show wait_for_xiaomi_manual_install() as
their function name.
Test:
- pytest uraniborg/scripts/python/tests/: 129 passed (13 new; one
existing test gained events=None in its expected calls).
- Live on an Android 14 emulator with the Xiaomi path forced: stdin
closed (outcome stdin_closed, device fails), and a driver that
answers the prompt by installing Hubble and writing a newline
(outcome done, success).
Change-Id: I57712611e0c27fec5ed284da7d9a78838abe3b41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two steps wait for a person: the manual Hubble install on Xiaomi phones (Enter on stdin) and the
adb backupconfirmation (on the device). A parent process could see neither. Report each as a newpromptevent {device, kind, message, expects_input}, always followed byprompt_resolvedwith anoutcome(done, failed, stdin_closed, interrupted, ...). Kinds: xiaomi_manual_install (write a newline to stdin to continue) and adb_backup_confirm (nothing to send).If stdin closes during the Xiaomi wait, the device now fails with reason stdin_closed and the run continues, logging a plain error instead of an "Unexpected error" traceback (exit code still 1). New event types only, so v stays 1. Without --events, log text and exit codes are unchanged except for the stdin-closed case, and the Xiaomi wait's log lines now show wait_for_xiaomi_manual_install() as their function name.
Test:
Change-Id: I57712611e0c27fec5ed284da7d9a78838abe3b41