fix(playwright): unskip and stabilize OntologyExplorerRdf e2e tests#30412
fix(playwright): unskip and stabilize OntologyExplorerRdf e2e tests#30412anuj-kumary wants to merge 3 commits into
Conversation
`stripEtagConditionalReads` registers a broad `**/api/v1/**` route handler via `route.continue`. Playwright evaluates handlers in reverse-registration order (newest = highest priority), so any test that registered its specific mocks *before* calling `navigateToGlossaryRelationsGraph` (which calls `redirectToHomePage` → `stripEtagConditionalReads`) had its mocks shadowed by the broad handler, causing requests to hit the real server where `RDF_ENABLED=false` → `rdfEnabled: false` → RDF options hidden. Fix: call `redirectToHomePage(page)` immediately after login in every test, before any `page.route()` mock registration. This installs the broad handler first; specific mocks registered after have higher priority and intercept correctly. Also tags both describe blocks with `@ontology-rdf` so the tests run under the dedicated "Ontology RDF" playwright project (already defined in playwright.config.ts) and are excluded from the main chromium project where RDF is disabled. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
❌ 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! |
🔴 Playwright Results — 2 pipeline/setup failure(s)✅ 0 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped Pipeline and setup failures
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
| test.describe.skip('Ontology Explorer — RDF exports (Turtle and RDF/XML)', () => { | ||
| test.describe( | ||
| 'Ontology Explorer — RDF exports (Turtle and RDF/XML)', | ||
| { tag: ['@ontology-rdf'] }, |
There was a problem hiding this comment.
Code Review ✅ ApprovedUnskips and stabilizes OntologyExplorerRdf end-to-end tests by correcting Playwright route-interception ordering and tagging describe blocks for the dedicated test project. 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 |
Why
OntologyExplorerRdf.spec.tstests were failing (and the first describe block was skipped) because of a route-interception ordering problem introduced whenstripEtagConditionalReadswas added.Root cause:
stripEtagConditionalReads(called insideredirectToHomePage) registers a broad**/api/v1/**Playwright route handler usingroute.continue. Playwright evaluates handlers in reverse-registration order — the most recently added handler wins. Tests that registered their specific mocks (e.g.**/api/v1/rdf/status**) before callingnavigateToGlossaryRelationsGraph/redirectToHomePagehad their mocks silently shadowed: the broad handler was registered last, had highest priority, and sent every request straight to the real server viaroute.continue. On a standard CI environment whereRDF_ENABLED=false,/rdf/statusreturned{ enabled: false }and all RDF-dependent UI was hidden.Tests using fixture-based pages (
import { test } from '../fixtures/pages') were unaffected becausestripEtagConditionalReadsis pre-called inopenRolePagebefore the test body runs, so any mock registered inside the test has higher priority.Fix
redirectToHomePage(page)immediately afteradminUser.login(page)in every test, before anypage.route()mock registration. This installs the broad**/api/v1/**handler first; specific mocks registered after have higher priority and intercept correctly.redirectToHomePagecall in the "term Relations Graph" test from after the route mocks to before them.test.describeblocks with{ tag: ['@ontology-rdf'] }so these tests run under the dedicated "Ontology RDF" playwright project (already inplaywright.config.ts) and are excluded from the mainchromiumproject where RDF is not enabled..skipfrom the exports describe block — the root cause is fixed so the skip is no longer needed.Test plan
npx playwright test --project="Ontology RDF"passes locally against a server with Fuseki enabledchromiumproject run continues to exclude@ontology-rdftests (via existinggrepInvert)common.ts—route.continueis preserved🤖 Generated with Claude Code
Greptile Summary
Unskips and stabilizes Ontology Explorer RDF Playwright coverage.
Confidence Score: 5/5
The PR appears safe to merge with no additional blocking failures identified in this follow-up.
No blocking failure remains beyond the issues already covered by previous review threads.
Important Files Changed
Reviews (3): Last reviewed commit: "Merge branch 'main' into fix/ontology-rd..." | Re-trigger Greptile