automate_observation: add --serial to target specific devices - #33
Merged
Merged
Conversation
Add a repeatable -s/--serial flag so that callers (and the upcoming web UI helper) can choose which connected devices to observe instead of always iterating over every device listed by `adb devices`. - Selected devices are processed in the order given; duplicates are ignored. - A requested serial that is not connected is logged, reported as FAILED in the final summary with a dedicated message, and causes exit code 1. Remaining requested devices are still observed. - The "More than 1 device connected!" warning is only emitted when --serial is not used. - Without --serial, behaviour, log text and exit codes are unchanged. - This also applies when no device is connected at all (or `adb devices` fails): with --serial, the "No devices connected!" early return is skipped so the requested serials are reported as FAILED. Selection logic lives in a new pure helper, select_target_devices(), covered by unit tests alongside end-to-end main() tests. Change-Id: I9f3fc21eb1b85b9fda4fa0a5c5b4da95322f3091
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.
Add a repeatable -s/--serial flag so that callers (and the upcoming web UI helper) can choose which connected devices to observe instead of always iterating over every device listed by
adb devices.adb devicesfails): with --serial, the "No devices connected!" early return is skipped so the requested serials are reported as FAILED.Selection logic lives in a new pure helper, select_target_devices(), covered by unit tests alongside end-to-end main() tests.
Change-Id: I9f3fc21eb1b85b9fda4fa0a5c5b4da95322f3091