test(e2e): cover AI Hub make-public flow and public model_hub_table#29071
Conversation
Three previously-uncovered manual-QA paths land in one spec: - Admin opens "Select Models to Make Public", advances through the multi-step modal, and verifies the success toast. - AI Hub tab strip exposes Model Hub / Agent Hub / MCP Hub / Skill Hub — note the manual-QA "Claude Code Plugin Marketplace" label was renamed to Skill Hub; the test pins the current name. - Anonymous /ui/model_hub_table loads with the master key as `?key=` and renders the Model Hub tab. Agent Hub / MCP Hub tabs are conditional on public data and are not asserted here.
Greptile SummaryAdds a new
Confidence Score: 5/5This PR is safe to merge — it adds only new test code with no production code changes. The change is entirely additive (one new test file), the tests are well-structured with thoughtful inline comments, and no existing behavior is modified or weakened. The two noted issues are both non-blocking quality suggestions that don't affect the test's ability to pass on a fresh CI seed. No files require special attention; the single changed file is a new test spec with no risk to production code.
|
| Filename | Overview |
|---|---|
| ui/litellm-dashboard/e2e_tests/tests/modelHub/modelHub.spec.ts | New e2e spec covering make-public modal flow, admin AI Hub tab strip, and public model_hub_table; well-commented and guards against missing seed data, but the "make public" test has no teardown so the suite is not idempotent across re-runs against the same DB. |
Reviews (3): Last reviewed commit: "docs(e2e): explain admin vs public AI Hu..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Address Greptile review: - Make-public test now asserts "Select All (N)" with N>=1 before clicking, so a missing-seed-data run surfaces immediately instead of timing out on the disabled Next button or the success toast. - Public model_hub_table test dismisses the feedback popup before the tab visibility assertion, matching the ordering used by navigateToPage so a popup race can't mask the tab mid-evaluation.
|
@greptileai re review |
| for (const tabName of ["Model Hub", "Agent Hub", "MCP Hub", "Skill Hub"]) { | ||
| const tab = page.getByRole("tab", { name: tabName }); | ||
| await expect(tab, `${tabName} tab should be present`).toBeVisible({ timeout: 5_000 }); | ||
| await tab.click(); | ||
| } |
There was a problem hiding this comment.
Agent Hub / MCP Hub tabs may not render in a data-empty admin view
The loop unconditionally asserts all four tabs, including Agent Hub and MCP Hub. The fixture config seeds only two model groups (fake-openai-gpt-4, fake-anthropic-claude) and no agents or MCP servers. If these tabs are conditionally rendered in the admin view (i.e., they only appear when at least one agent or MCP server exists — the same conditionality the PR notes for the public page), the test will time out on Agent Hub in every clean CI run. The PR description explicitly carves out this conditional behaviour for the public view but does not confirm the admin view renders them unconditionally; if the UI component behaves the same in both contexts, this test will be a persistent flake.
There was a problem hiding this comment.
model hub table will render all 4 unconditionally for admin path
Greptile flagged the all-4-tabs assertion as a potential CI flake, inferring from the public-page comment that Agent Hub / MCP Hub might be data-conditional in the admin view too. They aren't — ModelHubTable renders all four tabs unconditionally for admins. Document the asymmetry inline so future readers (and future review passes) don't re-derive it.
|
@greptileai re review |
5699a06
into
litellm_internal_staging
…erriAI#29071) * test(e2e): cover AI Hub make-public flow and public model_hub_table Three previously-uncovered manual-QA paths land in one spec: - Admin opens "Select Models to Make Public", advances through the multi-step modal, and verifies the success toast. - AI Hub tab strip exposes Model Hub / Agent Hub / MCP Hub / Skill Hub — note the manual-QA "Claude Code Plugin Marketplace" label was renamed to Skill Hub; the test pins the current name. - Anonymous /ui/model_hub_table loads with the master key as `?key=` and renders the Model Hub tab. Agent Hub / MCP Hub tabs are conditional on public data and are not asserted here. * test(e2e): harden AI Hub make-public + public hub assertions Address Greptile review: - Make-public test now asserts "Select All (N)" with N>=1 before clicking, so a missing-seed-data run surfaces immediately instead of timing out on the disabled Next button or the success toast. - Public model_hub_table test dismisses the feedback popup before the tab visibility assertion, matching the ordering used by navigateToPage so a popup race can't mask the tab mid-evaluation. * docs(e2e): explain admin vs public AI Hub tab asymmetry Greptile flagged the all-4-tabs assertion as a potential CI flake, inferring from the public-page comment that Agent Hub / MCP Hub might be data-conditional in the admin view too. They aren't — ModelHubTable renders all four tabs unconditionally for admins. Document the asymmetry inline so future readers (and future review passes) don't re-derive it.
Summary
Adds e2e coverage for three previously-uncovered manual-QA items in the AI Hub / public Model Hub area:
?key=<master>and asserts the Model Hub tab. Agent Hub / MCP Hub tabs only render when public agents/MCPs exist, so they're not asserted in a fresh CI run.Test plan
e2e_tests/tests/modelHub/modelHub.spec.ts::Make models public via the multi-step modale2e_tests/tests/modelHub/modelHub.spec.ts::AI Hub tab list renders Model Hub, Agent Hub, MCP Hub and Skill Hube2e_tests/tests/modelHub/modelHub.spec.ts::Public model_hub_table loads and renders the Model Hub tabRefs LIT-3093