mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-16 23:41:43 +00:00
* chore(e2e): establish litellm_e2e_staging integration line Long-lived berri branch for e2e suite recovery work (LIT-4479 through LIT-4486) before merge to litellm_internal_staging * test(e2e): remove langfuse_otel logging e2e suite (#33558) * test(e2e): remove langfuse_otel logging e2e suite Removes the LIT-4483 dynamic per-team/key/org langfuse_otel logging e2e tests (tests/e2e/logging/test_langfuse_e2e.py, added in #32857). The shared logging_client harness and the langfuse coverage-registry cells are left in place; only the test module is removed. The otel and prometheus logging e2e suites are unaffected. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * test(e2e): drop orphaned langfuse coverage-registry cells The three logging.langfuse.*.logs_spend P0 cells were only exercised by the deleted langfuse_otel e2e suite. Remove them so the coverage registry has no orphaned rows. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --------- Co-authored-by: yucheng <yucheng@berri.ai> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(e2e): log into the react admin ui in the management browser fixture (#33562) The management ui_page fixture drove the old server-rendered login form: it clicked input[type="submit"] and treated wait_for_url("**/ui/**") as the done signal. /ui/ now serves the react (antd) dashboard whose submit is a <button type="submit">, so the click waited out the full 30s timeout and errored every browser test in the suite. wait_for_url also matched instantly because the login page already lives at /ui/, so on the fast path the fixture navigated before the auth cookie landed and got bounced back to login. Click the antd submit button and wait for the token cookie loginCall sets on document.cookie, the real post-login signal. Co-authored-by: Mubashir Osmani <mubashir@berri.ai> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(e2e): make ui login readiness robust to httpOnly token cookies (#33564) The login readiness check waited only on document.cookie including token=, which is empty when the token cookie is httpOnly. If the server ever sets it via a Set-Cookie header, the wait would spin to the 30s timeout and silently reproduce the original hang. Also accept the login form detaching (#username gone after the post-login redirect) so readiness holds regardless of how the cookie is delivered. Co-authored-by: Mubashir Osmani <mubashir@berri.ai> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --------- Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: yucheng <yucheng@berri.ai> Co-authored-by: Mubashir Osmani <mubashir@berri.ai>
59 lines
1.8 KiB
Python
59 lines
1.8 KiB
Python
"""Management suite fixtures: the client plus a logged-in dashboard page.
|
|
|
|
Lifecycle/skip/marker live in the parent conftest. The browser fixtures drive
|
|
the dashboard the proxy serves at /ui, so browser tests exercise exactly what an
|
|
end user sees. playwright is an optional dependency loaded behind importorskip
|
|
inside the fixture, so the API tests in this suite collect and run without it:
|
|
|
|
uv pip install playwright && uv run playwright install chromium
|
|
"""
|
|
|
|
from typing import TYPE_CHECKING, Iterator
|
|
|
|
import pytest
|
|
|
|
from e2e_config import PROXY_BASE_URL, UI_PASSWORD, UI_USERNAME
|
|
from management_client import ManagementClient, build_client
|
|
|
|
if TYPE_CHECKING:
|
|
from playwright.sync_api import Browser, Page
|
|
|
|
|
|
def pytest_configure(config: pytest.Config) -> None:
|
|
config.addinivalue_line(
|
|
"markers",
|
|
"covers: registry cell a test covers, e.g. mgmt.key.generate.persists",
|
|
)
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
def client() -> ManagementClient:
|
|
return build_client()
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
def browser() -> "Iterator[Browser]":
|
|
pytest.importorskip("playwright.sync_api", reason="playwright not installed")
|
|
from playwright.sync_api import sync_playwright
|
|
|
|
with sync_playwright() as playwright:
|
|
launched = playwright.chromium.launch()
|
|
yield launched
|
|
launched.close()
|
|
|
|
|
|
@pytest.fixture
|
|
def ui_page(browser: "Browser") -> "Iterator[Page]":
|
|
context = browser.new_context()
|
|
try:
|
|
page = context.new_page()
|
|
page.goto(f"{PROXY_BASE_URL}/ui/")
|
|
page.fill("#username", UI_USERNAME)
|
|
page.fill("#password", UI_PASSWORD)
|
|
page.click('button[type="submit"]')
|
|
page.wait_for_function(
|
|
"() => document.cookie.includes('token=') || !document.querySelector('#username')"
|
|
)
|
|
yield page
|
|
finally:
|
|
context.close()
|