Merge pull request #35875 from BerriAI/litellm_/inspiring-franklin-058a96

test(e2e): skip view-backed global spend probes pending LIT-5211
This commit is contained in:
yuneng-jiang 2026-08-04 19:14:48 -07:00 committed by GitHub
commit abcffa1e23
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -72,6 +72,24 @@ SPEND_ROUTES = (
_SPEND_PREFIXES = ("/spend", "/global/spend", "/global/activity")
_MISSING_VIEW_SKIP = pytest.mark.skip(
reason=(
"LIT-5211: on a fresh database the proxy's startup view creation can lose the race "
"against schema migrations, leaving MonthlyGlobalSpend/DailyTagSpend/Last30d* views "
"missing and these routes 500ing until the views exist"
)
)
_VIEW_BACKED_ROUTES = frozenset(
(
"/global/spend",
"/global/spend/keys",
"/global/spend/models",
"/global/spend/tags",
"/global/spend/logs",
)
)
def _date_range() -> DateRangeParams:
# Satisfies date-required endpoints (report/activity/provider); ignored elsewhere.
@ -80,7 +98,13 @@ def _date_range() -> DateRangeParams:
return DateRangeParams(start_date=start.isoformat(), end_date=end.isoformat())
@pytest.mark.parametrize("route", SPEND_ROUTES)
@pytest.mark.parametrize(
"route",
tuple(
pytest.param(route, marks=_MISSING_VIEW_SKIP) if route in _VIEW_BACKED_ROUTES else route
for route in SPEND_ROUTES
),
)
def test_spend_route_responsive(client: SpendClient, route: str) -> None:
result = client.probe(route, params=_date_range())
print(f"{route} -> {result.status_code}\n{result.body[:600]}")