Skip to content

test(source/falkordb): migrate integration tests to MCP endpoint - #4177

Open
DylanVolz wants to merge 1 commit into
googleapis:mainfrom
DylanVolz:chore/falkordb-mcp-conversion
Open

DylanVolz wants to merge 1 commit into
googleapis:mainfrom
DylanVolz:chore/falkordb-mcp-conversion

Conversation

@DylanVolz

Copy link
Copy Markdown

Description

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

Key Changes

  • falkordb_mcp_test.go: Migrated legacy /api tests to /mcp

    • TestFalkorDBMCPListTools validates the full tools/list manifest for all eight FalkorDB tools configured in the test (falkordb-cypher, falkordb-execute-cypher including the read-only and graph-override variants, falkordb-schema, and falkordb-list-graphs).
    • TestFalkorDBMCPCallTool runs the same ten invocation cases as the legacy test over MCP JSON-RPC: parameterized cypher, ad-hoc execution (write stats, dry_run query plan, graph override), schema extraction on populated and nonexistent graphs, and graph listing.
    • The read-only write rejection is asserted via wantContentErr and AssertMCPError.
    • Uses t.Cleanup for server and cmd.Close cleanup.
  • falkordb_integration_test.go: Extracted shared helpers so the legacy and MCP tests use the same setup and cases (no behavior change to the legacy test):

    • setupFalkorDBInstance starts the ephemeral FalkorDB container (unless FALKORDB_* points at an external instance) and restores the package-level connection variables on cleanup, so each test gets its own container.
    • getFalkorDBToolsConfig builds the shared tools file.
    • getFalkorDBInvokeTestCases holds the shared invocation cases (toolName + args map[string]any), replacing the inline requestBody JSON strings.

No shared test helpers (tests/tool.go, tests/mcp_tool.go, tests/option.go) are modified. The legacy /api FalkorDB test is kept.

Verified locally against the falkordb/falkordb:v4.18.0 testcontainer: go test -count=1 -v ./tests/falkordb/ passes (legacy REST test, MCP tools/list, and all MCP invocations).

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 29, 2026 18:44
@google-cla

google-cla Bot commented Sep 29, 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 FalkorDB integration tests by extracting setup helpers and test cases into reusable functions. It also introduces a new integration test suite in tests/falkordb/falkordb_mcp_test.go to verify the FalkorDB Model Context Protocol (MCP) server, reusing the extracted test cases to validate tool listing and invocation. There are no review comments, so I have no feedback to provide.

@AlexTalreja

Copy link
Copy Markdown
Contributor

/gcbrun

@AlexTalreja AlexTalreja assigned AlexTalreja and unassigned Yuan325 Oct 6, 2026
@DylanVolz
DylanVolz force-pushed the chore/falkordb-mcp-conversion branch from 3e77079 to 2f1e16e Compare October 16, 2026 23:31

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