litellm/tests/e2e/router
ryan-crabbe-berri d0e37d39c4 Record each e2e test's steps from the harness it calls
A test's JUnit report says whether it passed, never what it did or where a failing test died. This records that from the harness, so nothing about it is hand-written and it cannot drift from what the test actually ran

`@step("create team with a budget")` from the new tests/e2e/e2e_metadata.py goes on harness helpers, never on tests, and appends its label to the running test's step log in call order. The label is recorded before the wrapped call, so a helper that raises still leaves its own label last: a failing test's last step is where it died. Every public harness method that performs an action now carries one, 355 across the client modules, lifecycle, idp, the logging readers, migrations and the claude_code driver

Only the outermost step records, tracked per thread. Harness layers call each other (ResourceManager.key goes through ProxyClient.generate_key, a domain client wraps the shared ProxyClient), so every layer carries a label and the story still reads at the level the test called in at, one beat per action. A step above @contextmanager holds the guard through __enter__ and __exit__, so a context's cleanup never lands behind the step a test died on, and a bare generator function is refused at import because its body interleaves with its caller's. Consecutive duplicates collapse and the log caps at 50, so a poll loop is one beat rather than fifty. The wrapper is a frame, so the eight cleanup and retry warnings raised directly inside decorated helpers use stacklevel=2 + STEP_FRAMES to keep reporting at their caller

The log is emptied first thing in pytest_runtest_setup and attached from the existing pytest_runtest_makereport wrapper after setup and again after call, so a test that errors in a fixture keeps the steps recorded before the crash. Teardown does not attach: finalizer steps are cleanup. Each attach drops the item's earlier step entries, so the second attach and a --reruns 1 retry replace the story rather than doubling it

Steps ride out as repeated <property name="step"> entries behind the fixed package/covers/source prefix, which stays byte-identical. The project-releaser emitter already regroups them into the results JSON's steps array. test_junit_report.py runs real pytest with --junitxml against this conftest, in-process and under -n 2, and pins the passing, failing, setup-error, rerun and wide-scope-fixture cases on the parsed XML
2026-09-21 18:48:59 -07:00
..
complexity_router_client.py test(e2e): rename Gateway to ProxyClient and expose it as a session-scoped fixture (#33750) 2026-07-18 18:41:18 +00:00
conftest.py test(e2e): rewrite the Redis timeout test as a locust chaos load test 2026-09-10 21:55:23 -07:00
reliability_support.py Record each e2e test's steps from the harness it calls 2026-09-21 18:48:59 -07:00
test_auto_router_regressions_e2e.py fix(mcp): honor an explicit null on toolset update, cover MCP lifecycle e2e (#40022) 2026-09-08 22:50:13 -07:00
test_complexity_router_e2e.py test(e2e): add reliability suite covering fallback, timeout, and cache behavior (#34023) 2026-07-20 23:06:46 +00:00
test_reliability_cache_e2e.py test(e2e): verify cached answers and upstream request count 2026-09-11 12:10:19 -07:00
test_reliability_cancel_on_disconnect_e2e.py test(e2e): retry the hang-up when the model answers inside the window 2026-09-21 14:48:04 -07:00
test_reliability_cooldowns_e2e.py test(e2e): settle for the replica propagation window and trim the disconnect cell's prose 2026-09-21 13:30:25 -07:00
test_reliability_fallbacks_e2e.py test(e2e): cover the reliability retry, cooldown, fallback, and routing-strategy cells 2026-09-04 20:00:52 -07:00
test_reliability_memory_e2e.py test(e2e): keep the memory regression case in a class and drop the helper docstrings 2026-09-11 19:46:06 -07:00
test_reliability_prompt_caching_e2e.py test(e2e): gate the prompt-cache cell behind an opt-in marker and take ten shuffle picks 2026-09-05 02:10:06 -07:00
test_reliability_retries_e2e.py chore: merge litellm_internal_staging into litellm_e2e_reliability_module_cells 2026-09-12 13:05:02 -07:00
test_reliability_routing_strategies_e2e.py test(e2e): skip the override strategy cells and describe the 1s cooldown cache 2026-09-12 17:56:23 -07:00
test_reliability_timeouts_e2e.py test(e2e): add reliability suite covering fallback, timeout, and cache behavior (#34023) 2026-07-20 23:06:46 +00:00