litellm/tests/integration/pricing
yuneng-jiang fc27dfdc7d
test(integration): give each owned proxy a private database and Redis by default (#47213)
* test(integration): give each owned proxy a private database and Redis by default

owned_proxy and owned_proxy_process now boot on a scratch database and a
per-proxy redis-server unless the caller opts into the worker's state with
state=OwnedState.SHARED_WITH_WORKER, passes its own DATABASE_URL, or strips
DATABASE_URL. Under the replica profile the private database gets the
writer and reader roles so the reader path stays covered.

Gateway carries the database_url its proxy writes to, and the Scenario
cleanup checks and delete_key_if_present read from it, so they keep
checking something on a private database.

The 189 test files with owned proxy sites that depend on the worker's
database or Redis opt in with a shares_worker_state module marker, which a
module-scoped conftest fixture turns into the shared state. The 7 helper
modules with such sites opt in per call, since conftest fixtures and other
test files reach them.

* test(integration): reach session fixtures with the shared marker and keep the worker retry default

The module-scoped fixture that applied shares_worker_state ran after
session-scoped fixtures, so proxies those booted went private in marked
files. The marker is now applied around each marked item's setup, call
and teardown, which covers fixtures of every scope.

Owned proxies on the worker database inherited the worker gateway's
router_settings.num_retries of 0 from it. A private proxy now gets the same
default in its config copy unless the config sets num_retries itself.

Five providers files read the owned proxy's spend rows or response cache
through the worker's database or Redis and opt into sharing.
2026-10-18 03:37:41 +00:00
..
test_bundled_cost_map_price_wire.py refactor(types): replace Any with proven types in 157 files (#44798) 2026-10-06 15:31:54 +00:00
test_configured_prices.py test(integration): give each owned proxy a private database and Redis by default (#47213) 2026-10-18 03:37:41 +00:00
test_cost_margin_discount.py test(integration): cover budgets_spend endpoint contracts (#44736) 2026-10-14 06:58:22 +00:00
test_databricks_cache_pricing.py test(integration): regression tests for August cost tracking and budgeting bugs (#42622) 2026-09-23 04:13:03 +00:00
test_model_listing_token_limits.py test(integration): edge-case matrices for malformed token limits and callback_settings shapes (#42895) 2026-09-24 01:05:55 -07:00
test_ocr_page_pricing.py test(integration): regression tests for August cost tracking and budgeting bugs (#42622) 2026-09-23 04:13:03 +00:00
test_off_peak_pricing.py test(integration): cover off-peak pricing on a live proxy 2026-09-19 00:10:22 +00:00
test_per_second_pricing.py fix(cost): bill per-second transcription models outside chat modes (#44458) 2026-10-05 13:36:29 -07:00
test_price_data_reload_prices.py test(integration): give each owned proxy a private database and Redis by default (#47213) 2026-10-18 03:37:41 +00:00
test_price_precedence.py Format database and accounting integration tests 2026-09-14 21:24:20 -07:00
test_realtime_cached_audio_pricing.py fix(cost): apply a deployment's pricing override to realtime sessions (#43114) 2026-09-24 21:03:59 -07:00
test_service_tier_pricing.py fix(router): bill service tiers at catalog rates for custom-priced deployments (#43890) 2026-09-30 16:06:37 -07:00