Skip to content

tests: another test for adding a new api path to an existing library#2676

Merged
parthea merged 6 commits intomainfrom
add-test-api-path
Oct 31, 2025
Merged

tests: another test for adding a new api path to an existing library#2676
parthea merged 6 commits intomainfrom
add-test-api-path

Conversation

@parthea
Copy link
Copy Markdown
Contributor

@parthea parthea commented Oct 24, 2025

As a follow up to #2666, this PR adds another test case to check that a new API path can be added to an existing library in state.yaml. The test case added in #2666 did not have any API paths in the existing library. See the snippet below where there is no API path in the existing library.

{
name: "api and library set, library exists",
api: "some/api",
library: "some-library",
state: &config.LibrarianState{
Libraries: []*config.LibraryState{
{
ID: "some-library",
},
},
},
want: true,
},

For completeness and to avoid regressions, we should also test that new paths can be added to an existing library which already has API paths. This PR adds the missing test case.

@parthea parthea requested a review from a team as a code owner October 24, 2025 18:27
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @parthea, 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 enhances the test suite for the generate_command by introducing a new test case. This new test specifically validates the functionality of adding a new API path to a library that already has existing API paths defined in its state.yaml configuration. This ensures comprehensive coverage and prevents potential regressions in handling library state updates.

Highlights

  • Test Coverage Enhancement: Added a new test case to generate_command_test.go to verify that new API paths can be successfully added to an existing library that already contains API paths in state.yaml.
  • Test Case Refinement: Renamed an existing test case for clarity, specifying that it covers the scenario where an existing library has no API paths in state.yaml.
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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request 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

  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
Copy Markdown
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 a new test case to TestNeedsConfigure to ensure that the function correctly identifies when a new API path needs to be added to an existing library that already has API paths defined in state.yaml. The added test case enhances the robustness of the generate command by covering a scenario not previously addressed.

@codecov
Copy link
Copy Markdown

codecov bot commented Oct 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.49%. Comparing base (b5021b8) to head (bd398f0).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2676      +/-   ##
==========================================
+ Coverage   86.69%   87.49%   +0.80%     
==========================================
  Files         118      118              
  Lines        9814    10611     +797     
==========================================
+ Hits         8508     9284     +776     
- Misses        921      922       +1     
- Partials      385      405      +20     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

parthea and others added 2 commits October 24, 2025 14:30
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: Anthonios Partheniou <[email protected]>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: Anthonios Partheniou <[email protected]>
chingor13
chingor13 previously approved these changes Oct 24, 2025
Copy link
Copy Markdown
Member

@julieqiu julieqiu left a comment

Choose a reason for hiding this comment

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

comment on renaming test

@parthea parthea requested a review from julieqiu October 31, 2025 16:10
@parthea parthea dismissed julieqiu’s stale review October 31, 2025 16:11

addressed review feedback

@parthea parthea self-assigned this Oct 31, 2025
@julieqiu
Copy link
Copy Markdown
Member

@parthea I think you need to rebase this PR. Looks like some of the failures were recently fixed.

@parthea parthea enabled auto-merge (squash) October 31, 2025 17:35
@parthea parthea merged commit e9fc828 into main Oct 31, 2025
8 checks passed
@parthea parthea deleted the add-test-api-path branch October 31, 2025 17:40
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.

4 participants