Repository navigation
test(playwright): fix Context Center, Table and ProfileTeam specs broken by memory-status, page-size and leave-team changes - #37338
Conversation
…er memory-status, page-size and leave-team changes - createMemoryViaApi and the Permission owner fixture pin entityStatus Approved: #36989 made Collate (reviewRequired) start memories Unprocessed and hid pending memories from non-owners, so readers never saw the fixtures. - Table tag-search test uses dim_customer.average_order_size: with 15-row column pages sorted by name (#35288), shop_id moved to page 2. - ProfileTeam leave waits for PATCH /users/<me>: leaving now updates the user's teams instead of DELETE /teams/<id>/users/<id>.
❌ 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 |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
harsh-vador
left a comment
There was a problem hiding this comment.
Thanks for picking these up. Left a few comments, mostly about stopping these from breaking again the same way. The createMemoryViaApi one is the main one for me, the rest are smaller.
| // OSS defaults a new memory to Approved, Collate to Unprocessed (hidden from | ||
| // non-owners). Pin Approved so fixtures behave the same on both distributions. | ||
| const res = await apiContext.post(MEMORIES_API, { | ||
| data: { entityStatus: 'Approved', ...overrides }, |
There was a problem hiding this comment.
Defaulting to Approved makes sense for Collate, but it turns the two expect(memory.entityStatus).toBe('Approved') checks in ContextCenterDashboard.spec.ts (L178 and L467) into echo checks. As far as I can tell they were added to make sure OSS starts a new memory as Approved, and now we send Approved ourselves, so they'd still pass if that default broke. Could we keep one create in the dashboard spec that doesn't send a status? Or drop those asserts if the OSS default is covered somewhere else.
Smaller thing: with the spread, an explicit entityStatus: undefined in overrides wins over the default and then gets dropped from the JSON, so Collate falls back to Unprocessed. createMemory in ContextCenterMemoryLifecycle.spec.ts forwards an optional entityStatus like that. Every call there passes a value today, so nothing's broken, but entityStatus: overrides.entityStatus ?? 'Approved' would close that gap.
There was a problem hiding this comment.
Done in df06844.
- Dropped both
expect(memory.entityStatus).toBe('Approved')checks in the dashboard spec. A create without a status cannot assert one value on both distributions (it isUnprocessedon Collate, which is how these broke). The OSS default is already guarded byContextMemoryCreateGrantIT(andContextMemoryRepositoryTest), per ADR 2026-11-05. - The helper now uses
entityStatus: overrides.entityStatus ?? 'Approved', so an explicitundefinedno longer drops the default.
| question: 'Owned by admin for permission matrix tests', | ||
| answer: 'Owned by admin for permission matrix tests', | ||
| // Collate starts memories Unprocessed, which hides them from non-owners. | ||
| entityStatus: 'Approved', |
There was a problem hiding this comment.
Any reason not to use createMemoryViaApi here? You'd get the Approved default for free, and it also asserts the 201. Right now, if this POST fails, ownerMemoryId silently becomes undefined and the permission tests fail much later with a "row not found" that's hard to trace back. Same goes for the other raw POSTs below (editAll, deleteAll, allPermission, etc.), though those don't need to be in this PR.
There was a problem hiding this comment.
Done in df06844: the owner fixture now uses createMemoryViaApi, so it gets the Approved default and the 201 assert. I left the other raw POSTs as they are, as you suggested. Those memories are owned by the user who reads them, so the pending state does not hide them.
| // Check if add button exists and is visible | ||
| const rowSelector = | ||
| '[data-row-key="sample_data.ecommerce_db.shopify.dim_customer.shop_id"] [data-testid*="classification-tags"]'; | ||
| '[data-row-key="sample_data.ecommerce_db.shopify.dim_customer.average_order_size"] [data-testid*="classification-tags"]'; |
There was a problem hiding this comment.
This works, but I think it's the same trap as before: average_order_size happens to be on the first page right now. If the page size or sort changes again, or a column gets added ahead of it, we're back here. The test already searches for the column further down (L611). Could we do that search first and then open the tag picker? Then pagination doesn't matter.
nit: the column name is now hardcoded in three places (here, L614 and L627). A const columnFqn at the top would have made this a one-line change.
There was a problem hiding this comment.
Done in df06844. The test now searches the column before it opens the tag picker, so page size and sort no longer matter. That let me go back to the original shop_id, with columnName / columnFqn declared once. One catch: the search is kept in the URL (columnSearch), so after reload() refilling the same value would fire no request. The test now waits for the search request the reload makes instead.
| page, | ||
| page.locator( | ||
| `[data-row-key="sample_data.ecommerce_db.shopify.dim_customer.shop_id"] [data-testid="classification-tags-0"] [data-testid="edit-button"]` | ||
| `[data-row-key="sample_data.ecommerce_db.shopify.dim_customer.average_order_size"] [data-testid="classification-tags-0"] [data-testid="edit-button"]` |
There was a problem hiding this comment.
Not new in this PR, but worth noting since we're picking a fresh column: if the test fails after the tag is added and before it's removed, the tag stays on the shared dim_customer column, and the classification from beforeAll never gets cleaned up. An afterAll / try...finally would keep failed runs from piling tags onto it.
There was a problem hiding this comment.
Added in df06844: an afterAll hard-deletes the glossary and the classification with recursive=true, which also removes their labels from the shared dim_customer columns when a test fails mid-way. It covers the glossary test in the same describe too.
| .url() | ||
| .includes(`/api/v1/teams/${team.responseData.id}/users/`) && | ||
| response.request().method() === 'DELETE' | ||
| response.url().includes('/api/v1/users/') && |
There was a problem hiding this comment.
This matches any PATCH under /api/v1/users/, which is a lot looser than the old team-scoped DELETE wait. Anything else that patches a user around the click (a preference or persona save, a slow retry of the join PATCH) could resolve it first, and then we're asserting on the wrong request. Can we scope it to the admin's user id? The join wait above has the same issue, so one small predicate shared by both would cover it.
There was a problem hiding this comment.
Done in df06844. The admin id comes from /users/loggedInUser, and one waitForOwnTeamsPatch() predicate matches the exact path /api/v1/users/<adminId> with PATCH. Join and leave both use it.
| ); | ||
| await leaveButton.click(); | ||
| await leaveResponse; | ||
| expect((await leaveResponse).status()).toBe(200); |
There was a problem hiding this comment.
nit: waitForResponseWithStatus in utils/waitHelpers.ts does this wait + status check in one call, and gives a clearer error (PATCH /api/v1/users/...: expected HTTP 200, received 4xx) when it fails. Would be nice to use it for both the join and leave waits.
There was a problem hiding this comment.
Done in df06844: both waits go through waitForResponseWithStatus(..., 200).
…Team spec fixes - createMemoryViaApi keeps the Approved default when entityStatus is passed as undefined - Dashboard drops the Approved asserts that only echoed the helper (OSS default is guarded by ContextMemoryCreateGrantIT) - Permission owner fixture goes through createMemoryViaApi so a failed POST fails fast - Table tag test searches the column before tagging, so pagination and sort no longer matter; afterAll hard-deletes the glossary and classification - ProfileTeam join/leave waits are scoped to the admin's own PATCH via waitForResponseWithStatus
🔄 Playwright impact map auto-refreshedThis PR touched specs or UI source that changed the source→spec routing map. I regenerated What is this file? It is the auto-generated half of Playwright's PR planner. It routes "if source X changes, run specs Y" by walking spec imports and cross-referencing What if I want to regenerate locally instead? Run this before pushing your next change to skip the bot commit: python3 .github/scripts/generate_playwright_impact_map.py
git add .github/playwright/impact-map.generated.json
git commit --amend --no-edit # or a separate commit |
Code Review ✅ Approved🟡 Medium risk · Playwright fixtures force Approved memories and hard-delete glossary/classification data, which could mask pending-memory behavior or remove shared test labels. Fixes 12 Playwright specs in Context Center, Table and ProfileTeam broken by recent memory-status, page-size and leave-team behavior changes, by updating test setup and wait conditions to match. No issues found. 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:
No issue: this is test-only follow-up for 12 Playwright tests that started failing in the Collate
postgresql~fullrun after three OMD merges on 2026-11-05/06. The product behaviour changes were intended. The specs were not updated for them.ContextCenterDashboard(2),ContextCenterMemories(3),ContextCenterPermission(5)Approvedon OSS butUnprocessedon distributions withreviewRequired(Collate). It also lists pending memories only to their owners and admins. On Collate the admin-created test memories were thereforeUnprocessedand hidden from the reader roles. The Dashboard assertionentityStatus === 'Approved'also failed.createMemoryViaApisendsentityStatus: 'Approved'unless the caller overrides it, matching the OSS default. The Permission spec's rawownerMemoryIdPOST sets it too. Admins keep approval rights on Collate, so both distributions behave the same. Specs that need a pending memory already pass'Unprocessed'.Table› Tags term should be consistent for searchlimit=15&sortBy=name).dim_customer.shop_idmoved to page 2, so its add-tag button never rendered.dim_customer.average_order_size. It is on page 1 and no other spec touches it.customer_idis avoided because the glossary test in the same file edits it, and the two would race.ProfileTeam› Should join and leave a public teamPATCH /api/v1/users/<me>, the same call as Join, instead ofDELETE /teams/<id>/users/<id>. The spec waited for a DELETE that never fires.PATCH /api/v1/users/. The Join wait also assertsresponse.ok().Type of change:
High-level design:
N/A — small test-only change.
Tests:
Use cases covered
Unit tests
Backend integration tests
Ingestion integration tests
Playwright (UI) tests
Only the 12 previously failing tests were run, with
--project=chromium --no-deps. The UI came from this branch (Vite dev server), proxied to a local Collate server.Caveat: the local Collate server was built on Oct 27, before #36989. It therefore shows that the memory changes cause no regression, but it cannot reproduce the Collate
Unprocesseddefault itself. The next Collate CI run will confirm that part.11 passed in the first run:
The Table test failed in that run only because the local server had no sample data (
Entity not found: table sample_data.ecommerce_db.shopify.dim_customer). After seedingdim_customerfromingestion/examples/sample_data/datasets/tables.json(all 29 columns), it passed:eslintandprettier --checkpass on the 4 changed files.Manual testing performed
UI screen recording:
Not applicable — test-only change.
Checklist:
🤖 Generated with Claude Code