From ab97cd53dcccc588073e9dac32f91ec23638e3fb Mon Sep 17 00:00:00 2001 From: Yuneng Jiang Date: Sat, 8 Aug 2026 23:00:42 -0700 Subject: [PATCH] test(e2e-ui): say why the team-model setup call failed The setup that creates a team-scoped model asserted a bare `ok()`, so a failure read "expected true, received false" and pointed at the UI. The call is enterprise-gated -- creating a model with model_info.team_id returns 403 without LITELLM_LICENSE -- and that is invisible from the old message. It now carries the status and body, which names the cause immediately. The api_base also pointed at the mock's default port rather than the one the harness started; nothing in the test calls the model, but the two should not disagree. --- tests/e2e/ui/tests/modelsPage/addModel.spec.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/e2e/ui/tests/modelsPage/addModel.spec.ts b/tests/e2e/ui/tests/modelsPage/addModel.spec.ts index 89753220782..274ade78fa1 100644 --- a/tests/e2e/ui/tests/modelsPage/addModel.spec.ts +++ b/tests/e2e/ui/tests/modelsPage/addModel.spec.ts @@ -58,7 +58,10 @@ test.describe("Add Model", () => { model_name: modelName, litellm_params: { model: "openai/fake-gpt-4", - api_base: "http://127.0.0.1:8090/v1", + // Nothing here ever calls the model, but point it at the mock the + // harness actually started -- the port moves when two checkouts run + // the stack side by side. + api_base: `http://127.0.0.1:${process.env.MOCK_LLM_PORT ?? "8090"}/v1`, api_key: "fake-key", tpm: 100, rpm: 200, @@ -68,7 +71,11 @@ test.describe("Add Model", () => { }, }, }); - expect(createResponse.ok()).toBe(true); + // Say why it failed. A bare toBe(true) here reports "expected true, received + // false" and sends you looking at the UI for a setup call that never landed. + expect(createResponse.ok(), `/model/new failed: ${createResponse.status()} ${await createResponse.text()}`).toBe( + true, + ); const createdModelId = (await createResponse.json()).model_info?.id; expect(createdModelId, "model id from /model/new").toBeTruthy();