Skip to content

Test gha gateway#858

Open
linxinan-yt wants to merge 7 commits into
youtube:mainfrom
linxinan-yt:test_gha_gateway
Open

Test gha gateway#858
linxinan-yt wants to merge 7 commits into
youtube:mainfrom
linxinan-yt:test_gha_gateway

Conversation

@linxinan-yt

@linxinan-yt linxinan-yt commented Jul 7, 2026

Copy link
Copy Markdown
Member

@linxinan-yt
linxinan-yt requested a review from a team as a code owner July 7, 2026 04:58
@linxinan-yt
linxinan-yt requested review from andrewsavage1 and removed request for a team July 7, 2026 04:58
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

🤖 Gemini Suggested Commit Message


build: Support browser tests in GHA gateway

Update the on-device tests gateway client to process browser tests
similarly to unit tests. This change enables host dependency
packaging for Android browser tests and adds the ability to provide
explicit gtest filters via the command line.

Additionally, update Android test target configurations to use the
gtest type for browser tests and remove JUnit test targets that are
no longer required for this flow.

Bug: 483488213

💡 Pro Tips for a Better Commit Message:

  1. Influence the Result: Want to change the output? You can write custom prompts or instructions directly in the Pull Request description. The model uses that text to generate the message.
  2. Re-run the Generator: Post a comment with: /generate-commit-message

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the test target configurations for Android, removing JUnit tests and changing the test type of cobalt_browsertests to gtest. It also updates the on-device tests gateway client to support browser tests and explicit gtest filters. The review feedback highlights critical issues with target-specific arguments accumulating across loop iterations due to shared list references. Additionally, the reviewer advises against hardcoding target-specific filters and test-type overrides in the Python client, recommending more maintainable, configuration-driven approaches instead.

Comment on lines +243 to 245
if test_type in ('unit_test', 'browser_test'):
if not device_type or not device_pool:
raise ValueError('Dimensions not specified: device_type, device_pool')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The test_args list is mutated inside the loop (via test_args.extend(...)) without being copied or re-initialized per target. This causes target-specific arguments (like test_attempts) to accumulate across iterations and results in all targets sharing the same list reference.\n\nCopying test_args at the start of the block ensures each target gets its own independent list of arguments.

    if test_type in ('unit_test', 'browser_test'):\n      test_args = list(test_args)\n      if not device_type or not device_pool:\n        raise ValueError('Dimensions not specified: device_type, device_pool')

Comment on lines +279 to 281
elif test_type in ('e2e_test', 'yts_test', 'yts_wpt_test'):
test_target = target_data['target']
test_attempts = target_data.get('test_attempts', '')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

Similarly to the unit_test/browser_test block, test_args should be copied here to prevent target-specific arguments from accumulating across iterations and to avoid sharing the same list reference across all targets.

    elif test_type in ('e2e_test', 'yts_test', 'yts_wpt_test'):\n      test_args = list(test_args)\n      test_target = target_data['target']\n      test_attempts = target_data.get('test_attempts', '')

Comment on lines +164 to +165
if target_name == 'cobalt_browsertests':
return 'ContentMainRunnerImplBrowserTest.StartupSequence'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Hardcoding the gtest filter for cobalt_browsertests directly in the Python client code bypasses the filter JSON file mechanism and reduces flexibility.\n\nInstead of hardcoding this in Python, consider defining this filter in a dedicated filter JSON file (e.g., cobalt_browsertests_filter.json under the filter directory) so that it can be managed consistently with other test targets.

Comment on lines +276 to +277
if 'cobalt_browsertests' in target_name:
test_type = 'browser_test'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Hardcoding a target-name-based check ('cobalt_browsertests' in target_name) to override the test_type to 'browser_test' is a maintainability concern.\n\nThis hack is introduced because the test type for cobalt_browsertests was changed from "browsertest" to "gtest" in test_targets.json. If we instead keep a distinct test type (e.g., "browser_test") in the JSON configuration and map it appropriately in the runner, we can avoid hardcoding specific target names in the Python client.

@linxinan-yt
linxinan-yt requested a review from a team as a code owner July 8, 2026 00:29
…tdout and stderr to test_results.txt inside MH_GEN_FILE_DIR so that Mobile Harness client plugin can upload the log file (cobalt_browsertests_log.txt) to GCS.
…DIR so Mobile Harness GCS uploader plugin can upload test log
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.

1 participant