Skip to content

test: expand E2E integration test suite for cross-SDK parity - #83

Open
stenalpjolly wants to merge 2 commits into
googleapis:mainfrom
stenalpjolly:stenalpjolly_integration-test-parity
Open

test: expand E2E integration test suite for cross-SDK parity#83
stenalpjolly wants to merge 2 commits into
googleapis:mainfrom
stenalpjolly:stenalpjolly_integration-test-parity

Conversation

@stenalpjolly

Copy link
Copy Markdown
Contributor

Summary

Expands the Java SDK E2E integration test suite to achieve full functional parity with the Go, JavaScript/TypeScript, and Python SDKs. Adds comprehensive error handling, argument type and presence validations, schema pruning assertions, optional/default parameter tests, structured Map data handling, protocol version negotiations, and custom client header verifications.

Expectation & Implementation

  • Tool & Toolset Loading Errors: Validates negative paths when loading non-existent toolsets and tools, asserting appropriate exception propagation.
  • Argument Validation: Verifies that missing required parameters or type mismatches (e.g. passing integer for string) are caught before or during execution.
  • Bound Parameter Pruning in Live E2E: Confirms that parameters bound via tool.bindParam(...) are pruned from the exposed tool definition schema.
  • Authentication Resilience: Adds test cases for missing tokens on authenticated tools, invalid tokens, unauthenticated tools receiving tokens, and failing token supplier futures.
  • Complex & Structured Payloads: Adds test suite for search-rows (testing optional string and integer parameters with omission and explicit values) and process-data (testing nested Map<String, Object> payloads).
  • Protocol Versions & Headers: Validates client creation with custom headers and explicit protocol versions (VERSION_2024_11_05, VERSION_2025_03_26, VERSION_2025_06_18, VERSION_2025_11_25) against the live MCP Toolbox server.
  • Environment Flexibility: Enhances ToolboxE2ESetup to support TOOLBOX_SERVER_URL for pre-configured server instances.

Test cases

  • McpToolboxClientE2ETest:
    • testLoadToolsetSpecific
    • testLoadToolsetDefault
    • testLoadNonExistentToolset
    • testLoadNonExistentTool
    • testRunTool
    • testRunToolMissingRequiredParams
    • testRunToolWrongParamType
    • testBindParams
    • testBindParamsCallable
    • testBoundParamPruningSchema
    • testRunToolAuth
    • testRunToolWrongAuth
    • testRunToolAuthWithoutProvidingAuth
    • testRunToolParamAuth
    • testRunToolParamAuthNoField
    • testRunToolWithFailingTokenSupplier
  • McpToolboxComplexTypesE2ETest:
    • testSearchRowsDefinitionSchema
    • testSearchRowsOmittingOptionals
    • testSearchRowsWithAllParamsProvided
    • testSearchRowsMissingRequiredParam
    • testSearchRowsNonMatchingData
    • testProcessDataDefinitionSchema
    • testProcessDataWithMapParams
    • testProcessDataOmittingOptionalMap
  • McpToolboxProtocolE2ETest:
    • testClientWithCustomHeaders
    • testClientWithExplicitProtocolVersions

Acceptance criteria

  • All 130 local unit tests pass with 100% check coverage.
  • Code strictly formatted according to Google Java Format standard.
  • All new E2E tests are compatible with the MCP Toolbox live server.
  • Presubmit CI triggers (`core-java-sdk-pr` in Cloud Build and GitHub Actions workflows) pass cleanly.

Breaking changes

None.

- Add missing toolset and tool loading negative error tests
- Add argument validation tests for missing and wrong parameter types
- Add bound parameter schema pruning assertion in live integration tests
- Add auth failure and missing token negative test cases
- Add complex data types suite covering optional search-rows and process-data
- Add protocol version selection and client headers E2E tests
- Add TOOLBOX_SERVER_URL environment support to ToolboxE2ESetup
@stenalpjolly
stenalpjolly requested a review from a team as a code owner August 12, 2026 08:27

@anubhav756 anubhav756 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.

Tests are incorrect, they seem to be passing wrong param values and on failure they seem to be swallowing the error and passing anyway.

void testProcessDataWithMapParams() {
Tool tool = client.loadTool("process-data").join();
Map<String, Object> inputData =
Map.of("key1", "val1", "count", 5, "nested", Map.of("inner", "value"));

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.

Are we using correct param names? Seems like these are wrong param names? Please check projects/107716898620/secrets/sdk_testing_tools/versions/34 secret value (note that it's not the latest revision 35, but the revision 34).

assertNotNull(result);
} catch (Exception e) {
// In case server expects specific parameters for process-data
assertNotNull(e);

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.

Server will throw error as the test passes incorrect param names, but the test swallows those errors and passes anyway.

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