mirror of
https://github.com/BerriAI/litellm.git
synced 2026-08-28 05:25:59 +00:00
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:
commit
abcffa1e23
1 changed files with 25 additions and 1 deletions
|
|
@ -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]}")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue