Skip to content

test(tool/cmd/migrate): add test to fetchGoogleapisWithCommit#4550

Merged
zhumin8 merged 2 commits intogoogleapis:mainfrom
zhumin8:tool-add-test
Mar 13, 2026
Merged

test(tool/cmd/migrate): add test to fetchGoogleapisWithCommit#4550
zhumin8 merged 2 commits intogoogleapis:mainfrom
zhumin8:tool-add-test

Conversation

@zhumin8
Copy link
Contributor

@zhumin8 zhumin8 commented Mar 12, 2026

Add test to fetchGoogleapisWithCommit. For #4514 (comment)

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 refactors fetchGoogleapisWithCommit to accept fetch.Endpoints as a parameter, which makes the function testable. A new test, TestFetchGoogleapisWithCommit, is added, effectively mocking the GitHub API using httptest. The changes are well-implemented, and the new test adheres to the project's testing guidelines. I have one suggestion to improve the maintainability of the new test by replacing a hardcoded repository path with the variable used in the implementation.

@codecov
Copy link

codecov bot commented Mar 12, 2026

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 79.90%. Comparing base (c4d97d7) to head (2e2b5c4).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
tool/cmd/migrate/legacylibrarian.go 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4550      +/-   ##
==========================================
+ Coverage   79.65%   79.90%   +0.24%     
==========================================
  Files         109      109              
  Lines        9126     9115      -11     
==========================================
+ Hits         7269     7283      +14     
+ Misses       1346     1322      -24     
+ Partials      511      510       -1     

☔ 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.

@zhumin8 zhumin8 marked this pull request as ready for review March 12, 2026 21:37
@zhumin8 zhumin8 requested a review from a team as a code owner March 12, 2026 21:37
@zhumin8 zhumin8 merged commit a3f1b43 into googleapis:main Mar 13, 2026
19 of 20 checks passed
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.

2 participants