Skip to content

test:fix SearchSeparation failure#28239

Merged
anuj-kumary merged 7 commits into
mainfrom
search-separation-test
May 19, 2026
Merged

test:fix SearchSeparation failure#28239
anuj-kumary merged 7 commits into
mainfrom
search-separation-test

Conversation

@anuj-kumary
Copy link
Copy Markdown
Member

@anuj-kumary anuj-kumary commented May 18, 2026

Describe your changes:

Playwright tests were intermittently failing for entity types due to the target entity is not on page 1, and toBeVisible() times out.

This PR adds proper server-side filtering support for all entity types, including filters like service and tier, so only the required entities are fetched and displayed on the first page during test execution.


Summary by Gitar

  • Test infrastructure:
    • Added SearchSeparationSuite.ts as a centralized, reusable factory for verifying search index parity (live update vs. full reindex).
    • Fixed import casing in 11 entity test specs to align with the new filename SearchSeparationSuite.ts.
  • Search validation logic:
    • Implemented waitForLiveIndex to verify propagation of tier tags to Elasticsearch.
    • Added checkExploreFilterWithServiceBase to validate faceted search filtering across Tier, Certification, and Tag categories.
    • Enhanced assertReindexedDocPreservesSeparation to dynamically extract service display names during indexing checks.

This will update automatically on new commits.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 18, 2026

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 62%
62.73% (65548/104482) 43.58% (35936/82447) 46.32% (10562/22799)

harshach
harshach previously approved these changes May 18, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 18, 2026

🟡 Playwright Results — all passed (12 flaky)

✅ 4140 passed · ❌ 0 failed · 🟡 12 flaky · ⏭️ 86 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 298 0 1 4
🟡 Shard 2 777 0 4 8
🟡 Shard 3 777 0 1 7
🟡 Shard 4 781 0 1 12
🟡 Shard 5 771 0 2 47
🟡 Shard 6 736 0 3 8
🟡 12 flaky test(s) (passed on retry)
  • Features/DataAssetRulesDisabled.spec.ts › Verify the Storage Service entity item action after rules disabled (shard 1, 1 retry)
  • Features/BulkImport.spec.ts › Table (shard 2, 1 retry)
  • Features/DataQuality/DataQuality.spec.ts › TestCase filters (shard 2, 1 retry)
  • Features/Glossary/GlossaryWorkflow.spec.ts › should start term as Draft when glossary has reviewers (shard 2, 2 retries)
  • Features/KnowledgeCenter.spec.ts › Article mentions in description should working for Knowledge Center (shard 2, 1 retry)
  • Features/RTL.spec.ts › Verify Following widget functionality (shard 3, 1 retry)
  • Pages/DataContractsSemanticRules.spec.ts › Validate Description Rule Is_Not_Set (shard 4, 1 retry)
  • Pages/Entity.spec.ts › Tier Add, Update and Remove (shard 5, 1 retry)
  • Pages/ExplorePageRightPanel_KnowledgeCenter.spec.ts › Should remove user owner for knowledgeCenter (shard 5, 1 retry)
  • Pages/ExplorePageRightPanel.spec.ts › Should clear description for dashboardDataModel (shard 6, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage schema filter selection (shard 6, 1 retry)
  • Pages/UserDetails.spec.ts › Admin user can edit teams from the user profile (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

@gitar-bot
Copy link
Copy Markdown

gitar-bot Bot commented May 19, 2026

Code Review ✅ Approved 2 resolved / 2 findings

Implements server-side filtering and the reusable SearchSeparationSuite to resolve intermittent Playwright timeouts. Duplicated assertion logic and unsafe casting have been cleaned up to ensure robust test stability.

✅ 2 resolved
Quality: Large duplicated filter assertion blocks in if/else branches

📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/SearchSeparation/SearchSeparationSuite.ts:424-438
The assertAllFourFiltersWork function (lines 424–493) duplicates 4 nearly identical filter assertion calls in both the if (serviceName) and else branches. The only difference is whether the service-scoped helper (checkExploreFilterWithServiceBase) or the generic helper (checkExploreSearchFilter) is used. This makes the function harder to maintain — any new filter added must be duplicated in both branches.

Consider extracting a small helper or using a loop over the filter definitions, delegating to the appropriate checker based on whether serviceName is defined.

Quality: Unsafe cast chain to access serviceResponseData

📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/SearchSeparation/SearchSeparationSuite.ts:413-418
Lines 413–418 cast entity to unknown then to Record<string, unknown> to access serviceResponseData. This bypasses type safety entirely and will silently return undefined if the property name changes. Since the PR already defines FilterSeparationEntity as a structural type, consider adding an optional serviceResponseData field to that type (or a dedicated accessor) so the access is type-checked.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@sonarqubecloud
Copy link
Copy Markdown

@anuj-kumary anuj-kumary merged commit d3d8697 into main May 19, 2026
56 of 57 checks passed
@anuj-kumary anuj-kumary deleted the search-separation-test branch May 19, 2026 08:43
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants