Skip to content

Conversation

@isarkis
Copy link
Member

@isarkis isarkis commented May 28, 2025

b/416339892

Copy link
Contributor

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

Choose a reason for hiding this comment

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

Hello @isarkis, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

Summary of Changes

Hello team, gemini-code-assist here to provide a summary of this pull request. This PR introduces support for running 'Vega' tests, specifically integrating them into the GitHub Actions CI/CD pipeline as End-to-End (E2E) tests. It achieves this by adding a new composite GitHub Action dedicated to triggering these Vega E2E tests via an existing test gateway client script. Additionally, it updates the existing on-device test action to accept a device type parameter and modifies the Android build configurations (android-arm and android-arm64) to specify the device type and, for android-arm64, enable the new E2E tests and define initial test targets.

Highlights

  • New Vega E2E Test Action: A new composite GitHub Action (.github/actions/e2e_tests/action.yaml) is added to specifically handle the triggering of 'vega_test' type E2E tests using the on_device_tests_gateway_client.py script. This action takes inputs for test dimensions, device type, and Vega test targets.
  • Update to On-Device Test Action: The existing composite GitHub Action for on-device tests (.github/actions/on_device_tests/action.yaml) is updated to accept a test_e2e_device_type input and pass it as the --device_type argument to the test gateway client script.
  • Android Configuration Updates: The configuration files for Android builds (.github/config/android-arm.json and .github/config/android-arm64.json) are updated. Both now specify the test_e2e_device_type as 'android'. The android-arm64 config also enables test_e2e and adds an initial list of e2e_test_targets, including browse:infra_smoke_test.

Changelog

Click here to see the changelog
  • .github/actions/e2e_tests/action.yaml
    • Added new composite GitHub Action for running Vega E2E tests.
    • Defines inputs for test dimensions, device type, and Vega targets.
    • Includes steps for installing requirements, generating gRPC files, setting up gcloud, and triggering tests via on_device_tests_gateway_client.py with --test_type "vega_test" and --vega_targets.
  • .github/actions/on_device_tests/action.yaml
    • Added test_e2e_device_type as a required input (line 16-18).
    • Passed the test_e2e_device_type input as the --device_type argument to the on_device_tests_gateway_client.py script (line 67).
  • .github/config/android-arm.json
    • Added test_e2e_device_type set to "android" (line 7).
  • .github/config/android-arm64.json
    • Added test_e2e_device_type set to "android" (line 7).
    • Added test_e2e set to true (line 8).
    • Added e2e_test_targets array including "browse:infra_smoke_test" (line 18-20).
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.


New tests arrive, a Vega star,
Through actions run, both near and far.
Configs updated, green lights gleam,
Automated, a coder's dream.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

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

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 introduces support for Vega E2E tests by adding a new GitHub Action workflow (.github/actions/e2e_tests/action.yaml) and updating an existing one (.github/actions/on_device_tests/action.yaml) along with related configuration files. The changes are well-structured and seem to effectively integrate the new testing capabilities. I have one suggestion for improving clarity in the new action's inputs.

Summary of Findings

  • Input Description Clarity: In .github/actions/e2e_tests/action.yaml, the input e2e_test_targets has an inaccurate description that appears to be copied from another input. This should be corrected to reflect its actual purpose.

Merge Readiness

The pull request is largely in good shape and introduces valuable new E2E testing capabilities. However, there is a medium-severity issue regarding the clarity of an input description in the new GitHub Action. I recommend addressing this to improve the maintainability and usability of the action. As I am an AI, I am not authorized to approve pull requests; please ensure further review and approval from authorized team members before merging. Addressing the identified issue would be beneficial prior to merging.

@isarkis
Copy link
Member Author

isarkis commented May 28, 2025

gemini /review

@gemini-code-assist
Copy link
Contributor

Acknowledged the /gemini review command. I have completed the code review for this pull request. Please check the "Files changed" tab for detailed review comments and suggestions.

@isarkis
Copy link
Member Author

isarkis commented May 28, 2025

gemini /review

@gemini-code-assist
Copy link
Contributor

Acknowledged the /gemini review command. I am performing another code review for this pull request. Please check the "Files changed" tab for detailed review comments and suggestions once it's complete.

@isarkis
Copy link
Member Author

isarkis commented May 29, 2025

gemini /review

@gemini-code-assist
Copy link
Contributor

Acknowledged the /gemini review command. I have completed the review for the current state of this pull request. Please find the detailed review comments and suggestions on the "Files changed" tab.

@isarkis
Copy link
Member Author

isarkis commented May 29, 2025

gemini can you review my last change?

@gemini-code-assist
Copy link
Contributor

It looks like you might be trying to trigger another code review. To do that, please use the command /gemini review in a new issue comment.

If you were asking about a specific change or had a question about the previous review comments, please clarify, and I'll do my best to assist!

@isarkis
Copy link
Member Author

isarkis commented May 29, 2025

gemini review a12de0a

@gemini-code-assist
Copy link
Contributor

It looks like you're trying to trigger a review for a specific commit (a12de0a). Currently, I can only perform a review of the entire pull request in its current state.

To trigger a full review of the latest changes in the pull request, please use the command /gemini review in a new issue comment.

If you have questions about the existing review comments or the overall changes in the pull request, feel free to ask, and I'll do my best to help!

@isarkis
Copy link
Member Author

isarkis commented May 29, 2025

/gemini review

Copy link
Contributor

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

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 introduces a new GitHub Action for E2E tests and updates related configurations, presumably to add support for a "Vega" platform or device. The overall structure is good, and the new action provides a solid foundation for E2E testing.

I've identified a few areas where explicitness, consistency, and flexibility could be enhanced. Addressing these would make the new testing infrastructure more robust and maintainable.

Summary of Findings

  • Action Input Explicitness: The e2e_tests action relies on an implicit TEST_ATTEMPTS environment variable. Making this an explicit input (e.g., inputs.e2e_test_attempts) would improve the action's clarity and maintainability.
  • Configuration Key Consistency: The key test_e2e_device_type in .github/config/android-arm.json is inconsistent with test_device_family used in other configuration files and action inputs. Aligning these would improve consistency.
  • Action Flexibility: Artifact Name: The e2e_tests action hardcodes the artifact name Cobalt.apk in the GCS path. Parameterizing this (e.g., via an inputs.artifact_name) would make the action more flexible for testing different artifacts.
  • Action Flexibility: Test Label: The e2e_tests action uses a hardcoded label chrobalt_vega_test. If the action is intended for broader use beyond Vega, parameterizing this label could enhance its reusability.

Merge Readiness

The pull request makes good progress in adding E2E testing capabilities. However, there are a few medium-severity suggestions related to explicitness of action inputs, consistency in configuration, and flexibility of the new E2E action. I recommend addressing these points to enhance the maintainability and reusability of the code. Therefore, I suggest changes before merging. As a reviewer, I am not authorized to approve the pull request; please ensure it undergoes further review and approval as per your team's process.

@isarkis
Copy link
Member Author

isarkis commented May 29, 2025

/gemini review

Copy link
Contributor

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

Choose a reason for hiding this comment

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

Code Review

The pull request introduces support for running Vega E2E tests within the CI workflow by adding a new GitHub Action and updating existing configuration files. The changes seem well-structured and address the requirement to integrate E2E tests. The update to the on_device_tests action to correctly pass the test_attempts input is a good fix.

Summary of Findings

  • Input validation for e2e_test_targets: The jq command in the new E2E action assumes the input is a valid JSON array. Adding validation or error handling for this input could make the action more robust.
  • Corrected test_attempts input usage: The on_device_tests action was updated to correctly use the action input for test_attempts instead of an undefined environment variable, fixing a potential bug.

Merge Readiness

The pull request introduces necessary changes for integrating E2E tests and includes a valuable fix for the on_device_tests action regarding the test_attempts input. There is a medium severity concern about input validation in the new E2E action. I recommend addressing the input validation point before merging. Please have other reviewers approve this code before merging, as I am unable to approve pull requests directly.

@isarkis isarkis requested review from Libzu, cvinish and oxve May 29, 2025 20:36
@Libzu Libzu added the on_device Add this label to run On-Device Tests label May 29, 2025
@Libzu Libzu requested a review from a team as a code owner May 30, 2025 00:07
@Libzu Libzu requested review from kaidokert and removed request for a team May 30, 2025 00:07
@Libzu Libzu added on_device Add this label to run On-Device Tests and removed on_device Add this label to run On-Device Tests labels May 30, 2025
@isarkis
Copy link
Member Author

isarkis commented Jun 13, 2025

/gemini review

Copy link
Contributor

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

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 adds Vega support, primarily through a new E2E test GitHub Action and significant updates to the on_device_tests_gateway_client.py to differentiate between unit_test and e2e_test types. The changes look good overall, but there are a few items to address, mainly concerning the handling of device dimensions and family for E2E tests, and improving script robustness.

Comment on lines 221 to 227
if args.test_type == 'unit_test':

Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For unit_test type, filter_json_dir and gcs_archive_path are essential. While the calling GitHub Action provides them, the script itself doesn't enforce their presence if called directly. Adding a runtime check here would make the script more robust and its requirements clearer when test_type is 'unit_test'.

      if not args.filter_json_dir:
          raise ValueError("--filter_json_dir is required for unit_test type")
      if not args.gcs_archive_path:
          raise ValueError("--gcs_archive_path is required for unit_test type")

Copy link
Member Author

Choose a reason for hiding this comment

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

@Libzu , please take a look

Copy link
Collaborator

Choose a reason for hiding this comment

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

Make required with argparse.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is not possible using argument groups. This requires to create subparser for each 'test_type' under subparser 'trigger', but this has other limitations. I explored this option (https://paste.googleplex.com/4607506493734912 - https://duckie.corp.google.com/thread/6940164b-5878-4bbd-8a56-663f4aa5a809), but AI suggests to add a separate block to check required arguments, something like:

        if not args.cobalt_path:
            parser.error('--cobalt_path is required when --test_type is e2e_test')
    elif args.test_type == 'unit_test':
        if not (args.device_family and args.gcs_archive_path and args.gcs_result_path and args.filter_json_dir):
            parser.error('--device_family, --gcs_archive_path, --gcs_result_path, and --filter_json_dir are required when --test_type is unit_test')

let me know if you think this is not a good option

Comment on lines 247 to 248
elif args.test_type == 'e2e_test':

Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Similarly for e2e_test type, cobalt_path is essential. Adding a runtime check for its presence when test_type is 'e2e_test' would improve script robustness and clarity of requirements.

      if not args.cobalt_path:
          raise ValueError("--cobalt_path is required for e2e_test type")

Copy link
Member Author

Choose a reason for hiding this comment

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

@Libzu , please take a look

Copy link
Collaborator

Choose a reason for hiding this comment

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

Make it required with argparse below instead.

Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above

Comment on lines 247 to 248
elif args.test_type == 'e2e_test':

Copy link
Collaborator

Choose a reason for hiding this comment

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

Make it required with argparse below instead.

Comment on lines 221 to 227
if args.test_type == 'unit_test':

Copy link
Collaborator

Choose a reason for hiding this comment

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

Make required with argparse.

}
_DEPS_ARCH_MAP = {
'android': '/sdcard/chromium_tests_root/deps.tar.gz',
'ssh': '/home/pi/test/',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: I think this should include the filename to be consistent with android above.

Copy link
Contributor

Choose a reason for hiding this comment

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

I preferred this way to be consistent with the running instructions.
For raspi, the push_files param
push_files=test_runtime_deps:/home/pi/test/
For android, it is:
push_files=test_runtime_deps:/sdcard/chromium_tests_root/deps.tar.gz
In case I have to change this to a filename for ssh, which one would it be?

trigger_args.add_argument(
'--device_family',
type=str,
default='android',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove the default and make the flag required instead.

Copy link
Contributor

Choose a reason for hiding this comment

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

Removed the default valut.
To set it as required -> Same issue mentioned before. Best option is to add separate block to check arguments...

@SortaCookie SortaCookie force-pushed the main branch 3 times, most recently from 5de9067 to 0c39678 Compare August 20, 2025 20:03
@SortaCookie SortaCookie force-pushed the main branch 2 times, most recently from e5fea95 to 7dd4094 Compare September 9, 2025 18:38
@SortaCookie SortaCookie force-pushed the main branch 4 times, most recently from 36bd2a6 to 230cead Compare September 12, 2025 18:39
@SortaCookie SortaCookie force-pushed the main branch 3 times, most recently from 6e38faf to 2e3ef2f Compare September 12, 2025 20:46
@SortaCookie SortaCookie force-pushed the main branch 5 times, most recently from 13162cc to 9ad8257 Compare September 15, 2025 20:19
@SortaCookie SortaCookie force-pushed the main branch 2 times, most recently from 5fcc30a to 0ca8ad7 Compare October 14, 2025 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

on_device Add this label to run On-Device Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants