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

test(source/cloud-logging-admin): migrate integration tests to MCP endpoint - #4196

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

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

Conversation

@DylanVolz

@DylanVolz DylanVolz commented Sep 30, 2026 •

Copy link
Copy Markdown

Description

This PR migrates the Cloud Logging Admin integration tests to use the /mcp endpoint on the MCP Toolbox Server.

Key Changes

  • cloud_logging_admin_mcp_test.go: adds TestLogAdminMCPListTools (validates the
    tools/list manifest) and TestLogAdminMCPToolEndpoints (runs the same checks as the legacy test over MCP, including auth: 401 without a token, and the
    invalid-filter case asserted as an MCP error result). - cloud_logging_admin_integration_test.go: extracts shared setup and a small
    REST/MCP transport so both tests run the same checks; the legacy assertions are unchanged.
  • Cleanup hardening: logging clients are now closed, the test log deletion is registered before the logs are written, and REST requests use the test context.

Testing

go vet and the existing helper unit tests pass locally. The integration tests need Google Cloud credentials, so they will first run in CI via the cloud-logging-admin shard.> Should include a concise description of the changes (bug or feature), it's

impact, along with a summary of the solution

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 16:21
@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.

@DylanVolz DylanVolz changed the title test(source/cloud-logging-admin): migrate integration tests to MCP en… test(source/cloud-logging-admin): migrate integration tests to MCP endpoint Sep 30, 2026

@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 Logging Admin integration tests to support both the legacy REST API and the Model Context Protocol (MCP). It extracts setup and teardown logic into helper functions using t.Cleanup for safer resource management, introduces a unified logAdminTransport to abstract tool invocation across REST and MCP, and adds a new test suite (cloud_logging_admin_mcp_test.go) specifically for validating MCP tool listings and endpoints. No review comments were provided, so there is no feedback to address.

@AlexTalreja

Copy link
Copy Markdown
Contributor

/gcbrun

})
}

func TestLogAdminMCPToolEndpoints(t *testing.T) {

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.

nit: Change name to match existing format of Test<Source>MCPCallTool

@AlexTalreja AlexTalreja assigned AlexTalreja and unassigned duwenxin99 Oct 6, 2026

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.

3 participants