Commit 327eeb5
authored
feat(e2e): add comprehensive E2E test coverage for MCP classifier (#743)
* feat(e2e): add comprehensive E2E test coverage for MCP classifier
- Add 5 new test cases for MCP classification:
- mcp-stdio-classification: Tests stdio transport
- mcp-http-classification: Tests HTTP transport
- mcp-model-reasoning: Tests model recommendations and reasoning flags
- mcp-probability-distribution: Tests probability arrays and entropy
- mcp-fallback-behavior: Tests fallback to in-tree classifier
- Add test data with 34 test cases covering math, science, technology, history, and general categories
- Add common helpers in mcp_common.go for test execution and validation
- Update routing-strategies profile to manage MCP server lifecycle
- Add values-mcp.yaml for MCP-enabled semantic router configuration
- Add MCP_ROUTING_AND_REQUEST_FLOW.md documentation
Test Coverage:
✅ MCP stdio transport (process communication)
✅ MCP HTTP transport (API calls)
✅ Custom classification logic via external servers
✅ Model and reasoning decisions from MCP
✅ Fallback behavior on MCP failures
✅ Probability distribution validation
Signed-off-by: Senan Zedan <[email protected]>
* feat(e2e): add comprehensive E2E test coverage for MCP classifier
- Add 5 new test cases: stdio/HTTP transport, model reasoning, probability distribution, and fallback behavior
- Add 34 test cases covering math, science, technology, history, and general categories
- Add mcp_common.go with shared helper functions
- Update routing-strategies profile to manage MCP server lifecycle
- Add values-mcp.yaml configuration for MCP-enabled deployment
Test Coverage:
✅ MCP stdio transport (process communication)
✅ MCP HTTP transport (API calls)
✅ Custom classification via external servers
✅ Model and reasoning decisions from MCP
✅ Fallback to in-tree classifier on failures
✅ Probability distribution validation
Signed-off-by: Senan Zedan <[email protected]>
* fix: apply go fmt to MCP test files
Signed-off-by: Senan Zedan <[email protected]>
* fix: make MCP tests optional and fix server startup
- Fix MCP server filename (server_keyword.py.py)
- Make MCP server startup optional and non-blocking
- Comment out MCP tests from default routing-strategies suite
- MCP tests are still registered and can be run explicitly with E2E_TESTS parameter
- This prevents CI failures when Python dependencies or MCP servers are unavailable
Signed-off-by: Senan Zedan <[email protected]>
* fix: rename server_keyword.py.py to server_keyword.py
- Remove duplicate .py extension from MCP keyword server filename
- Update profile.go to reference correct filename
- This fixes the inconsistency with other server files (server_embedding.py, server_generative.py)
Signed-off-by: Senan Zedan <[email protected]>
---------
Signed-off-by: Senan Zedan <[email protected]>1 parent ed3ad2b commit 327eeb5
File tree
13 files changed
+1478
-2
lines changed- e2e
- profiles/routing-strategies
- testcases
- testdata/mcp
13 files changed
+1478
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| |||
70 | 72 | | |
71 | 73 | | |
72 | 74 | | |
73 | | - | |
| 75 | + | |
74 | 76 | | |
75 | 77 | | |
76 | 78 | | |
77 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
78 | 88 | | |
79 | 89 | | |
80 | 90 | | |
| |||
84 | 94 | | |
85 | 95 | | |
86 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
87 | 106 | | |
88 | 107 | | |
89 | 108 | | |
| |||
108 | 127 | | |
109 | 128 | | |
110 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
111 | 137 | | |
112 | 138 | | |
113 | 139 | | |
| |||
323 | 349 | | |
324 | 350 | | |
325 | 351 | | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
0 commit comments