Skip to content

test(proxy): move proxy_server, _experimental and db tests into tests/unit/proxy - #44012

Merged
yuneng-berri merged 2 commits into
mainfrom
litellm_migrate_proxy_tests_p5
Oct 1, 2026
Merged

yuneng-berri merged 2 commits into
mainfrom
litellm_migrate_proxy_tests_p5

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

TLDR

Problem this solves:

  • tests/test_litellm/proxy still holds the proxy_server, _experimental and db tests
  • They belong in the unit tier at tests/unit/proxy/<same path>

How it solves it:

  • git mv of the three directories (165 files, all renames)
  • Folds the legacy _experimental/mcp_server/conftest.py into the destination one, which already has all four of its fixtures
  • Rewrites the proxy-server and proxy-infra shard paths in test-unit.yml, shard names unchanged
  • Stubs the two tests that reached HIBP and Hugging Face at the HTTP boundary

PR 5 of 7, stacked on #44006

Screenshots / Proof of Fix

Coverage ledger

Same ledger.py as #43998, base origin/litellm_migrate_proxy_tests_p4

base origin/litellm_migrate_proxy_tests_p4: 7252 node ids in 166 legacy files
head litellm_migrate_proxy_tests_p5: 7252 node ids
renamed files: 165, deleted legacy files: 1
carried over after path mapping: 7252
missing explained: 0
missing unexplained: 0
head ids with no base counterpart: 0

The one deleted legacy file is the mcp_server/conftest.py collision, which holds fixtures and no tests

Ownership

tests/unit/proxy/proxy_server runs in proxy-server. tests/unit/proxy/db runs in proxy-infra, except for the two files test-unit-proxy-db.yml already owns (db_transaction_queue/test_e2e_pod_lock_manager.py, test_update_daily_tag_spend.py). tests/unit/proxy/_experimental/mcp_server is already on the mcp-integration shard's unit-flag list in .circleci/scripts/unit_selection.sh, so proxy-infra ignores it and each file runs in exactly one GHA shard. assert_ci_coverage.py prints OK in every mode, and tests/unit/test_package_layout.py passes

Runs

tests/unit/proxy/proxy_server, tests/unit/proxy/db and tests/unit/proxy/_experimental/mcp_server, env -i with outbound sockets blocked, -n 4: 7736 passed, 3 skipped. The 21 test_semantic_tool_filter.py cases fail locally with No module named 'semantic_router', the same as at the legacy path on the base, because that optional extra is missing from the local venv. Run separately, the two proxy-db-owned db files give 4 passed, 8 skipped

A probe recorded every non-loopback socket.connect, connect_ex and getaddrinfo across the moved set. After the two stubs below it recorded nothing

Non-rename edits

file +/- reason
.github/workflows/test-unit.yml 6/3 proxy-server and proxy-infra paths, plus the ignores described above
tests/unit/proxy/conftest.py 17/2 the proxy state restore deep-copied every snapshotted module attr. GATED_AUTO_ROUTER_CAPABILITIES is a tuple of dataclass instances, so each test got fresh copies and the is lookup in count_capability_routers stopped matching, which made 8 license-limit tests in proxy_server fail with DID NOT RAISE. Values that hold no list, dict, set or bytearray now keep their identity
proxy_server/test_routes_onboarding.py 20/2 network: the claim flow's breached-password check called api.pwnedpasswords.com. A respx route on the k-anonymity range URL now returns an unrelated suffix through the shared httpx_transport fixture. Returning the real suffix from that route turns the test red
proxy_server/test_routes_utils.py 9/1 network: get_max_tokens fetched a model's config.json from huggingface.co. A respx 404 on that exact URL plus local_model_cost_map keeps it offline. The asserted route 404 does not depend on that response
Makefile 2/2 test-unit-proxy-core and test-unit-proxy-misc paths and the same proxy-db ignores as the shards
.gitignore 1/1 path of the moved test_mcp_server_manager.py
tests/proxy_behavior/spend/test_autorouter_session_rollup.py, db/test_rds_iam_token_expiry.py, proxy_server/conftest.py, proxy_server/test_team_model_name_translation.py 1/1 each docstring paths
5 new __init__.py 0/0 empty package markers for moved dirs

litellm/proxy/_experimental/mcp_server/AGENTS.md and utils.py still mention the old test path. They are production files, so PR 7 leaves them alone too

Type

✅ Test

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/d9bda95617da464e88d3619765819d0e
Open in Devin Desktop: https://app.devin.ai/desktop/session/d9bda95617da464e88d3619765819d0e?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

@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Low risk] Reorganizes test files into a new directory structure.

The PR appears safe to merge.

Summary

The PR relocates proxy-server, database, and MCP tests into the unit-test tree and updates test selection accordingly.

  • Consolidates the MCP fixtures at the destination.
  • Adds HTTP stubs for the onboarding and Hugging Face test paths.
  • Adjusts the proxy state-restoration fixture to preserve identities needed by the moved tests.

Reviews (1) · Last reviewed commit: "test(proxy): keep tuple identity in prox..."

@codecov

codecov Bot commented Oct 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@devin-ai-integration
devin-ai-integration Bot force-pushed the litellm_migrate_proxy_tests_p4 branch from 082066c to 581c1c8 Compare October 1, 2026 12:46
@devin-ai-integration
devin-ai-integration Bot force-pushed the litellm_migrate_proxy_tests_p5 branch 2 times, most recently from 08350ee to 2da439c Compare October 1, 2026 14:13
@devin-ai-integration
devin-ai-integration Bot force-pushed the litellm_migrate_proxy_tests_p4 branch from 21fba8f to c79c50c Compare October 1, 2026 16:33
@devin-ai-integration
devin-ai-integration Bot force-pushed the litellm_migrate_proxy_tests_p5 branch from 2da439c to 8b8dc59 Compare October 1, 2026 16:33
@yuneng-berri
yuneng-berri force-pushed the litellm_migrate_proxy_tests_p4 branch from c79c50c to c796fb3 Compare October 1, 2026 17:52
@yuneng-berri
yuneng-berri force-pushed the litellm_migrate_proxy_tests_p5 branch from 8b8dc59 to 7814e2c Compare October 1, 2026 17:53
Base automatically changed from litellm_migrate_proxy_tests_p4 to main October 1, 2026 18:06
@yuneng-berri
yuneng-berri requested a review from a team October 1, 2026 18:06
yuneng-berri and others added 2 commits October 1, 2026 11:06
…/unit/proxy

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…target paths

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@yuneng-berri
yuneng-berri force-pushed the litellm_migrate_proxy_tests_p5 branch from 7814e2c to 4f02a99 Compare October 1, 2026 18:07
@yuneng-berri
yuneng-berri enabled auto-merge (squash) October 1, 2026 18:13
@yuneng-berri
yuneng-berri merged commit 24584d3 into main Oct 1, 2026
88 of 91 checks passed
@yuneng-berri
yuneng-berri deleted the litellm_migrate_proxy_tests_p5 branch October 1, 2026 18:14
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.

1 participant