Chore(UI): Fix the ExploreTree spec failure - #30881
Conversation
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
Code Review ✅ ApprovedRefactors Playwright test data management for dashboard entities and adds programmatic creation and cleanup hooks in ExploreTree.spec.ts to fix test failures. No issues found. OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar | Powered by Gitar — free for open source |
There was a problem hiding this comment.
Pull request overview
This PR aims to fix the ExploreTree Playwright spec failure by improving E2E test data isolation/cleanup and making service naming deterministic so created services reliably appear in the Explore Tree’s capped, alphabetically-sorted service bucket.
Changes:
- Refactors
DashboardClassconstructor to accept a partial dashboard service configuration and fixes dashboard entity name assignment. - Updates
ExploreTree.spec.tsto create unique test entities inbeforeAlland delete them inafterAll, using digit-prefixed service names to ensure deterministic ordering/visibility in Explore Tree buckets. - Updates
CustomPropertiesApiContract.spec.tsto use the newDashboardClassconstructor signature.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| openmetadata-ui/src/main/resources/ui/playwright/support/entity/DashboardClass.ts | Adds DashboardServiceConfig, adjusts constructor signature, and fixes dashboard entity name initialization. |
| openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/ExploreTree.spec.ts | Creates/deletes isolated test entities via hooks and uses digit-prefixed service names to avoid Explore Tree bucket truncation issues. |
| openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/CustomPropertiesApiContract.spec.ts | Updates dashboard entity creation to pass service config object to DashboardClass. |
| this.serviceType = ServiceTypes.DASHBOARD_SERVICES; | ||
|
|
||
| const serviceName = name ?? `pw-dashboard-service-${uuid()}`; | ||
| const serviceName = service?.name ?? `pw-dashboard-service-${uuid()}`; |
✅ Playwright Results — workflow succeededValidated commit ✅ 582 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 3 skipped · 🧰 0 lifecycle flaky PerformanceBlocking targets: ✅ met · Optimization targets: 🟡 in progress Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting. 🕒 Full workflow signal wall (to summary) 55m 35s ⏱️ Max setup 3m 13s · max shard execution 17m 9s · max shard-job elapsed before upload 20m 23s · reporting 6s 🌐 201.02 requests/attempt · 2.80 app boots/UI scenario · 21.87% common-shard skew Optimization targets still in progress:
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
This pull request refactors and improves the way test data is created and managed for Playwright E2E tests, particularly for dashboard entities and related services. The changes make entity creation more flexible, ensure proper cleanup after tests, and improve test isolation and reliability.
Test Data Creation and Cleanup Improvements
DashboardClassconstructor to accept a partialDashboardServiceConfig, allowing more flexible and explicit service configuration for test dashboards. [1] [2]ExploreTree.spec.tsand related tests to use the newDashboardClassconstructor signature, passing service configuration as an object instead of just a name. [1] [2]beforeAllandafterAllhooks inExploreTree.spec.tsto programmatically create and delete test entities (TableClass,DashboardClass,ApiEndpointClass,SearchIndexClass), ensuring tests have isolated and unique data and that resources are cleaned up after test execution. [1] [2]Codebase Consistency and Minor Improvements
ExploreTree.spec.tsto use the new entity class structure, ensuring consistency and clarity in test setup.DashboardClassto correctly use the provided name or fallback to a generated one.