Skip to content

fix(playwright): unskip and stabilize OntologyExplorerRdf e2e tests#30412

Closed
anuj-kumary wants to merge 3 commits into
open-metadata:mainfrom
anuj-kumary:fix/ontology-rdf-playwright-routing
Closed

fix(playwright): unskip and stabilize OntologyExplorerRdf e2e tests#30412
anuj-kumary wants to merge 3 commits into
open-metadata:mainfrom
anuj-kumary:fix/ontology-rdf-playwright-routing

Conversation

@anuj-kumary

@anuj-kumary anuj-kumary commented Jul 23, 2026

Copy link
Copy Markdown
Member

Why

OntologyExplorerRdf.spec.ts tests were failing (and the first describe block was skipped) because of a route-interception ordering problem introduced when stripEtagConditionalReads was added.

Root cause: stripEtagConditionalReads (called inside redirectToHomePage) registers a broad **/api/v1/** Playwright route handler using route.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 calling navigateToGlossaryRelationsGraph / redirectToHomePage had their mocks silently shadowed: the broad handler was registered last, had highest priority, and sent every request straight to the real server via route.continue. On a standard CI environment where RDF_ENABLED=false, /rdf/status returned { enabled: false } and all RDF-dependent UI was hidden.

Tests using fixture-based pages (import { test } from '../fixtures/pages') were unaffected because stripEtagConditionalReads is pre-called in openRolePage before the test body runs, so any mock registered inside the test has higher priority.

Fix

  • Call redirectToHomePage(page) immediately after adminUser.login(page) in every test, before any page.route() mock registration. This installs the broad **/api/v1/** handler first; specific mocks registered after have higher priority and intercept correctly.
  • Move the existing redirectToHomePage call in the "term Relations Graph" test from after the route mocks to before them.
  • Tag both test.describe blocks with { tag: ['@ontology-rdf'] } so these tests run under the dedicated "Ontology RDF" playwright project (already in playwright.config.ts) and are excluded from the main chromium project where RDF is not enabled.
  • Remove .skip from 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 enabled
  • Main chromium project run continues to exclude @ontology-rdf tests (via existing grepInvert)
  • No change to common.tsroute.continue is preserved

🤖 Generated with Claude Code

Greptile Summary

Unskips and stabilizes Ontology Explorer RDF Playwright coverage.

  • Registers shared API interception before RDF-specific route mocks.
  • Tags both suites for the dedicated Ontology RDF project.
  • Reformats the describe blocks to match repository conventions.

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

Filename Overview
openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/OntologyExplorerRdf.spec.ts Reorders route setup, enables RDF export tests, applies RDF project tags, and fixes callback indentation.

Reviews (3): Last reviewed commit: "Merge branch 'main' into fix/ontology-rd..." | Re-trigger Greptile

`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>
@anuj-kumary
anuj-kumary requested a review from a team as a code owner July 23, 2026 18:54
@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.

@anuj-kumary anuj-kumary self-assigned this Jul 23, 2026
@anuj-kumary anuj-kumary added the skip-pr-checks Bypass PR metadata validation check label Jul 23, 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!

@anuj-kumary anuj-kumary added the safe to test Add this label to run secure Github workflows on PRs label Jul 23, 2026
@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

🔴 Playwright Results — 2 pipeline/setup failure(s)

✅ 0 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped

Pipeline and setup failures

  • Shard 1 reported zero tests.
  • Shard 1 test execution finished with status failure without a reported test failure.
Shard Passed Failed Flaky Skipped
✅ Shard 1 0 0 0 0

📦 Download artifacts

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'] },

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 RDF workflow trigger is missing

When a pull request changes only this spec, the new @ontology-rdf tag excludes the suite from the main Chromium project, while the dedicated Ontology RDF workflow's path filter omits this file, causing these newly enabled tests not to run in CI.

@gitar-bot

gitar-bot Bot commented Jul 24, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Unskips 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.

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 👍 / 👎 | Gitar

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 skip-pr-checks Bypass PR metadata validation check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant