Visitar URL original
test(source/cloudgda): migrate integration tests to MCP endpoint by DylanVolz · Pull Request #4205 · googleapis/mcp-toolbox · GitHub
Skip to content

test(source/cloudgda): migrate integration tests to MCP endpoint - #4205

Open
DylanVolz wants to merge 1 commit into
googleapis:mainfrom
DylanVolz:chore/cloudgda-mcp-migration
Open

DylanVolz wants to merge 1 commit into
googleapis:mainfrom
DylanVolz:chore/cloudgda-mcp-migration

Conversation

@DylanVolz

Copy link
Copy Markdown

Description

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

  • Adds cloud_gda_mcp_test.go: MCP tools/list + invocation for the mock-backed cloud-gda-query tool, a tools/list check for the 9 conversational analytics tools, and the list/get/ask data agent checks over MCP.
  • Refactors the legacy file into shared setup (startCloudGdaMockServer, setupConversationalAnalyticsTest, getConversationalAnalyticsToolsConfig) and a small REST/MCP transport, so the list/get/ask checks run against both endpoints.
  • Resource cleanup uses t.Cleanup with bounded context.WithoutCancel contexts; the ask-agent retry loop is context-aware.

Testing: TestCloudGdaToolEndpoints and TestCloudGdaMCPToolEndpoints (in-process mock gRPC server) pass locally. The conversational analytics tests need a GCP project and ID token and are verified by the CI cloudgda 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 September 30, 2026 18:48
@google-cla

google-cla Bot commented Sep 30, 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 GDA integration tests to support both the legacy REST API and the Model Context Protocol (MCP) transport. It introduces a cloudGDATransport helper to abstract the transport layer and a cloudGDAResult struct to unify response handling. Additionally, resource cleanup throughout the tests has been modernized to use Go's t.Cleanup instead of defer, ensuring reliable teardown of mock servers, command executions, and BigQuery tables even during partial setup failures. A new test file cloud_gda_mcp_test.go has been added to explicitly validate the MCP tool endpoints and conversational analytics tools. No reviewer comments were provided, so there is no feedback to address.

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