Skip to content

test(proxy): move utils, agent_endpoints and endpoint tests into tests/unit/proxy - #44006

Merged
yuneng-berri merged 4 commits into
mainfrom
litellm_migrate_proxy_tests_p4
Oct 1, 2026
Merged

yuneng-berri merged 4 commits into
mainfrom
litellm_migrate_proxy_tests_p4

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

TLDR

Problem this solves:

  • tests/test_litellm/proxy still holds utils, agent_endpoints and 27 small endpoint test dirs
  • They belong in the unit tier at tests/unit/proxy/<same path>

How it solves it:

  • git mv of the 29 directories (141 files, all pure renames, no test file name collisions)
  • Ports the legacy disconnected_prisma fixture into tests/unit/proxy/conftest.py
  • Rewrites the proxy-endpoints shard paths in test-unit.yml, shard name unchanged
  • Adds __init__.py to the moved dirs that lacked one so test_package_layout.py passes

PR 4 of 7, stacked on #44003

Screenshots / Proof of Fix

Coverage ledger

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

base origin/litellm_migrate_proxy_tests_p3: 5831 node ids in 141 legacy files
head litellm_migrate_proxy_tests_p4: 5831 node ids
renamed files: 141, deleted legacy files: 0
carried over after path mapping: 5831
missing explained: 0
missing unexplained: 0
head ids with no base counterpart: 0

Runs

The proxy-endpoints shard command, env -i with outbound sockets blocked, -n 4: 14492 passed, 9 skipped, 1 xfailed. The four pre-existing destination files that test-unit-proxy-db.yml owns, run on their own: 28 passed. assert_ci_coverage.py prints OK in both modes, and tests/unit/test_package_layout.py passes

Outbound calls were checked with a probe that records every non loopback socket.connect, connect_ex and getaddrinfo while pytest-socket still blocks them. It recorded nothing across the moved set, so no test needed an HTTP stub here

Non-rename edits

file +/- reason
.github/workflows/test-unit.yml 33/29 proxy-endpoints runs the moved dirs from tests/unit/proxy and ignores the 4 destination files test-unit-proxy-db.yml already owns, so each file runs in exactly one GHA shard
tests/unit/proxy/conftest.py 23/0 the legacy disconnected_prisma fixture and its stub classes, used by a moved utils test
agent_endpoints/test_endpoints.py 5/5 tests.test_litellm.proxy.* helper imports now point at tests.unit.proxy.*
utils/prisma_and_spend/_harness_smoke_test.py 2/2 same import path change
Makefile 1/1 test-unit-proxy-misc paths, plus --ignore for the same 4 files test-unit-proxy-db.yml owns, matching the shard
tests/proxy_behavior/spend/test_cache_activity.py 1/1 docstring path to the moved analytics test
11 new __init__.py 0/0 empty package markers for the moved dirs

.circleci/scripts/unit_selection.sh is unchanged: the moved files fall into the unit catch-all

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; no outstanding findings were identified.

Summary

The PR moves proxy endpoint and utility tests into tests/unit/proxy, updates their imports and test-runner paths, and carries over the disconnected-Prisma fixture. The changes since the previous review remove two redundant fixture docstrings.

Reviews (4) · Last reviewed commit: "test(proxy): drop the redundant fixture ..."

Comment thread Makefile Resolved
@devin-ai-integration
devin-ai-integration Bot force-pushed the litellm_migrate_proxy_tests_p3 branch from 6a6617c to 9a27bd5 Compare October 1, 2026 11:08
@devin-ai-integration
devin-ai-integration Bot force-pushed the litellm_migrate_proxy_tests_p4 branch from c467f04 to 1ee9229 Compare October 1, 2026 11:09
@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

Copy link
Copy Markdown
Contributor Author

@greptileai review

@greptile-apps

This comment has been minimized.

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

@greptileai a2a/test_discovery.py is a pure rename here. The stack spec allows no content edits beyond egress stubs, so its existing doubles move unchanged

@greptile-apps

greptile-apps Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

That’s fair. a2a/test_discovery.py is a pure rename in this PR, and the existing fetch_well_known_card/endpoint stubs are part of the test’s established isolation rather than a newly introduced test-coverage change. Given the stack specification permitting only path changes (apart from egress stubs), this is not actionable for PR #44006; I’m withdrawing the finding.

@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

Copy link
Copy Markdown
Contributor Author

@greptileai review

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

Copy link
Copy Markdown
Contributor Author

@greptileai review

@devin-ai-integration
devin-ai-integration Bot force-pushed the litellm_migrate_proxy_tests_p3 branch from a240878 to 2f9fda7 Compare October 1, 2026 16:33
@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
Base automatically changed from litellm_migrate_proxy_tests_p3 to main October 1, 2026 17:52
@yuneng-berri
yuneng-berri requested a review from a team October 1, 2026 17:52
yuneng-berri and others added 4 commits October 1, 2026 10:52
…s/unit/proxy

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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_p4 branch from c79c50c to c796fb3 Compare October 1, 2026 17:52
@yuneng-berri
yuneng-berri merged commit 25109a5 into main Oct 1, 2026
100 of 102 checks passed
@yuneng-berri
yuneng-berri deleted the litellm_migrate_proxy_tests_p4 branch October 1, 2026 18:06
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