Skip to content

test(source/http): create MCP integration tests#2842

Merged
anubhav756 merged 1 commit intomainfrom
anubhav-feat-native-mcp-http
Apr 1, 2026
Merged

test(source/http): create MCP integration tests#2842
anubhav756 merged 1 commit intomainfrom
anubhav-feat-native-mcp-http

Conversation

@anubhav756
Copy link
Copy Markdown
Contributor

@anubhav756 anubhav756 commented Mar 25, 2026

Overview

This PR adds the mapped integration tests for HTTP tools using the new native MCP harness.

Changes

  • Created tests/http/http_mcp_test.go and ported all relevant tests from the legacy http_integration_test.go to use the /mcp pathway.
  • Includes covered positive paths, negative paths, and optional query parameter variations.

Checklist

  • Ensure the tests and linter pass

@anubhav756 anubhav756 self-assigned this Mar 25, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 updates the HTTP tool integration tests to leverage a native MCP JSON-RPC protocol for interacting with tools. This change simplifies the testing framework by abstracting the underlying communication mechanism into a dedicated helper, making tests more consistent and easier to maintain. As a result of this refactoring, the continuous integration configuration has been substantially reduced, removing many specific test steps and secret definitions that are no longer relevant to the streamlined HTTP test suite.

Highlights

  • Migration to Native MCP JSON-RPC: The HTTP tool integration tests have been migrated to use a native MCP JSON-RPC protocol for tool invocation and listing, moving away from direct HTTP API endpoints.
  • Test Refactoring: Existing HTTP tool invocation tests, including runQueryParamInvokeTest and runAdvancedHTTPInvokeTest, were refactored to utilize a new InvokeMCPTool helper function, standardizing test logic and error handling.
  • CI Configuration Streamlining: The .ci/integration.cloudbuild.yaml file was significantly streamlined by removing numerous individual integration test steps and their associated secret environment variables, focusing the CI on the updated HTTP test approach.
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.

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 refactors the HTTP integration tests to utilize native MCP JSON-RPC protocol invocation helpers, improving the testing methodology for HTTP tools. However, a critical issue has been identified where the changes inadvertently remove almost all other integration tests from the CI pipeline, which could severely impact test coverage and needs to be addressed. Additionally, there's an opportunity to improve code maintainability by extracting duplicated error handling logic within the HTTP integration tests into a shared helper function.

@anubhav756 anubhav756 force-pushed the anubhav-tests-harness-migration branch from 8b9a9f8 to 77e10c4 Compare March 25, 2026 06:15
@anubhav756 anubhav756 force-pushed the anubhav-feat-native-mcp-http branch 2 times, most recently from 71cca69 to aaa8b2f Compare March 25, 2026 06:35
@anubhav756 anubhav756 marked this pull request as ready for review March 25, 2026 07:18
@anubhav756 anubhav756 requested a review from a team as a code owner March 25, 2026 07:18
@anubhav756 anubhav756 force-pushed the anubhav-tests-harness-migration branch from 77e10c4 to 9816437 Compare March 28, 2026 16:47
@anubhav756 anubhav756 force-pushed the anubhav-feat-native-mcp-http branch from aaa8b2f to d120d35 Compare March 28, 2026 16:47
@anubhav756 anubhav756 force-pushed the anubhav-tests-harness-migration branch from 9816437 to e4512a1 Compare March 29, 2026 15:42
@anubhav756 anubhav756 force-pushed the anubhav-feat-native-mcp-http branch 2 times, most recently from d06488f to 6f37050 Compare March 29, 2026 15:54
@anubhav756 anubhav756 force-pushed the anubhav-tests-harness-migration branch from 3633430 to 082e280 Compare March 29, 2026 15:58
@anubhav756 anubhav756 force-pushed the anubhav-feat-native-mcp-http branch 3 times, most recently from 4ca8fb9 to b428321 Compare March 30, 2026 10:29
@anubhav756 anubhav756 force-pushed the anubhav-tests-harness-migration branch from b48c731 to e0686e3 Compare March 30, 2026 10:39
@anubhav756 anubhav756 force-pushed the anubhav-feat-native-mcp-http branch 2 times, most recently from b8680be to 78ea17e Compare March 30, 2026 12:38
@anubhav756 anubhav756 force-pushed the anubhav-tests-harness-migration branch 2 times, most recently from bc7fa2f to 7fe2c51 Compare March 30, 2026 12:40
@anubhav756 anubhav756 force-pushed the anubhav-feat-native-mcp-http branch 2 times, most recently from 1633f13 to c1dc605 Compare March 30, 2026 12:52
@anubhav756 anubhav756 force-pushed the anubhav-tests-harness-migration branch from 7fe2c51 to 37f4fdb Compare March 30, 2026 12:54
@anubhav756 anubhav756 force-pushed the anubhav-feat-native-mcp-http branch from c1dc605 to 004eb32 Compare March 30, 2026 12:55
@anubhav756 anubhav756 changed the title test(tests/http): migrate to native MCP json-rpc protocol test(source/http): migrate to native MCP json-rpc protocol Mar 30, 2026
@anubhav756 anubhav756 changed the title test(source/http): create MCP tests test(source/http): create MCP integration tests Mar 30, 2026
Copy link
Copy Markdown
Contributor

@Yuan325 Yuan325 left a comment

Choose a reason for hiding this comment

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

Please rebase this after updating the #2828 PR :) Thank you.

@anubhav756 anubhav756 force-pushed the anubhav-tests-harness-migration branch 2 times, most recently from 4349247 to 49352dc Compare March 30, 2026 21:49
@anubhav756 anubhav756 force-pushed the anubhav-feat-native-mcp-http branch from 815da44 to f2c1e86 Compare March 30, 2026 21:52
@anubhav756 anubhav756 force-pushed the anubhav-tests-harness-migration branch from 49352dc to 009f45b Compare March 30, 2026 22:13
@anubhav756 anubhav756 force-pushed the anubhav-feat-native-mcp-http branch 4 times, most recently from 5749645 to cd6e882 Compare March 30, 2026 23:05
@anubhav756 anubhav756 force-pushed the anubhav-tests-harness-migration branch from b934ec8 to 5364cf1 Compare March 31, 2026 11:03
@anubhav756 anubhav756 force-pushed the anubhav-feat-native-mcp-http branch from cd6e882 to e51567b Compare March 31, 2026 11:06
@anubhav756 anubhav756 force-pushed the anubhav-tests-harness-migration branch from 5364cf1 to 4b41e0d Compare March 31, 2026 11:11
@anubhav756 anubhav756 force-pushed the anubhav-feat-native-mcp-http branch from e51567b to 733c4a2 Compare March 31, 2026 11:15
Base automatically changed from anubhav-tests-harness-migration to main March 31, 2026 12:04
@anubhav756 anubhav756 force-pushed the anubhav-feat-native-mcp-http branch from 733c4a2 to 133303a Compare March 31, 2026 12:14
@anubhav756 anubhav756 requested a review from Yuan325 March 31, 2026 13:00
@anubhav756 anubhav756 force-pushed the anubhav-feat-native-mcp-http branch 3 times, most recently from bf0e81e to b9e27e0 Compare April 1, 2026 15:56
Copy link
Copy Markdown
Contributor

@Yuan325 Yuan325 left a comment

Choose a reason for hiding this comment

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

Awesome, thank you!! LGTM :)

@anubhav756 anubhav756 force-pushed the anubhav-feat-native-mcp-http branch from b9e27e0 to 8aaa73e Compare April 1, 2026 17:59
@anubhav756 anubhav756 merged commit 0857c29 into main Apr 1, 2026
18 of 19 checks passed
@anubhav756 anubhav756 deleted the anubhav-feat-native-mcp-http branch April 1, 2026 18:27
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

🧨 Preview deployments removed.

Cloudflare Pages environments for pr-2842 have been deleted.

github-actions bot pushed a commit to CrazyForks/genai-toolbox that referenced this pull request Apr 2, 2026
)

## Overview

This PR adds the mapped integration tests for HTTP tools using the new
native MCP harness.

## Changes
- Created `tests/http/http_mcp_test.go` and ported all relevant tests
from the legacy `http_integration_test.go` to use the `/mcp` pathway.
- Includes covered positive paths, negative paths, and optional query
parameter variations.

## Checklist
- [x] Ensure the tests and linter pass 0857c29
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