mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-18 09:45:23 +00:00
style(e2e): format logs call id helper and spec
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
8e422da162
commit
b599c7165e
2 changed files with 11 additions and 4 deletions
|
|
@ -139,7 +139,7 @@ export async function waitForSpendLog(
|
|||
lastStatus = res.status();
|
||||
if (res.ok()) {
|
||||
const body = await res.json();
|
||||
const rows = Array.isArray(body) ? body : (body?.data ?? []);
|
||||
const rows = Array.isArray(body) ? body : body?.data ?? [];
|
||||
if (rows.length > 0) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,7 +102,9 @@ test.describe("Logs page", () => {
|
|||
model: CHAT_MODEL_A,
|
||||
prompt,
|
||||
});
|
||||
expect(callId, "call id must differ from the provider response id for this check to mean anything").not.toBe(requestId);
|
||||
expect(callId, "call id must differ from the provider response id for this check to mean anything").not.toBe(
|
||||
requestId,
|
||||
);
|
||||
await waitForSpendLog(request, requestId);
|
||||
|
||||
await navigateToPage(page, Page.Logs);
|
||||
|
|
@ -113,12 +115,17 @@ test.describe("Logs page", () => {
|
|||
|
||||
const row = requestLogsRows(page).filter({ hasText: requestId });
|
||||
await expect(row, `no logs row for call id ${callId}`).toHaveCount(1, { timeout: 30_000 });
|
||||
await expect(row, `Logs row for ${requestId} does not display its x-litellm-call-id ${callId}`).toContainText(callId);
|
||||
await expect(row, `Logs row for ${requestId} does not display its x-litellm-call-id ${callId}`).toContainText(
|
||||
callId,
|
||||
);
|
||||
|
||||
await row.click();
|
||||
const drawer = page.getByRole("dialog").first();
|
||||
await expect(drawer.getByText("Request & Response")).toBeVisible({ timeout: 20_000 });
|
||||
await expect(drawer.getByText(callId, { exact: false }).first(), `drawer does not show x-litellm-call-id ${callId}`).toBeVisible({ timeout: 10_000 });
|
||||
await expect(
|
||||
drawer.getByText(callId, { exact: false }).first(),
|
||||
`drawer does not show x-litellm-call-id ${callId}`,
|
||||
).toBeVisible({ timeout: 10_000 });
|
||||
});
|
||||
|
||||
// Split out because only the copy path needs a secure context; folding it in would
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue