Skip to content

chore(ui): run subdomain pagination only in oss and not on aut#26599

Open
karanh37 wants to merge 4 commits intomainfrom
fix-subdomain
Open

chore(ui): run subdomain pagination only in oss and not on aut#26599
karanh37 wants to merge 4 commits intomainfrom
fix-subdomain

Conversation

@karanh37
Copy link
Contributor

No description provided.

@karanh37 karanh37 requested a review from a team as a code owner March 19, 2026 07:16
Copilot AI review requested due to automatic review settings March 19, 2026 07:16
@github-actions github-actions bot added safe to test Add this label to run secure Github workflows on PRs UI UI specific issues labels Mar 19, 2026
const SUBDOMAIN_COUNT = 60;

test.describe('SubDomain Pagination', () => {
if (process.env.PLAYWRIGHT_IS_OSS) {
Copy link

Choose a reason for hiding this comment

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

⚠️ Bug: test.describe inside if block skips test.slow and hooks

Wrapping the entire test.describe block inside if (process.env.PLAYWRIGHT_IS_OSS) works, but the idiomatic Playwright approach is to use test.skip inside the describe block. The current approach means Playwright won't even register the test suite when the env var is falsy, which can cause confusing behavior in test reports (tests silently disappear rather than showing as skipped).

Consider using test.describe with a conditional skip instead, so the tests are always registered but explicitly skipped when not running in OSS mode. This gives better visibility in CI reports.

Suggested fix:

test.describe('SubDomain Pagination', () => {
  test.skip(!process.env.PLAYWRIGHT_IS_OSS, 'Only runs in OSS mode');
  test.slow(true);
  // ... rest of tests unchanged
});

Was this helpful? React with 👍 / 👎 | Reply gitar fix to apply this suggestion

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates a Playwright E2E spec so the “SubDomain Pagination” suite only runs in OSS environments, and adjusts the expected search request made when opening the Subdomains tab.

Changes:

  • Gate the entire SubDomain Pagination test suite behind process.env.PLAYWRIGHT_IS_OSS.
  • Update the waitForResponse URL matcher for the initial subdomain search request.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines 88 to 90
const subDomainRes = page.waitForResponse(
'/api/v1/search/query?q=&index=domain&from=0&size=9*'
'/api/v1/search/query?q=&index=domain_search_index&from=0&size=9*'
);
Comment on lines 32 to 35
if (process.env.PLAYWRIGHT_IS_OSS) {
test.describe('SubDomain Pagination', () => {
test.slow(true);

@github-actions
Copy link
Contributor

github-actions bot commented Mar 19, 2026

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 64%
65.01% (58077/89325) 44.8% (30706/68540) 47.8% (9195/19234)

@github-actions
Copy link
Contributor

github-actions bot commented Mar 19, 2026

🟡 Playwright Results — all passed (21 flaky)

✅ 3388 passed · ❌ 0 failed · 🟡 21 flaky · ⏭️ 183 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 454 0 1 2
✅ Shard 2 305 0 0 1
🟡 Shard 3 667 0 8 33
🟡 Shard 4 683 0 5 41
✅ Shard 5 672 0 0 73
🟡 Shard 6 607 0 7 33
🟡 21 flaky test(s) (passed on retry)
  • Features/CustomizeDetailPage.spec.ts › API Endpoint - customization should work (shard 1, 1 retry)
  • Features/BulkImport.spec.ts › Database (shard 3, 1 retry)
  • Features/DataQuality/TestCaseImportExportE2eFlow.spec.ts › Admin: Complete export-import-validate flow (shard 3, 1 retry)
  • Features/DataQuality/TestCaseImportExportE2eFlow.spec.ts › EditAll User: Complete export-import-validate flow (shard 3, 1 retry)
  • Features/DataQuality/TestCaseIncidentPermissions.spec.ts › User with TEST_CASE.EDIT_ALL can see edit icon on incidents (shard 3, 1 retry)
  • Features/DataQuality/TestCaseIncidentPermissions.spec.ts › User with only VIEW cannot PATCH incidents (shard 3, 1 retry)
  • Features/DataQuality/TestCaseResultPermissions.spec.ts › User with TEST_CASE.EDIT_ALL can see edit action on test case (shard 3, 1 retry)
  • Features/Glossary/GlossaryHierarchy.spec.ts › should cancel move operation (shard 3, 1 retry)
  • Features/Permissions/GlossaryPermissions.spec.ts › Team-based permissions work correctly (shard 3, 1 retry)
  • Pages/Customproperties-part2.spec.ts › entityReferenceList shows item count, scrollable list, no expand toggle (shard 4, 1 retry)
  • Pages/DataContractsSemanticRules.spec.ts › Validate Description Rule Is_Not_Set (shard 4, 1 retry)
  • Pages/Domains.spec.ts › Data Product announcement create, edit & delete (shard 4, 1 retry)
  • Pages/Entity.spec.ts › Team as Owner Add, Update and Remove (shard 4, 1 retry)
  • Pages/Entity.spec.ts › Glossary Term Add, Update and Remove for child entities (shard 4, 1 retry)
  • Pages/Glossary.spec.ts › Column dropdown drag-and-drop functionality for Glossary Terms table (shard 6, 1 retry)
  • Pages/Glossary.spec.ts › Verify Glossary Term Deny Permission (shard 6, 1 retry)
  • Pages/Lineage.spec.ts › Lineage creation from Container entity (shard 6, 2 retries)
  • Pages/Lineage.spec.ts › Lineage creation from ApiEndpoint entity (shard 6, 2 retries)
  • Pages/Users.spec.ts › Permissions for table details page for Data Consumer (shard 6, 1 retry)
  • Pages/Users.spec.ts › Check permissions for Data Steward (shard 6, 1 retry)
  • VersionPages/EntityVersionPages.spec.ts › Directory (shard 6, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

Copilot AI review requested due to automatic review settings March 23, 2026 12:21
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates a Playwright E2E spec so the SubDomain pagination scenario only executes in OSS runs, avoiding running it in AUT/non-OSS environments.

Changes:

  • Wrap SubDomain pagination setup/teardown and the test itself behind process.env.PLAYWRIGHT_IS_OSS.
  • Update the expected /search/query URL pattern used in waitForResponse for the initial subdomain tab load.
  • Re-indent the spec due to the added conditional block.

Comment on lines +88 to +90
const subDomainRes = page.waitForResponse(
'/api/v1/search/query?q=&index=domain_search_index&from=0&size=9*'
);
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

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

page.waitForResponse is waiting for index=domain_search_index, but the UI search requests for domains use SearchIndex.DOMAIN which serializes to index=domain (see src/rest/domainAPI.ts and src/enums/search.enum.ts). As written, this response wait can time out if the actual request uses index=domain, causing the test to flake/fail. Update the expected URL/predicate to match the real request (and consider using a predicate that checks index=domain plus from/size without relying on exact query param order).

Suggested change
const subDomainRes = page.waitForResponse(
'/api/v1/search/query?q=&index=domain_search_index&from=0&size=9*'
);
const subDomainRes = page.waitForResponse((response) => {
const url = response.url();
return (
url.includes('/api/v1/search/query') &&
url.includes('index=domain') &&
url.includes('from=0') &&
url.includes('size=9')
);
});

Copilot uses AI. Check for mistakes.

test.beforeAll('Setup domain and subdomains', async ({ browser }) => {
test.slow(true);
if(process.env.PLAYWRIGHT_IS_OSS) {
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

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

Code style: if(process.env.PLAYWRIGHT_IS_OSS) { doesn’t match the formatting used across the Playwright suite (if (...) {) and is likely to be rewritten by Prettier/CI formatting checks. Please apply standard spacing here.

Suggested change
if(process.env.PLAYWRIGHT_IS_OSS) {
if (process.env.PLAYWRIGHT_IS_OSS) {

Copilot uses AI. Check for mistakes.
@gitar-bot
Copy link

gitar-bot bot commented Mar 23, 2026

Code Review ⚠️ Changes requested 0 resolved / 1 findings

Restricts subdomain pagination to OSS deployments only, excluding AUT environments. However, wrapping test.describe inside an if block skips test.slow and hooks, which breaks test execution semantics.

⚠️ Bug: test.describe inside if block skips test.slow and hooks

📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/SubDomainPagination.spec.ts:32

Wrapping the entire test.describe block inside if (process.env.PLAYWRIGHT_IS_OSS) works, but the idiomatic Playwright approach is to use test.skip inside the describe block. The current approach means Playwright won't even register the test suite when the env var is falsy, which can cause confusing behavior in test reports (tests silently disappear rather than showing as skipped).

Consider using test.describe with a conditional skip instead, so the tests are always registered but explicitly skipped when not running in OSS mode. This gives better visibility in CI reports.

Suggested fix
test.describe('SubDomain Pagination', () => {
  test.skip(!process.env.PLAYWRIGHT_IS_OSS, 'Only runs in OSS mode');
  test.slow(true);
  // ... rest of tests unchanged
});
🤖 Prompt for agents
Code Review: Restricts subdomain pagination to OSS deployments only, excluding AUT environments. However, wrapping test.describe inside an if block skips test.slow and hooks, which breaks test execution semantics.

1. ⚠️ Bug: `test.describe` inside `if` block skips `test.slow` and hooks
   Files: openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/SubDomainPagination.spec.ts:32

   Wrapping the entire `test.describe` block inside `if (process.env.PLAYWRIGHT_IS_OSS)` works, but the idiomatic Playwright approach is to use `test.skip` inside the describe block. The current approach means Playwright won't even register the test suite when the env var is falsy, which can cause confusing behavior in test reports (tests silently disappear rather than showing as skipped).
   
   Consider using `test.describe` with a conditional skip instead, so the tests are always registered but explicitly skipped when not running in OSS mode. This gives better visibility in CI reports.

   Suggested fix:
   test.describe('SubDomain Pagination', () => {
     test.skip(!process.env.PLAYWRIGHT_IS_OSS, 'Only runs in OSS mode');
     test.slow(true);
     // ... rest of tests unchanged
   });

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@sonarqubecloud
Copy link

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