Skip to content

test(e2e): stop persona specs asserting the system default persona fallback - #31696

Merged
harsh-vador merged 2 commits into
1.13from
1.13-fix/persona-e2e-system-default-fallback
Aug 18, 2026
Merged

harsh-vador merged 2 commits into
1.13from
1.13-fix/persona-e2e-system-default-fallback

Conversation

@harsh-vador

@harsh-vador harsh-vador commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

What

Backports the persona-specific parts of #31063, #30699, #30203 and #30732 to 1.13, where they were never cherry-picked. main and 2.0 already carry all four, which is why this failure is 1.13-only.

RCA

Team persona setting flow > Set default persona for team should work properly fails at:

expect(locator).toContainText(expected) failed
Locator:  getByTestId('default-persona-chip')
Expected substring: "No default persona"
Received string:    "PW Persona ac9eb…"

Not a product bug — the assertion depends on global state the test does not own.

  1. The chip renders user.defaultPersona (UserProfilePersona.component.tsx).
  2. When a user has no default persona, the backend resolves the field to the system default persona (UserRepository.getDefaultPersona).
  3. So "No default persona" only ever renders when nothing else has a system default set.
  4. The sibling describe in this same file (Default persona setting and removal flow) sets and then clears a system default, and the AUT ships with a pre-seeded Onboarding System Default Experience persona. The received value in the trace — PW Persona ac9eb… — is that sibling's own fixture, not the team persona.

So the assertion was passing on another test's side effect. In 1.13 that leak is worse than upstream: the sibling describe shares a module-level UserClass with Persona operations and has no teardown at all, so its personas and the system default it set survive the run.

Two secondary defects in the shared helpers, same class of problem:

  • persona.ts waited on page.waitForResponse('/api/v1/personas/*') — an unfiltered matcher that any in-flight GET can satisfy, so the helper could return before the PATCH landed.
  • It also awaited toBeVisible on default-persona-confirmation-modal, a testid that sits on the antd .ant-modal-root wrapper (0x0) and therefore always reports hidden.

Users.spec.ts carried the same system-default-fallback bug in the persona-removal test: it asserted no default-persona-tag and zero checked radios across every persona-label in the dropdown, which the system default persona trips.

#30278 (fix(ui): stop showing inherited team persona as user default persona) is already in 1.13 as bba09e4424e — UserProfilePersona.component.tsx is byte-identical to main. Not the cause here.

Changes

Deliberately not backported

The default-persona-select-list server-side search step present in main — it requires /api/v1/personas/search from #30469, a feature PR absent from 1.13. Porting the test alone would 404.

Verification

  • Prettier: clean on all three files
  • ESLint: clean on all three files
  • tsc --noEmit -p playwright/tsconfig.json: error set for these three files unchanged against the pre-change baseline (one pre-existing unused getApiContext in Users.spec.ts)
  • Specs not run locally — needs a live AUT; only a nightly can confirm the flake is gone

🤖 Generated with Claude Code

Greptile Summary

The PR makes persona E2E coverage independent of the system-default persona fallback and improves test isolation and response synchronization.

  • Scopes persona-removal checks to the two user-owned fixture personas and now verifies each matching label exists.
  • Gives the default-persona flow isolated fixtures and teardown.
  • Waits specifically for persona PATCH responses and actionable confirmation buttons.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/PersonaFlow.spec.ts Isolates default-persona fixtures, adds cleanup, and replaces a global-state-dependent team-persona assertion with the intended invariant.
openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Users.spec.ts Completes the prior fix by requiring each fixture persona label to be visible before checking that it is neither selected nor marked as default.
openmetadata-ui/src/main/resources/ui/playwright/utils/persona.ts Synchronizes default-persona actions with visible confirmation controls and method-specific PATCH responses.

Reviews (2): Last reviewed commit: "test(e2e): require the persona label to ..." | Re-trigger Greptile

…llback

Backports the persona-specific parts of #31063, #30699, #30203 and #30732 to
1.13, where these fixes were never cherry-picked.

The user default-persona chip renders user.defaultPersona, and the backend
resolves an unset user default to the SYSTEM default persona
(UserRepository.getDefaultPersona). Two specs asserted the "no default persona"
placeholder, which therefore only appears when nothing else has set a system
default — global state neither test owns.

- PersonaFlow.spec.ts "Set default persona for team": asserts the team persona
  is not auto-applied (the actual invariant) instead of the placeholder text,
  with a visibility check first so the negative assertion cannot pass against a
  chip that never rendered.
- Users.spec.ts persona removal: scopes the default-tag and radio assertions to
  the user's own personas instead of every persona-label in the dropdown.
- PersonaFlow.spec.ts "Default persona setting and removal flow": moves the
  shared module-level UserClass into the describe, adds an afterAll teardown for
  the user and both personas, and closes the user browser context in a finally,
  so this describe no longer leaks a system default persona into sibling specs.
- persona.ts: waits for the confirmation modal's "Yes" button (the modal testid
  is on the 0x0 .ant-modal-root wrapper, so toBeVisible always reports hidden)
  and scopes the response wait to PATCH /api/v1/personas/{id} so an in-flight
  GET cannot satisfy it.

The server-side persona search step present in main is deliberately not
backported: it depends on the /api/v1/personas/search endpoint from #30469,
which 1.13 does not have.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@harsh-vador
harsh-vador requested a review from a team as a code owner August 18, 2026 11:19
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

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 skip-pr-checks label.

@github-actions github-actions Bot added the UI UI specific issues label Aug 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@harsh-vador harsh-vador self-assigned this Aug 18, 2026
@harsh-vador harsh-vador added the safe to test Add this label to run secure Github workflows on PRs label Aug 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

❌ UI Checkstyle Failed

❌ Playwright - ESLint + Prettier + Organise Imports

One or more Playwright test files have linting or formatting issues.

Affected files
  • openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Users.spec.ts

❌ Core Components - I18n Sync

Core-components t() keys, locale files, or language-set are out of sync. Run yarn check-i18n-all locally.

❌ Antd + Less Deprecation Guard

A new antd import or new .less file was added. Use UntitledUI + Tailwind for new work.

Affected files

at Function._resolveFilename (node:internal/modules/cjs/loader:1401:15)
at defaultResolveImpl (node:internal/modules/cjs/loader:1057:19)
at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1062:22)
at Function._load (node:internal/modules/cjs/loader:1211:37)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:171:5)
at node:internal/main/run_main_module:36:49 {


Fix locally (fast - only checks files changed in this branch):

make ui-checkstyle-changed

Both negative assertions run against a filtered locator that is allowed to
match nothing, so they pass when the fixture persona is absent from the
dropdown entirely — the test would go green without ever checking the persona
whose default was removed.

Assert the label is visible first, matching the guard already used on the
default persona chip in PersonaFlow.spec.ts.
@harsh-vador

Copy link
Copy Markdown
Contributor Author

Good catch — fixed in 8bc6fd3.

filter({ hasText }) is allowed to match zero elements, so both not.toBeVisible() and not.toBeChecked() pass vacuously when the fixture persona is missing from the dropdown: the test would go green without ever checking the persona whose default was removed.

Added await expect(userPersonaLabel).toBeVisible(); before the two negative checks, which is the same guard this PR already adds to the default persona chip in PersonaFlow.spec.ts. Kept not.toBeChecked() rather than the suggested diff's shape, since dropping it would lose the 'no persona is selected' half of the assertion.

@gitar-bot

gitar-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Backports persona E2E test isolation and helper synchronization fixes to 1.13, ensuring specs do not rely on leaked system default personas. No issues found.

Options

Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@harsh-vador
harsh-vador merged commit 9fdd7b8 into 1.13 Aug 18, 2026
69 of 73 checks passed
@harsh-vador
harsh-vador deleted the 1.13-fix/persona-e2e-system-default-fallback branch August 18, 2026 15:51

This branch was previously deployed

1 inactive deployment
test — 8bc6fd3c Deployed Aug 18, 2026 by harsh-vador via playwright-ci-postgresql (5, 6) #70113
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants