Repository navigation
chore: remove outdated tests/compliance suite - #5935
Conversation
|
Hi @Altamimi-Dev — heads-up on sequencing between this PR and #6125 (removing the What changes under you once #6125 merges:
For context on where protocol-conformance coverage is headed: epic #6018 wires Anthropic's MCP conformance suite into the Happy to help with the rework once #6125 is in — just ping me. |
d6a0c8c to
66e1e8b
Compare
|
@jonpspri thanks for the sequencing heads-up — that saved a messy merge. Reworked on top of #6125 exactly as you outlined, and the PR body is updated to match. Markers. I took the no-consumers rule to its conclusion and removed all nine registrations that #6125 orphaned, not just the two you called out ( Docs. Dropped rather than repointed, per your preference — the CI. The Local verification after the rework: |
66e1e8b to
0e8b8e9
Compare
ja8zyjits
left a comment
There was a problem hiding this comment.
Hi @jonpspri
Please check these reviews
Findings
1. [Medium] Makefile help index cleanup is incomplete and contradicts the PR claim
- File:
Makefile— diff hunk@@ -876,11 +869,6 @@(diff lines 32–43, removed help lines at 36–40) - Category: Documentation accuracy vs implementation
Observation. The hunk removes the 2025-11-25* help lines. The PR description says it also "drops a stale duplicate # help: test-live-gateway … (mcp + sso + protocol_compliance + e2e_rust) line". The diff removes no test-live-gateway help line.
At head, Makefile:847 still reads # help: test-live-gateway - Run ALL live-gateway tests (mcp + sso + protocol_compliance). The recipe at Makefile:995 says (mcp + sso). make help therefore still advertises protocol_compliance, a suite that #6125 removed.
Impact. The PR description says a git grep sweep for protocol_compliance finds nothing. That claim is false at head. The issue criterion "No dangling references … in the Makefile" is not met.
Fix. Change Makefile:847 to (mcp + sso) in this PR. Or correct the PR description and track the fix separately.
Scope caveat. Makefile:847 is outside the diff hunks. The finding is anchored to the help-index hunk that this PR edits. Drop it if the delta is judged strictly line by line.
2. [Medium] Capability-gated tasks/* behavior loses all coverage
- File:
tests/compliance/mcp_2025_11_25/tasks/test_tasks_optional_capability.py— diff lines 759–820 - Category: Coverage gap from deleted tests
Observation. The deleted file asserts two things:
initializecapabilities do not containtasks(diff line 792).tasks/list,tasks/get,tasks/result, andtasks/cancelreturn JSON-RPC-32601or-32602when not advertised (diff lines 801–820).
No remaining test under tests/ asserts either. A grep for tasks/(list|get|cancel|result) matches only A2A tests (test_a2a_protocol.py, test_a2a_sdk_integration.py, test_internal_runtime_trust.py, test_tool_service_coverage.py). Those cover a different surface. A change that advertises tasks without implementing it passes make test.
Fix. Add one unit test in tests/unit/mcpgateway/. It checks that initialize capabilities omit tasks and that the four tasks/* methods return method-not-found. Or record the gap on epic #6018.
3. [Medium] JSON-RPC batch rejection on /mcp/ has no end-to-end assertion
- File:
tests/compliance/mcp_2025_11_25/base/test_no_batch_payloads.py— diff lines 260–298 (assertions at 295–298) - Category: Coverage gap, deny-path
Observation. The deleted test posts [{"jsonrpc":"2.0","id":1,"method":"ping"}] to the streamable HTTP endpoint. It asserts HTTP 400, jsonrpc == "2.0", and error code -32600 or -32602.
The only remaining batch tests are test_maybe_short_circuit_notification_falls_through_for_batch (tests/unit/mcpgateway/transports/test_streamablehttp_transport.py:9049) and the test at line 18262. Both assert only that the short-circuit helper falls through and leaves the array to the SDK. Neither asserts that the gateway rejects the batch. If the SDK stops rejecting batches, no test fails.
Fix. Add a test that sends a batch array through the streamable HTTP app. Assert status 400 and the error envelope. Or record the gap on epic #6018.
4. [Low] Method inventory guard, schema sweep, and initialize negative case removed with no replacement
- Files:
tests/compliance/mcp_2025_11_25/base/test_method_inventory_guard.py— diff lines 195–259tests/compliance/mcp_2025_11_25/base/test_schema_surface_runtime.py— diff lines 299–429tests/compliance/mcp_2025_11_25/manifest/schema_methods.yaml— diff lines 653–692tests/compliance/.../test_initialize.py— diff lines 566–623
- Category: Coverage gap, edge case
Observation. The removed tests did three jobs:
- The inventory guard compared
mcp.typesmethod literals with a pinned manifest (diff lines 252–259). It also pinnedLATEST_PROTOCOL_VERSION == "2025-11-25"(diff lines 244–245). It failed on SDK upgrades that add or remove methods. - The sweep sent every request method and notification with sample params. It asserted a valid JSON-RPC envelope with exactly one of
resultorerror, and202for notifications (diff lines 404–408, 429). test_initialize.pychecked that a missingprotocolVersionreturns-32602. Only the happy path survives (tests/live_gateway/e2e/test_e2e.py:632).
No other test iterates all MCP methods against the live router. tests/unit/mcpgateway/test_mcp_method_registry.py:73 checks only a short method list. SDK drift, unhandled methods, and non-envelope responses now go undetected.
Fix. Optional. Extend test_mcp_method_registry.py to cover the mcp.types method inventory and the missing-protocolVersion case. Or defer to epic #6018.
Observations (not findings)
- The PR description lists edits to
crates/mcp_runtime/RELEASE-CHECKLIST.md. That file is not in the diff, andcrates/is absent from this checkout. Confirm the edits belong to this PR or to a sibling PR. - The PR header says "3 additions". This matches the diff: the
generated_atchange in.secrets.baselineand the--ignoreedit inpyproject.toml.
Checks with no finding
Configuration and docs
pyproject.toml(diff lines 126–150): removal of--ignore=tests/complianceand the 12 markers is correct. The markers aremcp20251125,mcp_core,mcp_tasks,mcp_required,mcp_recommended,mcp_optional,mcp_base,mcp_lifecycle,mcp_transport_core,mcp_server_features,mcp_utilities, andmcp_auth. A repo-wide grep finds no consumer. Themcp_authhits intest_rest_tool_sigv4.pyare local variables. The# pragma: allowlist secretcomment sat on the removedmcp_authline. TOML syntax stays valid.Makefile(diff lines 18–109):MCP_2025_*,MCP_2025_TEST_ENV, the five targets (2025-11-25,-core,-tasks,-auth,-report), their help lines, and the.PHONYentries are removed together. No dangling reference remains in the delta. The only leftover is finding 1.docs/docs/architecture/explorer.html(diff line 118): the "MCP Compliance" card is removed. JS array syntax stays valid. No othertestTypescount text needs an update..secrets.baseline(diff lines 9–10): only thegenerated_attimestamp changed. No secret entries changed.
Deleted tests with equivalent coverage elsewhere
test_streamable_http_protocol_header.py(diff lines 821–872): the unsupported-version case (-32022,data.requested,data.supported) is covered bytests/unit/mcpgateway/middleware/test_protocol_version.pyandtests/live_gateway/mcp/test_inbound_protocol_mode.py.test_protected_resource_metadata.py(diff lines 154–194):/.well-known/oauth-protected-resourceis covered bytest_well_known_rfc9728.py,tests/e2e/test_oauth_protected_resource.py, andtest_well_known.py.test_discovery_methods.py(diff lines 693–758): list-method shapes are covered bytest_mcp_catalog_pagination.pyandtests/live_gateway/e2e/test_e2e.py.logging/setLevelis covered bytest_main.py:4180andtest_main_extended.py:6600, including permission-denied cases.test_ping_and_notifications.py(diff lines 873–931):notifications/initializedandnotifications/cancelledare covered bytest_streamablehttp_transport.pyand live-gateway tests.
0e8b8e9 to
1690e82
Compare
Address review findings on IBM#5935. - Makefile: remove protocol_compliance from the test-live-gateway help line. The recipe already says (mcp + sso). - Add a unit test that tasks/list, tasks/get, tasks/result and tasks/cancel return -32601. - Add a unit test that initialize does not advertise tasks. - Add a unit test that initialize without a protocol version returns HTTP 400 with the MCP-Error-Code header. - Add a unit test that the streamable HTTP app rejects a JSON-RPC batch with HTTP 400. Signed-off-by: Ahmad Al Tamimi <altamimi.dev@gmail.com>
|
Thank you for the review. Commit 1690e82 addresses the findings.
Observations. The PR does not edit The branch now has two commits: the suite removal, then the test additions. |
Closes IBM#5835 The tests/compliance/mcp_2025_11_25 tree is excluded from the default pytest run. It duplicates the live-gateway coverage of lifecycle, transport, ping and notifications, discovery, and PRM authorization. Protocol-conformance coverage returns with epic IBM#6018. - Delete tests/compliance/ (12 files). - Makefile: remove the MCP_2025_* variables, MCP_2025_TEST_ENV, and the 2025-11-25, -core, -tasks, -auth and -report targets with their help lines. Remove protocol_compliance from the test-live-gateway help line. - pyproject.toml: remove --ignore=tests/compliance from addopts. Remove the markers that no test uses: mcp20251125 and the mcp_* markers. - docs/docs/architecture/explorer.html: remove the MCP Compliance card. Signed-off-by: Ahmad Al Tamimi <altamimi.dev@gmail.com> Signed-off-by: Jonathan Springer <jps@s390x.com>
Address review findings on IBM#5935. - Makefile: remove protocol_compliance from the test-live-gateway help line. The recipe already says (mcp + sso). - Add a unit test that tasks/list, tasks/get, tasks/result and tasks/cancel return -32601. - Add a unit test that initialize does not advertise tasks. - Add a unit test that initialize without a protocol version returns HTTP 400 with the MCP-Error-Code header. - Add a unit test that the streamable HTTP app rejects a JSON-RPC batch with HTTP 400. Signed-off-by: Ahmad Al Tamimi <altamimi.dev@gmail.com> Signed-off-by: Jonathan Springer <jps@s390x.com>
1690e82 to
0e82996
Compare
marekdano
left a comment
There was a problem hiding this comment.
The grep for dangling references is clean at 0e82996.
LGTM 🚀
Non-blocking follow-up: the "no tasks capability" test covers session_registry.handle_initialize_logic (/rpc and internal dispatch), not the /mcp path, which builds capabilities in streamablehttp_transport.get_capabilities (line 476). Worth a test there in a later PR so a regression on /mcp is caught.
35bb8c6
Closes #5835
Summary
The old
tests/compliance/mcp_2025_11_25/tree was excluded from the default pytest run. It duplicated the live-gateway coverage of lifecycle, transport semantics, ping and notifications, discovery, and PRM/authorization.#6125 removed
tests/live_gateway/protocol_compliance/and themake test-protocol-compliance*targets. This PR removes the compliance references instead of repointing them. Protocol-conformance coverage returns with epic #6018.Changes
tests/compliance/(12 files).MCP_2025_*variables,MCP_2025_TEST_ENV, and the2025-11-25,-core,-tasks,-authand-reporttargets with their help lines. Removeprotocol_compliancefrom thetest-live-gatewayhelp line.--ignore=tests/compliancefrom pytestaddopts. Remove the markers that no test uses:mcp20251125,mcp_core,mcp_tasks,mcp_required,mcp_recommended,mcp_optional,mcp_base,mcp_lifecycle,mcp_transport_core,mcp_server_features,mcp_utilitiesandmcp_auth.docs/docs/architecture/explorer.html.tasks/list,tasks/get,tasks/resultandtasks/cancelreturn-32601.initializedoes not advertisetasks.initializewithout a protocol version returns HTTP 400.Not replaced
The method-inventory guard and the all-methods schema sweep have no replacement. They are tracked on #6018.