Repository navigation
test(router): cover configured mode lookup - #39634
Merged
moe-berri merged 1 commit intoSep 3, 2026
Merged
Conversation
Contributor
Greptile SummaryAdds direct unit coverage for configured Router mode lookup.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| tests/test_litellm/test_router.py | Adds isolated configured-mode lookup tests without introducing a new actionable issue. |
Reviews (2): Last reviewed commit: "test(router): cover configured mode look..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
Author
|
bugbot run |
Contributor
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit a264c62. Configure here.
6 of 7 tasks
Merged
4 of 6 tasks
pull Bot
pushed a commit
to chizee/litellm
that referenced
this pull request
Sep 3, 2026
PRs BerriAI#39630 and BerriAI#39634 both added test_get_configured_mode_reads_deployment_model_info to tests/test_litellm/test_router.py, so the staging tip defines it twice and the required lint check fails with F811 on every PR synced past 321636e. Keep the four tests from BerriAI#39634 (mode read, None for unset or unknown, no wildcard pattern routing, malformed values treated as absent), which subsume the BerriAI#39630 pair, and delete that pair. Five hand-applied mutations of Router.get_configured_mode are all still killed by the surviving tests.
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:
get_configured_modeis only tested indirectlyHow it solves it:
User Flow
Before: a LiteLLM contributor sees the Router coverage check fail after merging #39619
code-qualitycheck forlitellm_internal_stagingget_configured_modeas untestedAfter: the same Router coverage check recognizes direct tests and passes
code-qualitycheck for this pull requestuntested_perc: 0.0Relevant issues
Follow-up to #39619
Linear ticket
Pre-Submission checklist
uv run pytest tests/test_litellm/<your_test_file>.py -v. Leave the suites (make test-unit-*,make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more@greptileaito re-request a review after pushing changes)Delays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
Screenshots / Proof of Fix
Before (828d561)
.venv/bin/python tests/code_coverage_tests/router_code_coverage.pyException: 0.29% of functions in router.py are not tested: ['get_configured_mode']After (a264c62)
.venv/bin/python tests/code_coverage_tests/router_code_coverage.pyuntested_perc: 0.0Type
✅ Test
Caveats (if any)
Final Attestation
Note
Low Risk
Test-only changes with no production code modifications.
Overview
Adds direct unit tests for
Router.get_configured_modeintest_router.py, addressing Router coverage CI that flagged the method as untested after #39619.The new cases assert it returns deployment
model_info.modefor a concrete model name, returnsNonefor missing deployments or unset mode, does not invoke wildcard pattern routing (patchedpattern_router.route), and treats non-string or blank/malformedmodevalues as absent.Reviewed by Cursor Bugbot for commit a264c62. Bugbot is set up for automated code reviews on this repo. Configure here.