Repository navigation
Description
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):
MCPGroup+VirtualMCPServer(discovered mode) with a mixed Legacy/Modern backend set.- Assert aggregated tools include the Modern backend's tools → covers
probeRevision→RevisionModern+modernEnumerate. - Call a tool routed to the Modern backend → covers
dispatch→modernCall(tools/callmapping). - Assert
mcpRevisionon the/statusbackends[]and onVirtualMCPServer.status.discoveredBackends[]→ covers theMCPRevisionfield (pkg/vmcp/types.go) and themcp.protocol.revisiontelemetry label. - (Stretch) mirror the proxy e2e's resilience/mixing patterns to cover
reclassify/retry on a mid-run revision flip — harder to trigger deterministically; the unitreclassify_test.gomay suffice.
Prerequisites
- Confirm
yardstick-serverruns as anMCPServerbackend 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
Add operator e2e for mixed-era vMCP backends
Add operator e2e for mixed-era vMCP backends
Add operator e2e for mixed-era vMCP backends
Bridge era-mismatched client×backend cells in vMCP (stacklok#6006)