You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
New tests that don't involve auth use real in-process MCP backends via
httptest.NewServer() instead of K8s. This constructs the full decorator
stack (factory, conflict resolution, filter, composite tools, optimizer)
without containers or a Kind cluster. Follows the existing pattern in
connector_integration_test.go. K8s E2E tests remain as regression gates
for auth-dependent flows and CRD-driven configuration.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: rfcs/THV-0058-inline-aggregator-filter-decorator.md
+44-34Lines changed: 44 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -298,33 +298,35 @@ The decorator-based architecture makes it straightforward to add new session-lev
298
298
299
299
## Testing Strategy
300
300
301
-
All validation is at the K8s/Ginkgo E2E level (`test/e2e/thv-operator/virtualmcp/`). Tests deploy real MCPServers + VirtualMCPServers to a Kind cluster and exercise the full stack via MCP clients.
301
+
New tests that don't involve auth are written as in-process integration tests at the `MultiSession` level, using real MCP backends hosted via `httptest.NewServer()`. This constructs the full vMCP stack (factory → conflict resolution → decorators → tool calls) without a K8s dependency. The existing pattern lives in `pkg/vmcp/session/connector_integration_test.go` — `startInProcessMCPServer()` creates real MCP servers with registered tools, and the session factory connects to them with full capability discovery.
302
+
303
+
K8s/Ginkgo E2E tests (`test/e2e/thv-operator/virtualmcp/`) remain the regression gates for auth-dependent flows and CRD-driven configuration.
302
304
303
305
### Feature combination matrix
304
306
305
-
The features being modified interact with each other. The matrix below maps every relevant combination to an E2E test — either an existing one that provides coverage or a new one that must be written.
307
+
The features being modified interact with each other. The matrix below maps every relevant combination to a test — either an existing one that provides coverage or a new one that must be written.
-**Row 11**: Token-based incoming auth with backend routing.
337
339
338
-
### New E2E tests
340
+
### New in-process integration tests
341
+
342
+
These tests construct the full decorator stack against real in-process MCP backends (via `httptest.NewServer()` + `mcp-go`). No K8s, no containers — the session factory connects to backends over HTTP, discovers capabilities, applies conflict resolution + overrides, and wires the decorator chain. Tests call through the decorated `MultiSession` interface.
The specific bug this RFC fixes. When a composite tool workflow step calls a hidden backend tool with a numeric parameter, `getToolInputSchema()` fails to find the schema, skips coercion, and the backend rejects `"42"` (string) instead of `float64(42)`.
345
351
346
352
**Setup**:
347
-
- Backend with a tool accepting an integer parameter (requires adding an `add` tool to yardstick: `{"a": integer, "b": integer}` → returns sum)
348
-
-`ExcludeAll: true` for the backend
349
-
- Composite tool whose workflow step calls the hidden tool via template expansion (`"{{ .params.a }}"`)
353
+
- In-process MCP backend with a tool accepting integer parameters (e.g., `add` tool: `{"a": integer, "b": integer}` → returns sum)
354
+
- Session factory with `ExcludeAll: true` for the backend
355
+
- Composite tools decorator applied with a workflow step that calls the hidden tool via template expansion (`"{{ .params.a }}"`)
No existing test exercises overrides and filter together. The `shouldAdvertiseTool` comment bug (says "before overrides" but receives post-override name) was never caught because this combination is untested.
363
370
364
371
**Setup**:
365
-
- Backend with tool `echo`, overridden to `custom_echo`
372
+
- In-process MCP backend with tool `echo`
373
+
- Override config: `echo` → `custom_echo`
366
374
- Filter configured with `["echo"]` (pre-override name)
375
+
- Session constructed with full decorator chain
367
376
368
377
**Assertions**:
369
378
- Document whether the filter matches pre- or post-override names
370
-
- Verify the overridden tool is callable by its new name
379
+
- Verify the overridden tool is callable by its new name via `sess.CallTool()`
371
380
- Lock in the actual behavior so the refactor preserves it
0 commit comments