-
- Notifications
You must be signed in to change notification settings - Fork 636
refactor: migrate tests to use hub_builder instead of full integration #3247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: migrate tests to use hub_builder instead of full integration #3247
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @aignas, 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!
This pull request significantly refactors the testing infrastructure by migrating existing integration tests to specifically target the hub_builder
component. The primary goal is to enhance the clarity and maintainability of the test suite by simplifying assertions and creating a more focused testing environment for the hub_builder
. This change lays the groundwork for more granular testing of specific hub_builder
methods in the future, addressing part of the work towards issue #2747.
Highlights
- Test Refactoring: Migrated several existing integration tests from
extension_tests.bzl
to a new dedicatedhub_builder_tests.bzl
file. This shifts the testing focus from full extension parsing to thehub_builder
component. - Improved Test Clarity: The refactoring aims to simplify test assertions by reducing the nesting of dictionaries, making the tests easier to understand and maintain.
- New Test Suite for Hub Builder: Introduced a new
BUILD.bazel
file andhub_builder_tests.bzl
to house tests specifically for thehub_builder
functionality, providing a more modular testing structure. - Partial Migration: Note that not all relevant tests have been migrated in this pull request, and some copy-pasted code exists, with further migration planned for future work.
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 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. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
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.
Footnotes
-
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. ↩
d40dbef
to ea0cc1f
Compare There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This PR is a great step towards simplifying the tests by migrating them to use hub_builder
directly. The new tests in hub_builder_tests.bzl
are much clearer and easier to follow. I've left a few suggestions to further improve the new test helpers and reduce code duplication. Overall, this is a solid refactoring.
/gemini review |
There was a problem hiding this 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 is a solid refactoring that migrates tests from using the full pypi.extension
to the more focused hub_builder
. This simplifies the test setup and improves maintainability, as intended. The extraction of the platform
function and the pip_parse
test helper into separate files is a great cleanup. My review includes a few suggestions to further improve the new test suite's structure and points out a potential bug captured by one of the new tests.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This PR migrates some of the tests that we had testing the full
extension parsing to just test the hub builder.
I ran out of time to migrate everything and there is a little bit of
copy pasted code. The goal is to make the assertions easier to
understand because the nesting of the dictionaries will be not as large.
Later we can add tests that are testing individual
hub_builder
methods, which will be needed when we start implementing the
pip.configure
tag class or we implement apy.lock
parsing.Work towards #2747