Skip to content

test(source/cloud-storage): migrate integration tests to MCP endpoint - #4212

Open
DylanVolz wants to merge 2 commits into
googleapis:mainfrom
DylanVolz:chore/cloudestorage-mcp-migration
Open

DylanVolz wants to merge 2 commits into
googleapis:mainfrom
DylanVolz:chore/cloudestorage-mcp-migration

Conversation

@DylanVolz

Copy link
Copy Markdown

Description

Migrates the Cloud Storage integration tests from the legacy /api endpoint to the MCP endpoint (/mcp), following #2922. The legacy REST test is kept, and both transports share setup and assertions.

  • Adds cloud_storage_mcp_test.go: MCP tools/list for all 27 tools (including the configured variants, whose baked-in parameters are dropped from the schema) and every tool invocation check over MCP.
  • Refactors the legacy file into shared setup (setupCloudStorageTest) and a REST/MCP invokeTool; request bodies are now args maps.
  • Bucket cleanup is registered with t.Cleanup before the bucket is created and uses a bounded context.WithoutCancel context; seed objects are written from one table and the client is closed on cleanup.

Testing: Ran both tests locally against fake-gcs-server: tools/list and 187 subtests pass on both transports. Bucket IAM policy, objects.move, and bucket location/uniform-access settings aren't supported by the emulator, so those are verified by the CI cloud-storage job.

PR Checklist

Thank you for opening a Pull Request! Before submitting your PR, there are a
few things you can do to make sure it goes smoothly:

  • Make sure you reviewed
    CONTRIBUTING.md
  • Make sure to open an issue as a
    bug/issue
    before writing your code! That way we can discuss the change, evaluate
    designs, and agree on the general idea
  • Ensure you have manually reviewed the entire diff before requesting a
    review
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)
  • Make sure to add ! if this involve a breaking change

🛠️ Fixes #<issue_number_goes_here>

@DylanVolz
DylanVolz requested a review from a team as a code owner October 1, 2026 15:36
@google-cla

google-cla Bot commented Oct 1, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@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 refactors the Cloud Storage integration tests to support both REST and Model Context Protocol (MCP) transports. It introduces a cloudStorageTransport abstraction to handle starting the server and invoking tools over both protocols, and migrates test payloads from raw JSON strings to structured maps. Additionally, a new test file cloud_storage_mcp_test.go is added to explicitly verify the MCP tool manifests and run the integration tests over MCP. Cleanups are also improved by utilizing t.Cleanup and detaching the cleanup context from the potentially cancelled test context. I have no feedback to provide as there are no review comments.

@DylanVolz
DylanVolz force-pushed the chore/cloudestorage-mcp-migration branch from 33b2eb7 to 4c49f26 Compare October 17, 2026 01:24

This branch has not been deployed

No deployments
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