Skip to content

test: update stale integration and e2e expectations for intended changes - #53940

Merged
yuneng-berri merged 1 commit into
mainfrom
litellm_/rc-1-112-0-qualify-7ca99e
Nov 23, 2026
Merged

yuneng-berri merged 1 commit into
mainfrom
litellm_/rc-1-112-0-qualify-7ca99e

Conversation

@yuneng-berri

@yuneng-berri yuneng-berri commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Handwritten 1-3 sentence description

[insert handwritten description here]

Details

TLDR

Problem this solves:

  • Nine integration and e2e tests fail on main and rc/1.112.0
  • Each pins behavior that a merged PR changed on purpose
  • The red hides real regressions in the same suites

How it solves it:

  • Update each stale expectation to the intended behavior
  • Keep every assertion about the behavior the test protects
  • Leave the one real bug (vLLM error type) red
Test Changed on purpose by Update
test_effective_settings::test_an_sso_client_removed_... #53205, /sso/key/generate without SSO redirects to /ui/login the helper treats that redirect as "no SSO client"
test_budget_updates::test_partial_update_keeps_sibling_budget_fields #52477, #52787, #53232 added app relations to the budget table expect the 11 app relation keys as unloaded
test_performance_alerts::test_opt_out_is_shared_... #52139 added thresholds to /alerts/monitoring expect the default thresholds
test_cost_margin_discount::test_discount_and_margin_... #52406 made customer a valid margin key expect the new error text
test_vertex_image_regional_uplift::...[regional-two-images] #52103 sends Gemini n single-image requests script one image per call, expect n calls
test_app_customer_budgets::test_rotating_a_virtual_key_... /key/regenerate swaps the token, so the old key's delete 404s the rotated key's cleanup tolerates the rotation
test_openai_compatible_permission_denied_wire::test_guard_deepseek_upstream_401_... #53217 relays the upstream error type expect the relayed invalid_request_error
test_decisions_basic_hosted_vllm[...predicate_rejected] #53217 relays the plain upstream message expect the plain message, keep invalid_request_error
test_config_misc_endpoints_e2e::test_callbacks_list_reports_active_logging_callbacks #52182 registers the Rust spend logger (spend_log) when a DB is present accept either spend logger

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have added meaningful tests
  • The handful of test files covering my change pass locally, e.g. 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
  • My PR passes all required CI/CD checks (e.g., lint, schema.d.ts sync check, etc.)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • Every automated review on my PR's latest commit has finished, and I have addressed or replied to each of its findings before requesting a maintainer review

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

E2E exception at 101bda2. The diff only touches tests, and the proof is each updated test going from red to green on the same product code. Both legs ran the same integration nodes through tests/integration/run.py against a throwaway UTC Postgres. The before leg is main at 073ab00 with the old tests, and the after leg is the same commit with this diff applied.

Command (run once per group, before and after)
env -i PATH="$VENV/bin:/usr/bin:/bin" HOME="$HOME" \
  PYTHONPATH="$TREE:$TREE/tests:$TREE/tests/e2e" INTEGRATION_PYTHON="$VENV/bin/python" \
  DATABASE_URL="postgresql://postgres@127.0.0.1:55911/postgres" \
  LITELLM_MODE=PRODUCTION LITELLM_LOCAL_MODEL_COST_MAP=True LITELLM_LICENSE="$LITELLM_LICENSE" \
  LITELLM_MASTER_KEY="sk-$(openssl rand -hex 16)" LITELLM_SALT_KEY="sk-$(openssl rand -hex 16)" \
  INTEGRATION_PROXY_DATABASE_URL= INTEGRATION_PROXY_READ_REPLICA_URL= INTEGRATION_ROUTING= INTEGRATION_PEER_URL= \
  "$VENV/bin/python" tests/integration/run.py <group> --workers 2 --results <dir> <nodes>

Groups and nodes: accounting (the app customer budgets rotation case, the cost margin test, the whole vertex image uplift file), database (the performance alerts opt-out test), management (the budget partial update and SSO client removal tests), providers (the whole DeepSeek permission-denied file and the whole hosted_vllm decisions file).

Group Before (073ab00) After (101bda2)
accounting 4 failed, 32 passed 1 failed, 35 passed
database 1 failed 1 passed
management 2 failed 2 passed
providers 2 failed, 7 passed 1 failed, 8 passed

The one accounting failure left after the change is test_openai_style_image_deployment_is_untouched, a real billing bug from #52103 that this PR doesn't touch. In providers, the vLLM predicate_rejected case still fails, and now its only difference is type: "BadRequestError" against the expected invalid_request_error. That's the real bug #51809 fixes.

The e2e /callbacks/list change was checked against a DB-backed proxy, whose /callbacks/list includes spend_log and not _ProxyDBLogger. That matches the Buildkite e2e failure on main and rc.

Lint: ruff check --config .github/linters/ruff-tests.toml on the changed files passes, and test_quality_gate.py, type_discipline_gate.py, ruff_strict_gate.py and type_check_gate.py pass against the merge base. basedpyright on the changed e2e file reports 0 errors.

Type

✅ Test

Caveats (if any)

Low

QA runbook

  • tests/e2e/management/test_config_misc_endpoints_e2e.py::TestInventoryRoutes::test_callbacks_list_reports_active_logging_callbacks - a DB-backed proxy lists its spend logger among the active callbacks
    • Start a proxy with a DATABASE_URL and default general_settings
    • curl http://localhost:4000/callbacks/list -H "Authorization: Bearer $LITELLM_MASTER_KEY"
    • Expect spend_log in success, failure or success_and_failure (or _ProxyDBLogger with use_spend_logs_ledger: false)
    • Sanity check: this test makes sense to add and is not hand-wavey (e.g., assert actual expected spend instead of just spend > 0) or potentially flaky

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

Brings nine tests in line with behavior that intentionally changed:

- SSO client removal: /sso/key/generate without SSO now redirects to /ui/login (#53205)
- budget partial update: /budget/info returns the app relation keys (#52477, #52787, #53232)
- performance alerts opt-out: /alerts/monitoring returns thresholds (#52139)
- cost margin rejection: the error names 'customer' as a valid key (#52406)
- regional two-image generation: Gemini gets n single-image requests (#52103)
- customer app budget key rotation: the rotated key's cleanup tolerates /key/regenerate
- DeepSeek 401: the upstream error type is relayed (#53217)
- vLLM rejected predicate: the plain upstream message is relayed (#53217). The case still
  fails on the non-OpenAI error type that #51809 fixes
- /callbacks/list e2e: the Rust spend logger is listed as spend_log (#52182)
@veria-ai

veria-ai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

PR overview

No security issues were found in this pull request.

Reviews

@yuneng-berri
yuneng-berri merged commit 96ae5fa into main Nov 23, 2026
48 of 49 checks passed
@yuneng-berri
yuneng-berri deleted the litellm_/rc-1-112-0-qualify-7ca99e branch November 23, 2026 22:27
mateo-berri pushed a commit to zoveki/litellm that referenced this pull request Nov 25, 2026
Backport the affected integration tests from BerriAI#53940, BerriAI#49310, BerriAI#54111, BerriAI#48665, and BerriAI#49667.

Upstream commits: 96ae5fa, fbd126e, c90dfea, 21ab2cb, da04c60

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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.

2 participants