Skip to content

ci: move provider-independent MCP tests into tests/unit and run mcp-integration from litellm-tests - #42904

Merged
yuneng-berri merged 25 commits into
mainfrom
litellm_ci_mig_5_mcp
Sep 24, 2026
Merged

yuneng-berri merged 25 commits into
mainfrom
litellm_ci_mig_5_mcp

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Stack 5/5 of the split of #42831 (reference PR, stays open until the stack lands). Below: #42903. Carved from litellm_ci_migration_proxy_misc at c17f440 with git checkout <branch> -- <paths>, no rewrites

TLDR

Problem this solves:

  • provider-independent MCP tests live in tests/mcp_tests and only run from GitHub Actions

How it solves it:

  • in-process manager tests -> tests/unit/proxy/_experimental/mcp_server with their conftest.py
  • responses helper tests -> tests/unit/responses/mcp
  • mcp-integration in unit_selection.sh and tests.yml with reruns: 0 and the SDK1 peer venv (MCP_TEST_PEER_PYTHON)
  • test-unit.yml mcp fork-flag so the drained GHA job still runs the moved paths on fork PRs
  • the SDK1 proxy suite and the three provider-bound MCP files stay in tests/mcp_tests

test_mcp_litellm_client.py is byte-identical to main at c17f440, so the split plan's mention of an edit there has nothing to carry

Renames

git diff -M --stat litellm_ci_mig_4_proxy litellm_ci_mig_5_mcp: 10 renames, all at 100 percent

 .circleci/scripts/unit_selection.sh                                                         |  5 ++++
 .circleci/tests.yml                                                                         | 21 +++++++++++++++++
 .github/workflows/test-unit.yml                                                             |  1 +
 tests/unit/proxy/_experimental/__init__.py                                                  |  0
 tests/unit/proxy/_experimental/mcp_server/__init__.py                                       |  0
 tests/unit/proxy/_experimental/mcp_server/conftest.py                                       | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/{mcp_tests => unit/proxy/_experimental/mcp_server}/test_mcp_auth_header_extraction.py |  0
 tests/{mcp_tests => unit/proxy/_experimental/mcp_server}/test_mcp_auth_priority.py          |  0
 tests/{mcp_tests => unit/proxy/_experimental/mcp_server}/test_mcp_chat_completions.py       |  0
 tests/{mcp_tests => unit/proxy/_experimental/mcp_server}/test_mcp_client_unit.py            |  0
 tests/{mcp_tests => unit/proxy/_experimental/mcp_server}/test_mcp_logging.py                |  0
 tests/{mcp_tests => unit/proxy/_experimental/mcp_server}/test_mcp_server.py                 |  0
 tests/{mcp_tests => unit/proxy/_experimental/mcp_server}/test_oauth2_mcp_config.yaml        |  0
 tests/{mcp_tests => unit/proxy/_experimental/mcp_server}/test_openapi_spec_path_url.py      |  0
 tests/{mcp_tests => unit/proxy/_experimental/mcp_server}/test_per_user_oauth_cache.py       |  0
 tests/unit/responses/__init__.py                                                            |  0
 tests/unit/responses/mcp/__init__.py                                                        |  0
 tests/{mcp_tests => unit/responses/mcp}/test_aresponses_api_with_mcp.py                     |  0
 18 files changed, 105 insertions(+)

Tip equals the reference

git diff c17f44074 litellm_ci_mig_5_mcp --stat restricted to the 168 paths #42831 touches shows only the three Greptile follow-ups made on the stack (PR 1 split error capture, PR 2 comment removal, PR 4 Makefile targets):

 .circleci/tests.yml                                             | 5 +++--
 Makefile                                                        | 4 ++--
 tests/proxy_unit_tests/test_proxy_server_gemini_pass_through.py | 2 --
 3 files changed, 5 insertions(+), 6 deletions(-)

The unrestricted diff is main drift plus those three: merging the stack's main merge-base 09ebb28 into c17f440 and diffing that against this branch gives exactly the same three files, so the stack tip is c17f440 plus main plus those connecting edits and nothing else

Type

🚄 Infrastructure
✅ Test

Screenshots / Proof of Fix

litellm-tests on this head: https://app.circleci.com/pipelines/github/BerriAI/litellm/90354

Locally, mcp-integration through unit_selection.sh under the same env -i allowlist with outbound network blocked: 110 passed 1 skipped; the SDK1 suite 30/30 against the peer venv. test_cancellation_delivers_termination_over_tcp[True-hang-5-scope] from the earlier legacy red did not reproduce (48/48 here and on main, file byte-identical to main)

Pre-Submission checklist

  • I have added meaningful tests
  • The handful of test files covering my change pass locally
  • My PR passes all required CI/CD checks
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have received a Greptile Confidence Score of at least 4/5

Final Attestation

  • The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR

Link to Devin session: https://app.devin.ai/sessions/d541aba7e5844703bab65085ef2d54b2
Open in Devin Desktop: https://app.devin.ai/desktop/session/d541aba7e5844703bab65085ef2d54b2?variant=devin

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@codecov

codecov Bot commented Sep 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@greptile-apps

greptile-apps Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge, with no outstanding findings from this review.

Summary

The PR moves provider-independent MCP tests into tests/unit and adds a CircleCI MCP shard with an SDK1 peer environment. The GitHub Actions fork flag keeps the moved tests covered on fork PRs.

Reviews (8) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..."

Comment thread .github/workflows/test-unit.yml
@mateo-berri

Copy link
Copy Markdown
Contributor

@greptileai

@mateo-berri

Copy link
Copy Markdown
Contributor

@greptileai

1 similar comment
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

@greptileai

Comment thread tests/unit/proxy/_experimental/mcp_server/conftest.py
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

@greptileai

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

@greptileai

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

@greptileai

Base automatically changed from litellm_ci_mig_4_proxy to main September 24, 2026 22:59
@devin-ai-integration
devin-ai-integration Bot requested a review from a team September 24, 2026 22:59
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

@greptileai

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants