fix(e2e): batch credentials wiring and compose harness for live proxy suite - #32744
Conversation
Point batch deployments at the credential field names and os.environ refs the gateway actually resolves from process env (compose .env or EKS secret mounts). Missing secrets skip instead of failing red so a red run means a product bug. Mirror S3 bucket env aliases in docker-compose for provider_fallback
The batches suite is live e2e only; no monkeypatch or unit-level tests
Greptile SummaryThis PR wires batch provider credentials (Bedrock AWS/S3 fields, Vertex GCS bucket names) into the live e2e compose harness and adds a new budget reset regression suite targeting the #25109 nullable-JSON filter bug. All changes are confined to
Confidence Score: 5/5Safe to merge — all changes are e2e test infrastructure with no production code edits. Every changed file lives under tests/e2e/. The credential wiring, compose harness additions, retry hardening, and new budget regression tests are straightforward and well-scoped. No production paths are affected. The new test_budget_reset_advances_e2e.py has one assertion that may read a zero spend baseline due to async DB writes, which could make that specific guard vacuous in practice.
|
| Filename | Overview |
|---|---|
| tests/e2e/batches/COVERAGE.md | Documentation update: corrects credential field names for Vertex AI and Bedrock, notes Bedrock is unified-only. |
| tests/e2e/batches/capabilities.py | Adds _env_ref() helper; wires GCS and Bedrock AWS credential fields; narrows BEDROCK_SCENARIOS to unified-only. |
| tests/e2e/batches/test_batches_e2e.py | Passes provider to assert_file_object for Bedrock bytes=0 accommodation; fixes provider_fallback list assertion with documented early-return. |
| tests/e2e/budgets/budget_client.py | Adds _wait_for_team polling and add_team_member retry logic to absorb team propagation lag. |
| tests/e2e/budgets/test_budget_reset_advances_e2e.py | New regression test suite for #25109; multi-window assertion may be vacuous if spend_at_block reads 0.0 before DB flush. |
| tests/e2e/budgets/test_spend_counter_reseed_e2e.py | Adds _parse_counter for robust Redis value parsing; expands cluster namespace candidates; inlines burst logic with polling. |
| tests/e2e/budgets/test_tag_budget_e2e.py | Increases max_tokens, extends deadline, handles first-call block — minor robustness improvements. |
| tests/e2e/budgets/test_team_multi_window_budget_e2e.py | Pins model, increases loop iterations, tightens sleep — timing hardening. |
| tests/e2e/docker-compose.yml | Adds rescheduler short windows, files_settings for OpenAI/Azure, and full env passthrough for batch provider secrets. |
| tests/e2e/llm_translation/realtime/test_realtime_pipecat_audio_e2e.py | Adds NLTK punkt_tab skip guard but only catches LookupError; missing nltk package would cause a collection error. |
| tests/e2e/management/management_client.py | Mirrors budget_client hardening: _wait_for_team polling, add_team_member retry, update_key_models Redis back-off. |
| tests/e2e/models.py | Adds aws_access_key_id, aws_secret_access_key, and gcs_bucket_name fields to LiteLLMParamsBody. |
Reviews (2): Last reviewed commit: "fix(e2e): assert managed list fallback b..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Keep object-storage fields through CredentialLiteLLMParams and resolve
os.environ/ refs when reading deployment credentials so Vertex/Bedrock
batch file uploads see bucket and AWS keys from K8s/docker env
Skip managed batch list when the request is provider-scoped so
/{provider}/v1/batches list works instead of 500
Force DB on check_db_only team lookups and stop masking non-404 errors
as "team doesn't exist"
Drop e2e runner-side skip helpers; hard-fail on missing gateway secrets
Reseed spend:tag counters from LiteLLM_TagTable so cold redis still enforces after the spend writer flushes When applying post-call cost to team multi-window counters, load the team from the DB if it is missing from the management cache so window spend is not dropped on cache misses Harden cold-counter reseed e2e (namespace-aware keys, burst success, poll). Give tag budget more headroom. Retry /key/update on redis DNS blips. Ensure NLTK punkt_tab is present for pipecat realtime audio
Reverts all litellm/ and unit-test product edits. This branch is limited to tests/e2e per contributor instruction
provider_fallback list falls back when managed batches reject provider filtering. Team create waits for /team/info and member_add retries on transient team-not-found so split control-plane lag does not red the suite
b860556 to
7fe4752
Compare
Leave local .env and docker-compose env wiring as the secret source
OpenAI/Azure batch file uploads need files_settings; budget reset e2e needs a short rescheduler window. Drop unsupported bedrock-encoded create_batch cells, tolerate bedrock file.bytes=0, and surface team-info wait failures instead of hanging silently
de69d19 to
bf145d5
Compare
When provider-scoped list is rejected, still fetch the unfiltered list and check the envelope. Only skip membership when the id is a raw provider_fallback batch that managed list cannot index
|
Greptile 3/5 note on tip: the P1 about Tip does not ship An earlier draft of this branch had skip helpers; they were removed so a red result means missing real secrets or a product/routing bug, not a silent skip. P2 list-assertion gap for @greptileai please re-review against current tip. |
Relevant issues
Linear ticket
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
@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
Proxy image
litellm:e2e-staging-bf02a4a47f(staging tipbf02a4a47f) viatests/e2ecompose on localhost:4000 with real provider keys fromtests/e2e/.env(includingAWS_BATCH_ROLE_ARNandAWS_BATCH_S3_BUCKET=litellm-e2e-suite-batches)curl -s http://localhost:4000/health/liveliness # I'm alive!Batches suite after secrets + compose harness:
LITELLM_PROXY_URL=http://localhost:4000 LITELLM_MASTER_KEY=sk-1234 \ uv run pytest tests/e2e/batches/test_batches_e2e.py -v --tb=short -q # 16 passed in 96.20sFull core re-run (batches, budgets, management API, access_control, ocr, chat):
Type
Test
Bug Fix
Changes
E2e-only. No product
litellm/editsWires batch provider secrets into the live e2e suite for Docker compose: deployments register with
os.environ/NAMErefs and the credential field names the proxy keeps for files/batches (gcs_bucket_name/bucket_namefor Vertex;aws_*+s3_bucket_name+aws_batch_role_arnfor Bedrock). Compose mirrorsAWS_BATCH_S3_BUCKET/AWS_S3_BUCKET_NAME, declares OpenAI/Azurefiles_settings, short budget rescheduler windows, and Azure +GOOGLE_APPLICATION_CREDENTIALSpassthroughMissing secrets hard-fail (intentionally). There is no
provider_env.pyand norequire_provider_envskip path on tip. The suite does not convert missing-env into pytest.skip; a red run means the gateway or the runner is missing real secrets or the product misrouted. That matchestests/e2e/batches/COVERAGE.md("never skips"). Early drafts of this branch experimented with skips; those helpers were removedBatch matrix: Bedrock is unified-only (encoded
create_batchunsupported). When managed batches reject provider-scoped list, fall back to unfiltered list and assert the envelope; onlyprovider_fallbackmay omit membership when the raw provider id is not in the managed list index (documented in-test). Team create waits for/team/info; member_add retries transient team-not-foundAlso includes budget reset advances e2e (
test_budget_reset_advances_e2e.py) and related budget/management harness hardening undertests/e2eonly