Repository navigation
Vitest browser-mode UI integration tests (Pagination migration, marked) + CI - #35623
chirag-madlani wants to merge 11 commits into
Conversation
…lure vitest-browser-react unmounts in the next test's beforeEach, so the global afterEach reset handlers and the URL under a still-mounted page, which then refetched and got wrong-shaped responses (unhandled paging/permission errors). Also write lcov when a test fails so one flake can't drop Sonar coverage.
…nd stability runs Runs the browser suite with istanbul coverage and posts a Jest-style coverage and JUnit comment, plus five shuffled no-retry runs whose failures are summarized in a second comment. Drops the duplicate patch file.
UI browser tests: stability (5 shuffled runs, no retries)
No test failed in any run. |
…s on failure main now calls /metadata/types/workflows/approvalEnforcedEntityTypes and /changeRequests from entity pages, which the strict unmocked-API check caught. The workflow now records wall time and uploads screenshots even when tests fail.
# Conflicts: # openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/Pagination.spec.ts # openmetadata-ui/src/main/resources/ui/yarn.lock
main removed it with the antd Form/Select/Input migration (#35509); the app no longer mounts it.
# Conflicts: # openmetadata-ui/src/main/resources/ui/yarn.lock
The shuffled no-retry runs showed the suite stable; the workflow now runs the browser tests once, with coverage, on UI and core-component changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…owser The 35 Pagination E2E tests covered by browser tests keep running, tagged with their replacement, until the browser tests are validated and PaginationIT walks cursors for every listed entity type. Records the layering rule as a decision. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Skips the coverage comment on fork PRs and lets it fail without failing the job; formats three browser-test files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Code Review ✅ Approved 4 closed / 4 findings🟡 Medium risk · Migrating pagination coverage to MSW-backed browser tests while retaining only two Playwright smoke tests could leave real-server cursor regressions undetected. Vitest Browser Mode and MSW harness migrates pagination UI behaviour out of heavy Playwright specs, with a new browser-test CI workflow. Resolved: the stability run no longer loses wall time or counts when a test fails, and the E2E pagination specs are restored and tagged ✅ 4 closed✅ Bug: Stability run loses wall time and counts whenever a test fails
✅ Quality: E2E pagination deleted while real-server cursor paging stays untested
✅ Quality: Test-layering decision is not in docs/decisions/
✅ Bug: Comment step failure skips failure-screenshot upload; forks fail
VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
Describe your changes:
Draft, base of #36198. This adds UI integration tests in Vitest Browser Mode, with MSW mocking every
/apicall, to take over page-behaviour checks from heavy Playwright E2E specs. The layering rule is recorded inADR:2026-10-28-page-behaviour-is-tested-in-vitest-browser-mode-and-e2e-tests-leave-by-marking.What's here:
src/test/browser/(renderWithApp/renderApp, typed fixtures,paginationContract.ts). Any unmocked/api/*call fails the test, so no test can pass against a request that failed silently.playwright/e2e/Features/Pagination.spec.tsare now covered by 22*.browser.test.tsxfiles (70 tests + 4test.failsthat pin real bugs). The Playwright tests are not deleted. Each one is tagged@migrated-browserwith its replacement (playwright/constant/migration.ts) and keeps running until the browser tests are validated andPaginationITcovers every list endpoint. The mapping is insrc/test/browser/PAGINATION_MIGRATION.md.setup.tsnow unmounts before resetting MSW handlers.vitest-browser-reactonly unmounts in the next test'sbeforeEach, so a still-mounted page refetched against reset handlers and threw unhandled errors under load.reportOnFailure: true, plus ajson-summaryreporter. The browserlcovis added tosonar.typescript.lcov.reportPathsnext to Jest's..github/workflows/ui-browser-tests.yml(new file; no existing workflow is changed):browser tests + coverageposts a Jest-style coverage + JUnit comment viaMishaKav/jest-coverage-comment(same-repo PRs only) and uploads screenshots on failure;Type of change:
High-level design:
src/test/browser/README.md.Pagination.spec.tscosts 274–495 s of CI worker time, plus the shared stack, build and fixture pipeline. Locally, on a heavily loaded M1 Pro (load 35–60 on 8 cores), the browser suite runs in ~2m14s without coverage, with no backend at all. This PR measures it on a CI runner.PaginationITis called only for tables. It should cover every list endpoint, so the server side of what moved here stays tested against a real DB.Tests:
Use cases covered
Pagination across 22 list pages: Next/Previous with cursors and URL sync, deep links, reload, page-size change, search resetting to page 1, empty states, the deleted toggle, the Files ↔ Spreadsheets tab reset, client-side paging, and a visual snapshot of the schema table.
Unit tests
N/A: the change is test infrastructure. Jest is unaffected (
*.browser.test.tsxis excluded from Jest).Backend integration tests
Ingestion integration tests
Playwright (UI) tests
Pagination.spec.ts: 35 tests are tagged@migrated-browser, and the 2 real-server smoke tests are untagged.Manual testing performed
On macOS (M1 Pro):
yarn test:ui:run --maxWorkers=3: 70 passed + 4 expected fail.yarn test:ui:coverage --maxWorkers=3:lcov.infoandcoverage-summary.jsonwritten even when a test fails.testTimeouts, a different test each run.UI screen recording:
Not applicable: test and CI infrastructure only, no product UI change (one
ObservabilityAlertsTablerow-header a11y fix).Checklist:
Fixes <issue-number>: <short explanation>: draft POC, no issue yet.Fixes #<issue-number>above: draft POC.🤖 Generated with Claude Code