Skip to content

Add vMCP per-backend dual-era e2e coverage (VirtualMCPServer aggregation) #5979

Closed

Description

@jhrozek

Context

The per-backend MCP revision work in vMCP (probeRevision, dispatch, reclassify, modernEnumerate, and MCPRevision surfacing in pkg/vmcp/client/{modern.go,client.go} + pkg/vmcp/types.go) has no end-to-end coverage.

A separate set of dual-era e2e tests exists (test/e2e/dual_era_*_test.go, test/e2e/hostile_input_proxy_test.go, test/e2e/thv-operator/acceptance_tests/dual_era_k8s_test.go), but they all target the proxy / server-side Modern path (thv proxy, pkg/transport/proxy, pkg/vmcp/server/modern_dispatch.go). None create a VirtualMCPServer or MCPGroup, so none exercise the vMCP outbound backend-client path — the code that runs inside the aggregator when it re-originates calls to each backend.

Problem

Per-backend revision negotiation (Modern detect/cache/enumerate/dispatch/re-probe/retry, MCPRevision status surfacing) is proven only in-process today: pkg/vmcp/client/modern_integration_test.go uses an httptest server, not a containerized MCPServer backend. The existing vMCP aggregation e2e (test/e2e/thv-operator/virtualmcp/virtualmcp_discovered_mode_test.go) uses Legacy backends (gofetch, osv) that take the unchanged initialize path, so it validates nothing about this feature.

Proposal

Add one operator e2e in test/e2e/thv-operator/virtualmcp/, modeled on virtualmcp_discovered_mode_test.go but reusing the dual-era fixtures (images.YardstickServerImage for a Modern backend; gofetch/osv for Legacy):

  1. MCPGroup + VirtualMCPServer (discovered mode) with a mixed Legacy/Modern backend set.
  2. Assert aggregated tools include the Modern backend's tools → covers probeRevision → RevisionModern + modernEnumerate.
  3. Call a tool routed to the Modern backend → covers dispatch → modernCall (tools/call mapping).
  4. Assert mcpRevision on the /status backends[] and on VirtualMCPServer.status.discoveredBackends[] → covers the MCPRevision field (pkg/vmcp/types.go) and the mcp.protocol.revision telemetry label.
  5. (Stretch) mirror the proxy e2e's resilience/mixing patterns to cover reclassify/retry on a mid-run revision flip — harder to trigger deterministically; the unit reclassify_test.go may suffice.

Prerequisites

  • Confirm yardstick-server runs as an MCPServer backend reachable from the operator (the k8s dual-era test proves it runs under the operator; discovered-mode proves gofetch/osv do — combining the two is the unproven step).
  • The dual-era image/client setup (ensureYardstickClientBinary, images.YardstickServerImage) is reusable.

Scope

Additive only — no changes to the reviewed client code. One new _test.go file.

Parent

Part of #5756.

Activity

  1. added
    needs-triage
    on Jul 24, 2026
  2. self-assigned this
    on Jul 27, 2026
  3. removed
    needs-triage
    on Jul 27, 2026
  4. added 3 commits that reference this issue on Jul 27, 2026
    2567a8c
    4a63400
    4018950
  5. added a commit that references this issue on Jul 27, 2026
    08cbffd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions