Skip to content

Add support for an env_str in mobly#1004

Open
hongyu-wang wants to merge 2 commits intogoogle:masterfrom
hongyu-wang:environment-support
Open

Add support for an env_str in mobly#1004
hongyu-wang wants to merge 2 commits intogoogle:masterfrom
hongyu-wang:environment-support

Conversation

@hongyu-wang
Copy link
Copy Markdown

This CL adds an env field to snippet_client_v2.Config, allowing users to prepend environment variables or command wrappers to the am instrument command used to start snippet servers.

am_instrument_options: Dict[str, str] = dataclasses.field(
default_factory=dict
)
env: str = ''
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please place the new arg env after the existing arg user_id to avoid breaking existing users.

other purposes may not take effect and you should use snippet RPCs. This
is because Mobly snippet runner changes the subsequent instrumentation
process.
env: A string of prefix options (e.g., environment variables or command
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also adjust the position of env in docstring.

@mhaoli
Copy link
Copy Markdown
Collaborator

mhaoli commented May 6, 2026

Please fix the format issue by following this doc: https://github.com/google/mobly/blob/master/CONTRIBUTING.md#code-style

@mhaoli
Copy link
Copy Markdown
Collaborator

mhaoli commented May 6, 2026

This is duplicated with PR #1008 and the implementation in PR #1008 is slightly better than this.

So I'll merge that #1008 if the comment in that PR is resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants