mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-04 07:27:51 +00:00
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.
This commit is contained in:
parent
ffc7e6386b
commit
ab97cd53dc
1 changed files with 9 additions and 2 deletions
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue