-
-
Notifications
You must be signed in to change notification settings - Fork 11.9k
test: e2e staging leftovers #33613
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mubashir1osmani
merged 11 commits into
litellm_internal_staging
from
litellm_e2e_staging
Jul 17, 2026
Merged
test: e2e staging leftovers #33613
Changes from 7 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
ab6d757
test(e2e): read datadog log delivery back from the real datadog api (…
yucheng-berri d11273b
fix(e2e): point UI tests at dashboard service; register complexity ro…
mubashir1osmani 710ad97
docs(e2e): clarify E2E_UI_BASE_URL should be ALB when ingress splits UI
mubashir1osmani f038716
docs(e2e): prefer single path-routing host for control plane and UI
mubashir1osmani 1c6a31d
fix(e2e): always capture complexity router model_id for teardown
mubashir1osmani 0c9493e
fix(e2e): click exact Login button so SSO control is not matched
mubashir1osmani 0880412
fix(router): score complexity by difficulty not request length
mubashir1osmani 32427a6
fix(e2e): open key edit via Key ID and wait for team models
mubashir1osmani 0ca82e2
fix(e2e): keep settled DD events on empty search; bump mcp for OSV
mubashir1osmani c18816c
revert: drop mcp lock bump from e2e staging PR
mubashir1osmani ad57c5d
test(e2e): mark batches suite with coverage registry cells
mubashir1osmani File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,140 @@ | ||
| """Read-back for the DataDog logging tests against the real DataDog Logs | ||
| Search API. | ||
|
|
||
| Delivery is judged on what DataDog itself ingested: the proxy ships logs with | ||
| DD_API_KEY exactly as in production (no base-URL override, no local sink), and | ||
| the tests search the ingested events back with POST /api/v2/logs/events/search, | ||
| authenticated with the same DD_API_KEY plus a DD_APP_KEY application key. On | ||
| the cluster the secret manager injects both keys; locally tests/e2e/.env | ||
| provides them. Missing keys or a failed search call are hard failures, never an | ||
| empty result. External reads go through ``e2e_http``. | ||
| """ | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import time | ||
| from dataclasses import dataclass | ||
|
|
||
| import pytest | ||
| from pydantic import BaseModel, ConfigDict, Field | ||
|
|
||
| from e2e_config import ( | ||
| DD_API_KEY, | ||
| DD_APP_KEY, | ||
| DD_SETTLE_SECONDS, | ||
| DD_SITE, | ||
| POLL_INTERVAL, | ||
| POLL_TIMEOUT, | ||
| ) | ||
| from e2e_http import URL, Headers, Success, post | ||
|
|
||
|
|
||
| class _DdAuthHeaders(Headers): | ||
| api_key: str = Field(serialization_alias="DD-API-KEY") | ||
| app_key: str = Field(serialization_alias="DD-APPLICATION-KEY") | ||
|
|
||
|
|
||
| class _SearchFilter(BaseModel): | ||
| query: str | ||
| #: Wide enough to cover a full suite run plus DataDog's ingestion lag; | ||
| #: markers are unique per test, so a wide window cannot match foreign events. | ||
| from_: str = Field(default="now-30m", serialization_alias="from") | ||
| to: str = "now" | ||
|
|
||
|
|
||
| class _SearchPage(BaseModel): | ||
| limit: int = 100 | ||
|
|
||
|
|
||
| class _SearchRequest(BaseModel): | ||
| filter: _SearchFilter | ||
| page: _SearchPage = _SearchPage() | ||
| sort: str = "timestamp" | ||
|
|
||
|
|
||
| class DdLogEvent(BaseModel): | ||
| """One ingested log event as the search API returns it: the indexed | ||
| envelope (service/status/tags) plus ``attributes`` - DataDog's parse of the | ||
| JSON message the integration shipped, i.e. the StandardLoggingPayload | ||
| fields.""" | ||
|
|
||
| model_config = ConfigDict(extra="ignore") | ||
|
|
||
| service: str | None = None | ||
| status: str | None = None | ||
| tags: list[str] = [] | ||
| attributes: dict[str, object] = {} | ||
|
|
||
|
|
||
| class _SearchEvent(BaseModel): | ||
| model_config = ConfigDict(extra="ignore") | ||
|
|
||
| attributes: DdLogEvent | ||
|
|
||
|
|
||
| class _SearchResponse(BaseModel): | ||
| model_config = ConfigDict(extra="ignore") | ||
|
|
||
| data: list[_SearchEvent] = [] | ||
|
|
||
|
|
||
| @dataclass(frozen=True, slots=True) | ||
| class DdLogsReader: | ||
| site: str | ||
| api_key: str | ||
| app_key: str | ||
|
|
||
| def events_for_marker(self, marker: str) -> list[DdLogEvent]: | ||
| """Every ingested event matching the marker (full-text, exact phrase). | ||
| More than one hit for one call IS the duplicate-delivery bug, so this | ||
| never collapses to a single event.""" | ||
| result = post( | ||
| URL(f"https://api.{self.site}/api/v2/logs/events/search"), | ||
| headers=_DdAuthHeaders(api_key=self.api_key, app_key=self.app_key), | ||
| json=_SearchRequest(filter=_SearchFilter(query=f'"{marker}"')), | ||
| response_type=_SearchResponse, | ||
| timeout=30.0, | ||
| ) | ||
| match result: | ||
| case Success(data=page): | ||
| return [event.attributes for event in page.data] | ||
| case failure: | ||
| pytest.fail(f"DataDog Logs Search API at api.{self.site} failed: {failure}") | ||
|
|
||
| def poll_events_for_marker(self, marker: str) -> list[DdLogEvent]: | ||
| """Poll until at least one matching event is searchable (the callback | ||
| flushes in periodic batches and DataDog ingestion adds seconds of lag), | ||
| then keep re-reading for DD_SETTLE_SECONDS so a late duplicate cannot | ||
| hide from the exactly-one assertion - real-DataDog jitter can surface | ||
| one call's two events tens of seconds apart. At the deadline the last | ||
| result is returned as-is.""" | ||
| deadline = time.monotonic() + POLL_TIMEOUT | ||
| while time.monotonic() < deadline: | ||
| events = self.events_for_marker(marker) | ||
| if events: | ||
| return self._settled_events_for_marker(marker, events) | ||
| time.sleep(POLL_INTERVAL) | ||
| return self.events_for_marker(marker) | ||
|
|
||
| def _settled_events_for_marker( | ||
| self, marker: str, events: list[DdLogEvent] | ||
| ) -> list[DdLogEvent]: | ||
| """Re-read at every poll interval until the settle window closes; a | ||
| duplicate ends the watch early because more waiting cannot clear it.""" | ||
| settle_deadline = time.monotonic() + DD_SETTLE_SECONDS | ||
| while time.monotonic() < settle_deadline: | ||
| time.sleep(POLL_INTERVAL) | ||
| events = self.events_for_marker(marker) | ||
| if len(events) > 1: | ||
| return events | ||
| return events | ||
|
greptile-apps[bot] marked this conversation as resolved.
Outdated
|
||
|
|
||
|
|
||
| def build_dd_logs_reader() -> DdLogsReader: | ||
| if not DD_API_KEY or not DD_APP_KEY: | ||
| pytest.fail( | ||
| "DD_API_KEY and DD_APP_KEY must be set: the DataDog tests deliver to and " | ||
| "read back from the real DataDog API (on the cluster the secret manager " | ||
| "injects them; locally set them in tests/e2e/.env)" | ||
| ) | ||
| return DdLogsReader(site=DD_SITE, api_key=DD_API_KEY, app_key=DD_APP_KEY) | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.