Skip to content

test(e2e): cover Team-BYOK add-model flow as proxy admin#29068

Merged
ryan-crabbe-berri merged 3 commits into
litellm_internal_stagingfrom
litellm_e2e_team_byok_model
May 27, 2026
Merged

test(e2e): cover Team-BYOK add-model flow as proxy admin#29068
ryan-crabbe-berri merged 3 commits into
litellm_internal_stagingfrom
litellm_e2e_team_byok_model

Conversation

@ryan-crabbe-berri

@ryan-crabbe-berri ryan-crabbe-berri commented May 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds an e2e test for the previously-uncovered manual-QA item "Add team-only model → assign to team". The test toggles the Team-BYOK switch on the Add Model form, picks the seeded E2E Team CRUD, submits, then verifies the model appears in All Models with the team alias attached. Skips when LITELLM_LICENSE is unset, since the toggle is premium-gated.

Test plan

  • e2e_tests/tests/modelsPage/addModel.spec.ts::Add team-only model via Team-BYOK toggle and verify it appears with the team
  • Test self-skips on unlicensed proxies (matches the pattern in license.spec.ts)

Refs LIT-3093

The team-only model + team assignment was an uncovered manual-QA path.
This adds a premium-gated test that toggles Team-BYOK, picks the seeded
E2E Team CRUD, submits, and verifies the model lands in All Models with
the team alias attached.
@greptile-apps

greptile-apps Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds a Playwright e2e test covering the Team-BYOK add-model flow for proxy admins: toggles the premium-gated switch, assigns the model to the seeded E2E Team CRUD, and verifies the team alias appears in the All Models table. The test self-skips when LITELLM_LICENSE is unset.

  • Idempotency: a deleteTeamScopedCohereModels helper filters by model_name.startsWith("cohere") && team_id === E2E_TEAM_CRUD_ID and runs both before the test body and in a finally block, preventing state leakage across retries.
  • Previous review items addressed: the 2-second post-networkidle settle and the models-results-count guard (both flagged in earlier rounds) are now present.

Confidence Score: 5/5

Safe to merge — the change is a single additive e2e test with no modifications to production code or existing tests.

The new test follows the established patterns in this file, correctly guards against the premium license gate, cleans up after itself, and uses the same search/results-count/row-filter assertions as the sibling tests. There are no modifications to existing test logic and no production code is touched.

No files require special attention.

Important Files Changed

Filename Overview
ui/litellm-dashboard/e2e_tests/tests/modelsPage/addModel.spec.ts New e2e test for Team-BYOK add-model flow; well-structured with proper cleanup, license guard, and assertions. Minor comment inaccuracy and team selection inconsistency noted.

Reviews (2): Last reviewed commit: "test(e2e): harden Team-BYOK test against..." | Re-trigger Greptile

Comment thread ui/litellm-dashboard/e2e_tests/tests/modelsPage/addModel.spec.ts Outdated
Comment thread ui/litellm-dashboard/e2e_tests/tests/modelsPage/addModel.spec.ts Outdated
@codecov

codecov Bot commented May 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

- Add the 2s networkidle settle that the sibling addModel tests use —
  networkidle fires before the All Models table finishes re-rendering,
  so the search input was racing with the render.
- Assert on `models-results-count` before inspecting the table body so
  an empty search result fails with a clear "expected results count"
  message instead of timing out on a missing row.

Addresses Greptile P2s on PR #29068.
- Add before/after cleanup that deletes any Cohere model already scoped
  to e2e-team-crud via /v2/model/info + /model/delete, so Playwright
  retries and local reruns don't accumulate rows.
- Pick the team from the dropdown by role/option name instead of a
  global getByText match — avoids matching a previously-rendered tag
  elsewhere in the form.
- Scope the "created successfully" assertion to .ant-notification so a
  stale toast from an earlier test in the same browser context can't
  vacuously satisfy it.
- Tighten the All Models assertion: require a single row that contains
  BOTH the cohere model name AND the e2e-team-crud alias, so the
  team-less wildcard from the sibling "Add wildcard route" test can't
  satisfy the check.
@ryan-crabbe-berri

Copy link
Copy Markdown
Collaborator Author

@greptileai re review

@ryan-crabbe-berri ryan-crabbe-berri merged commit 9cac047 into litellm_internal_staging May 27, 2026
115 of 118 checks passed
fzowl pushed a commit to fzowl/litellm that referenced this pull request Jun 24, 2026
* test(e2e): cover Team-BYOK add-model flow as proxy admin

The team-only model + team assignment was an uncovered manual-QA path.
This adds a premium-gated test that toggles Team-BYOK, picks the seeded
E2E Team CRUD, submits, and verifies the model lands in All Models with
the team alias attached.

* test(e2e): apply greptile fixes to Team-BYOK test

- Add the 2s networkidle settle that the sibling addModel tests use —
  networkidle fires before the All Models table finishes re-rendering,
  so the search input was racing with the render.
- Assert on `models-results-count` before inspecting the table body so
  an empty search result fails with a clear "expected results count"
  message instead of timing out on a missing row.

Addresses Greptile P2s on PR BerriAI#29068.

* test(e2e): harden Team-BYOK test against flake and stale state

- Add before/after cleanup that deletes any Cohere model already scoped
  to e2e-team-crud via /v2/model/info + /model/delete, so Playwright
  retries and local reruns don't accumulate rows.
- Pick the team from the dropdown by role/option name instead of a
  global getByText match — avoids matching a previously-rendered tag
  elsewhere in the form.
- Scope the "created successfully" assertion to .ant-notification so a
  stale toast from an earlier test in the same browser context can't
  vacuously satisfy it.
- Tighten the All Models assertion: require a single row that contains
  BOTH the cohere model name AND the e2e-team-crud alias, so the
  team-less wildcard from the sibling "Add wildcard route" test can't
  satisfy the check.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants