litellm/tests/e2e/quota_management/spend_tracking
ryan-crabbe-berri ae05f7d2c1
test(e2e): typed per-test metadata for the e2e suite (#42044)
* feat(e2e): give e2e tests typed metadata for what they drive

@meta(Subject(domain, route, providers, models, capabilities, mode)) declares
what a test is about with closed enums, and each field lands in the JUnit report
as a property. The quota_management suites are the first to declare it.

* docs(e2e): say e2e_metadata avoids litellm, not that it is stdlib-only

It already imports pydantic and pytest, both of which the suite needs to collect. The rule that matters is no litellm import

* test(e2e): declare models through the constant each test drives

43 @meta declarations in quota_management typed the model name out again, so changing the call would leave the coverage report naming the old model. Each file now has one constant used by both, and a guard fails on any model written as a string literal in @meta

* refactor(e2e): set route only when the endpoint is what the test checks

A budget or rate-limit test whose chat call only triggers the block now leaves route unset, since its steps already name the call. Tests of an endpoint keep it: budget CRUD, key creation, spend reporting reads, and the per-endpoint spend tests for chat, messages, embeddings, batches and health. The two /spend/logs tests tagged chat_completions are now spend_reporting

* refactor(e2e): build the declared properties without mutating a list

subject_properties seeded a list and grew it with append and extend. It now flattens one tuple per field, and the plural-name table is a read-only mapping

* fix(e2e): tag each spend-route probe with the endpoint it checks

The breadth test gave all 33 probes spend_reporting, so /key/list, /user/list, /team/list, /organization/list and /customer/list counted as spend reporting. Each case now carries its own route, with organization and customer management added to Route
2026-09-30 21:03:21 -07:00
..
conftest.py test(e2e): every spend row a virtual key writes joins its token across all write paths 2026-09-09 14:34:12 -07:00
cost_rows.py test(e2e): pin prompt-cache, service-tier, and cost-header billing 2026-08-20 01:50:01 -07:00
spend_e2e_client.py test(e2e): pin end-user and tag attribution from Codex-style headers on /v1/responses (#43093) 2026-09-24 18:33:49 -07:00
spend_reconciliation.py test(e2e): typed per-test metadata for the e2e suite (#42044) 2026-09-30 21:03:21 -07:00
SPEND_TRACKING_COVERAGE_MATRIX.md test(e2e): pin end-user and tag attribution from Codex-style headers on /v1/responses (#43093) 2026-09-24 18:33:49 -07:00
test_cache_cost_accounting_e2e.py test(e2e): typed per-test metadata for the e2e suite (#42044) 2026-09-30 21:03:21 -07:00
test_cost_headers_e2e.py test(e2e): typed per-test metadata for the e2e suite (#42044) 2026-09-30 21:03:21 -07:00
test_key_attribution_e2e.py test(e2e): typed per-test metadata for the e2e suite (#42044) 2026-09-30 21:03:21 -07:00
test_provider_edge_spend_e2e.py test(e2e): typed per-test metadata for the e2e suite (#42044) 2026-09-30 21:03:21 -07:00
test_service_tier_pricing_e2e.py test(e2e): typed per-test metadata for the e2e suite (#42044) 2026-09-30 21:03:21 -07:00
test_spend_routes.py test(e2e): typed per-test metadata for the e2e suite (#42044) 2026-09-30 21:03:21 -07:00
test_spend_surface_consistency_e2e.py test(e2e): one request lands the same spend on every surface (#42540) 2026-09-22 13:42:00 -07:00
test_spend_tracking_e2e.py test(e2e): typed per-test metadata for the e2e suite (#42044) 2026-09-30 21:03:21 -07:00
test_team_daily_activity_e2e.py test(e2e): typed per-test metadata for the e2e suite (#42044) 2026-09-30 21:03:21 -07:00
test_websearch_interception_session_e2e.py fix(ci): stop stale CI reds, keep unit tests off the host env, retry CyberArk policy conflicts (#43294) 2026-09-26 09:25:13 -07:00