test(mcp): retire the last file of the dead tests/litellm mirror - #37824
Merged
yuneng-berri merged 1 commit intoAug 22, 2026
Merged
Conversation
tests/litellm/ was a second mirror beside tests/test_litellm/ that no workflow, Makefile target, or CircleCI job ever named. Its other 33 files were reconciled during August 2026; this one stayed behind under a ci-coverage-allowlist entry asking a later pass to decide which of its five orphan behaviours still hold. They no longer hold as written: 25 of its 32 cases fail against today's code, because the file froze on the day it stopped being collected and the endpoints kept moving. Three of the five are already covered by the live twin, and better. test_get_request_base_url_xff_trust_gate parametrizes the trust gate in both directions, including the exact untrusted-caller case the orphan asserted, and the standard and legacy protected-resource shapes are both exercised through use_standard_pattern. The other two were the only tests anywhere for validate_trusted_redirect_uri under that same gate, so they are ported rather than dropped, rebuilt on the live file's request-mock conventions. Both directions are load-bearing: forcing is_request_from_trusted_proxy to True fails the untrusted case, forcing it to False fails the trusted one. 313 tests pass in the live file, up from 311. Dropping the dead file clears one zero-assert TQ001 violation, so its ceiling ratchets down with it.
Contributor
Greptile SummaryThis PR retires the final unused Confidence Score: 5/5The PR appears safe to merge, with the retired mirror’s relevant coverage preserved in the active MCP test suite. The added tests drive the production trusted-proxy decision in both directions using the exact settings and request fields read by the implementation, and no actionable regression was identified.
|
| Filename | Overview |
|---|---|
| tests/test_litellm/proxy/_experimental/mcp_server/test_discoverable_endpoints.py | Adds two live test cases that exercise both acceptance and rejection through the real forwarded-header trust gate. |
| tests/litellm/proxy/_experimental/mcp_server/test_discoverable_endpoints.py | Deletes the obsolete mirror after its unique valid trust-gate behavior is ported to the active suite and its other relevant behaviors are already covered there. |
| .github/ci-coverage-allowlist.yml | Removes the obsolete allowlist entry for the deleted mirror file. |
| test-quality-budget.json | Ratchets the TQ001 ceiling alongside the test cleanup; no concrete budget-gate failure was established. |
Reviews (1): Last reviewed commit: "test(mcp): retire the last file of the d..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This was referenced Aug 21, 2026
ryan-crabbe-berri
approved these changes
Aug 22, 2026
yucheng-berri
approved these changes
Aug 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TLDR
Problem this solves:
tests/litellm/is a mirror no job ever ranHow it solves it:
User Flow
No end-user behavior changes. A client hitting
https://litellm-domain/mcp/.well-known/oauth-protected-resource gets the same
response resolved the same way; this is test coverage around those endpoints,
not the endpoints
Relevant issues
Linear ticket
Pre-Submission checklist
Screenshots / Proof of Fix
Shared setup:
is_request_from_trusted_proxydecides whetherX-Forwarded-*headers are believed. Cases 2 and 3 pin its two answers open in turn and ask the
suite whether it notices, which is the only way to tell ported coverage from
ported text.
Before (ff02d5c)
1. the second mirror against today's code
uv run pytest tests/litellm/ -q -p no:randomly | tail -12. the trust gate pinned to always-trust
pin True; uv run pytest $F -q -p no:randomly -k validate_trusted_redirect_uri | tail -1; unpin3. the trust gate pinned to never-trust
pin False; uv run pytest $F -q -p no:randomly -k validate_trusted_redirect_uri | tail -1; unpin4. the live file
uv run pytest $F -q -p no:randomly | tail -1After (13d4074)
1. the second mirror against today's code
uv run pytest tests/litellm/ -q -p no:randomly | tail -12. the trust gate pinned to always-trust
pin True; uv run pytest $F -q -p no:randomly -k validate_trusted_redirect_uri | tail -1; unpin3. the trust gate pinned to never-trust
pin False; uv run pytest $F -q -p no:randomly -k validate_trusted_redirect_uri | tail -1; unpin4. the live file
uv run pytest $F -q -p no:randomly | tail -1Case 3 is the one that justifies porting rather than deleting. A gate that never
trusts anything survives the suite as it stands and is caught after
Type
🧹 Refactoring
✅ Test
Caveats (if any)
tests/integration,load_testsandvector_store_testsstill run nowheretests/litellm-proxy-extrasruns nowhere and 4 of its 28 failtest-quality-budget.json, as do test: drop the cwd-relative sys.path.insert calls from the test suite #37802, test: unwind environment writes in tests/test_litellm with monkeypatch #37806 and test(cost-calc): stop 182 global writes leaking out of the cost-calc suites #37815Final Attestation