Repository navigation
test: model the team membership lookup in MCP DCR admission fixtures and assert decisions call types per route - #45917
Merged
Conversation
…and assert decisions call types per route Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Contributor
|
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 2596cd9. Configure here.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
5 of 7 tasks
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:
mainsince the 21:47 UTC runHow it solves it:
adecisionson/v1/decisionsandasystemoneon/v1/systemoneFailing test ids on
maintests/unit/proxy/_experimental/mcp_server/auth/test_user_api_key_auth_mcp.py::TestMCPDcrBridgeDelegateAdmission(8 tests, starting withtest_admit_helper_returns_new_headers_without_mutating_input) in job [mcp-integration 2256256]([REDACTED SECRET]/gh/BerriAI/litellm/2256256). Culprit is 5325c4a (#43887), which maderun_centralized_common_checksawaitget_team_membership. The fixtures replaceuser_api_key_cachewith a syncMagicMock, so awaitingasync_get_cacheraisesTypeErrorand the admission gate fails closed with 401Invalid or expired credential. The fixtures now patchget_team_membershipto return no membership row, the same way they already patchget_team_objectandget_project_objecttests/integration/providers/test_databricks_decisions_wire.py::test_an_openai_format_request_at_v1_decisions_reaches_the_serving_endpoint_as_system_oneandtests/integration/providers/test_strands_decider_agentcore_wire.py::test_an_arn_deployment_answers_on_every_decisions_route_signed_for_bedrock_agentcorein job [integration-providers 2256241]([REDACTED SECRET]/gh/BerriAI/litellm/2256241). Culprit is 25d9b05 (#45846). Its description says/v1/systemonerows becomeasystemonewhile/v1/decisionsrows stayadecisions, and the endpoint code does exactly that, but the PR also flipped these two assertions for requests sent to/v1/decisionsand/decisions. The ARN test now derives the expected call type per route, still with strict row equalityUser Flow
Before: a maintainer reading the scheduled CircleCI run on
mainsees these jobs red on every runintegrationworkflow onmainmcp-integrationshows 8 failures with 401Invalid or expired credentialintegration-providersshows the two decisions tests expectingasystemoneon/v1/decisionsAfter: the same jobs report only the deferred failures listed under Caveats
mcp-integrationpassesintegration-providersPre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
uv run pytest tests/unit/<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
This is a test-only fix, so the proof is the previously red CircleCI jobs on this branch
Before (541e3ed)
mainpipeline 91130 hasmcp-integrationandintegration-providersred for the tests aboveAfter (2596cd9)
integration-mcppass, all 8TestMCPDcrBridgeDelegateAdmissiontests greenType
✅ Test
Caveats (if any)
Medium
mainpipeline 91130 and outside this fixtest_lazy_routes_flag.pyeager route order differs for configured/langfusepass-through (fix(proxy): let configured pass-through endpoints outrank built-in provider prefix routes #44133 vs feat(proxy): add LITELLM_DISABLE_LAZY_ROUTES to register optional routers at startup #43911), integration-management and replicatest_a_megabyte_endpoint_name_is_refused_in_linear_time_while_liveliness_stays_fastandtest_decisions_basic_hosted_vllm[predicate_rejected]in integration-providerstest_bedrock_guardrail_attachments.pyowned proxy never becomes ready andtest_guardrail_stream_scope_matrix.pygemini variants in integration-extensionse2e_ui_testingande2e_ui_testing_server_root_pathmigrated pagestest_concurrent_team_model_tpm_requests_reserve_tokens_before_reaching_the_provider429 racetest_intent_without_model_blocked_transcript_reports_a_violation_on_the_whisper_defaultupstream realtime 403test_K1_policy_edge_restart_mid_burst_keeps_output_observation_fail_openandtest_passthrough_worker_sigkill_leaves_sibling_serving_and_loggingFinal Attestation
Link to Devin session: https://app.devin.ai/sessions/48f595ff47a1467486dbfd4b6696ca32
Open in Devin Desktop: https://app.devin.ai/desktop/session/48f595ff47a1467486dbfd4b6696ca32?variant=devin
Note
Low Risk
Test-only updates to fixtures and assertions; production behavior is unchanged.
Overview
This PR aligns integration and unit test expectations with current production behavior after recent auth and spend-logging changes—no application code is modified.
Decisions wire tests now expect spend-log
call_typeadecisionsfor OpenAI-format routes (/v1/decisions,/decisions) and keepasystemonefor system-one routes. The Databricks test updates a single assertion; the Strands AgentCore test adds a path→call-type map and checks spend rows per route instead of assumingasystemonefor every response.MCP DCR admission fixtures stub
get_team_membershipto return no membership row (alongside existing prisma/cache mocks), so centralized admission checks no longer hit an un-awaitableMagicMockcache and fail with 401.Reviewed by Cursor Bugbot for commit 2596cd9. Bugbot is set up for automated code reviews on this repo. Configure here.