Skip to content

chore: remove outdated tests/compliance suite - #5935

Merged
brian-hussey merged 3 commits into
IBM:mainfrom
Altamimi-Dev:5835-remove-tests-compliance
Dec 4, 2026
Merged

brian-hussey merged 3 commits into
IBM:mainfrom
Altamimi-Dev:5835-remove-tests-compliance

Conversation

@Altamimi-Dev

@Altamimi-Dev Altamimi-Dev commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

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 the make test-protocol-compliance* targets. This PR removes the compliance references instead of repointing them. Protocol-conformance coverage returns with epic #6018.

Changes

  • 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 pytest addopts. 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_utilities and mcp_auth.
  • Docs: remove the MCP Compliance card from docs/docs/architecture/explorer.html.
  • Tests: add unit tests for coverage that only the deleted suite had.
    • tasks/list, tasks/get, tasks/result and tasks/cancel return -32601.
    • initialize does not advertise tasks.
    • initialize without a protocol version returns HTTP 400.
    • The streamable HTTP app rejects a JSON-RPC batch with HTTP 400.

Not replaced

The method-inventory guard and the all-methods schema sweep have no replacement. They are tracked on #6018.

@jonpspri

Copy link
Copy Markdown
Collaborator

Hi @Altamimi-Dev — heads-up on sequencing between this PR and #6125 (removing the fastmcp dev dependency, closing #5910): the current plan is for #6125 to land first, and this PR will need a rework on top of it.

What changes under you once #6125 merges:

  • tests/live_gateway/protocol_compliance/ is deleted there — including test_oauth_authorization.py, which this PR's body cites as the reason mcp_auth stays registered. After both PRs land, mcp_auth, mcp_utilities, and mcp_tasks have no consumers left anywhere in the tree, so all three marker registrations in pyproject.toml should go.
  • The make test-protocol-compliance* targets and protocol_compliance/README.md are removed there as well, so the doc repoints in this PR (docs/docs/architecture/explorer.html, crates/mcp_runtime/RELEASE-CHECKLIST.md) will need a different treatment — most likely dropping those references, since the suite they would point at no longer exists.
  • Expect a mechanical conflict in the pyproject.toml markers = [...] block and the Makefile compliance targets regardless; resolving after the rework should be straightforward.

For context on where protocol-conformance coverage is headed: epic #6018 wires Anthropic's MCP conformance suite into the make testing-up stack, so the coverage being consolidated here comes back in that form rather than disappearing permanently.

Happy to help with the rework once #6125 is in — just ping me.

@Altamimi-Dev
Altamimi-Dev force-pushed the 5835-remove-tests-compliance branch from d6a0c8c to 66e1e8b Compare August 14, 2026 15:02
@Altamimi-Dev

Copy link
Copy Markdown
Contributor Author

@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 (mcp_auth, mcp_utilities): also mcp_required, mcp_recommended, mcp_optional, mcp_base, mcp_lifecycle, mcp_transport_core, mcp_server_features. Same rationale you gave — zero consumers anywhere in the tree, and main already prunes orphaned markers this way (mcp_client_features, mcp_security). Verified with pytest --collect-only -m "mcp_auth or mcp_utilities or mcp_tasks": 0 collected, 24132 deselected. Happy to restore the extra six lines if you'd rather keep the removal narrow to the two you named.

Docs. Dropped rather than repointed, per your preference — the explorer.html quality card, the four make test-protocol-compliance bullets in RELEASE-CHECKLIST sections 5–8, and the standalone ## 11a. MCP Compliance section. I also removed a stale duplicate # help: test-live-gateway … (mcp + sso + protocol_compliance + e2e_rust) line that #6125 left sitting next to its own updated help line in the Makefile. Mentioned epic #6018 as the successor in the PR body rather than in the docs themselves, so nothing points at a suite that doesn't exist yet.

CI. The .secrets.baseline was regenerated (make detect-secrets-scan, exit 0), which should clear the old IBM Detect Secrets failure. The old pytest-rust failure dates from 2026-08-06 and was a JWT_SECRET_KEY __REPLACE_ME__ rejection — main's pytest-rust.yml now sets that secret, so it should clear on a rerun; this PR only deletes Python tests and docs.

Local verification after the rework: make test 21995 passed / 843 skipped / 0 failed, make ruff and pre-commit on the changed files clean, and a git grep sweep for tests/compliance, MCP_2025, mcp20251125, test-protocol-compliance, protocol_compliance comes back empty. The PR is mergeable again.

@jonpspri jonpspri added the COULD P3: Nice-to-have features with minimal impact if left out; included if time permits label Aug 31, 2026
@jonpspri jonpspri added the work-queue Issues currently being actively triaged and sorted for work. label Nov 21, 2026
@jonpspri
jonpspri force-pushed the 5835-remove-tests-compliance branch from 66e1e8b to 0e8b8e9 Compare November 21, 2026 11:27

@ja8zyjits ja8zyjits left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. initialize capabilities do not contain tasks (diff line 792).
  2. tasks/list, tasks/get, tasks/result, and tasks/cancel return JSON-RPC -32601 or -32602 when 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–259
    • tests/compliance/mcp_2025_11_25/base/test_schema_surface_runtime.py — diff lines 299–429
    • tests/compliance/mcp_2025_11_25/manifest/schema_methods.yaml — diff lines 653–692
    • tests/compliance/.../test_initialize.py — diff lines 566–623
  • Category: Coverage gap, edge case

Observation. The removed tests did three jobs:

  1. The inventory guard compared mcp.types method literals with a pinned manifest (diff lines 252–259). It also pinned LATEST_PROTOCOL_VERSION == "2025-11-25" (diff lines 244–245). It failed on SDK upgrades that add or remove methods.
  2. The sweep sent every request method and notification with sample params. It asserted a valid JSON-RPC envelope with exactly one of result or error, and 202 for notifications (diff lines 404–408, 429).
  3. test_initialize.py checked that a missing protocolVersion returns -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, and crates/ 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_at change in .secrets.baseline and the --ignore edit in pyproject.toml.

Checks with no finding

Configuration and docs

  • pyproject.toml (diff lines 126–150): removal of --ignore=tests/compliance and the 12 markers is correct. The markers are mcp20251125, mcp_core, mcp_tasks, mcp_required, mcp_recommended, mcp_optional, mcp_base, mcp_lifecycle, mcp_transport_core, mcp_server_features, mcp_utilities, and mcp_auth. A repo-wide grep finds no consumer. The mcp_auth hits in test_rest_tool_sigv4.py are local variables. The # pragma: allowlist secret comment sat on the removed mcp_auth line. 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 .PHONY entries 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 other testTypes count text needs an update.
  • .secrets.baseline (diff lines 9–10): only the generated_at timestamp 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 by tests/unit/mcpgateway/middleware/test_protocol_version.py and tests/live_gateway/mcp/test_inbound_protocol_mode.py.
  • test_protected_resource_metadata.py (diff lines 154–194): /.well-known/oauth-protected-resource is covered by test_well_known_rfc9728.py, tests/e2e/test_oauth_protected_resource.py, and test_well_known.py.
  • test_discovery_methods.py (diff lines 693–758): list-method shapes are covered by test_mcp_catalog_pagination.py and tests/live_gateway/e2e/test_e2e.py. logging/setLevel is covered by test_main.py:4180 and test_main_extended.py:6600, including permission-denied cases.
  • test_ping_and_notifications.py (diff lines 873–931): notifications/initialized and notifications/cancelled are covered by test_streamablehttp_transport.py and live-gateway tests.

@jonpspri
jonpspri force-pushed the 5835-remove-tests-compliance branch from 0e8b8e9 to 1690e82 Compare December 1, 2026 15:48
jonpspri added a commit to Altamimi-Dev/mcp-context-forge that referenced this pull request Dec 1, 2026
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>
@jonpspri

jonpspri commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Thank you for the review. Commit 1690e82 addresses the findings.

  1. Makefile help index (Medium): fixed. Makefile:847 now reads (mcp + sso), which matches the recipe. A search of the repo finds no other protocol_compliance reference. The PR description no longer claims a duplicate help line was removed.
  2. tasks/* coverage (Medium): fixed. test_rpc_tasks_methods_return_method_not_found in test_main.py checks that tasks/list, tasks/get, tasks/result and tasks/cancel return -32601. test_initialize_does_not_advertise_tasks_capability in test_session_registry_coverage.py checks that initialize omits tasks.
  3. Batch rejection (Medium): fixed. test_streamable_http_rejects_jsonrpc_batch_array in test_streamablehttp_transport.py posts a batch array to the SDK session manager that wraps the real mcp_app. It asserts HTTP 400, jsonrpc == "2.0", and error code -32600 or -32602.
  4. Inventory guard, schema sweep, initialize negative case (Low): partly fixed.

Observations. The PR does not edit crates/mcp_runtime/, and that directory is not in this checkout. I removed those references from the PR description and the commit message. The PR description also lists the full set of removed markers, including mcp_auth.

The branch now has two commits: the suite removal, then the test additions.

Altamimi-Dev and others added 2 commits December 1, 2026 16:03
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>
@jonpspri
jonpspri force-pushed the 5835-remove-tests-compliance branch from 1690e82 to 0e82996 Compare December 1, 2026 16:04
@jonpspri
jonpspri requested a review from ja8zyjits December 2, 2026 09:53
ja8zyjits
ja8zyjits previously approved these changes Dec 3, 2026

@ja8zyjits ja8zyjits left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

marekdano
marekdano previously approved these changes Dec 3, 2026

@marekdano marekdano left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@brian-hussey
brian-hussey dismissed stale reviews from marekdano and ja8zyjits via 35bb8c6 December 4, 2026 15:47
@brian-hussey
brian-hussey added this pull request to the merge queue Dec 4, 2026
Merged via the queue into IBM:main with commit 1c08290 Dec 4, 2026
57 of 58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

COULD P3: Nice-to-have features with minimal impact if left out; included if time permits testing Testing (unit, e2e, manual, automated, etc) work-queue Issues currently being actively triaged and sorted for work.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove outdated tests/compliance folder (superseded by tests/live_gateway/protocol_compliance)

6 participants