Skip to content

test(search): integration test for marketplace index alias#28094

Closed
pmbrull wants to merge 1 commit into
mainfrom
pmbrull/marketplace-index-alias
Closed

test(search): integration test for marketplace index alias#28094
pmbrull wants to merge 1 commit into
mainfrom
pmbrull/marketplace-index-alias

Conversation

@pmbrull
Copy link
Copy Markdown
Member

@pmbrull pmbrull commented May 13, 2026

Describe your changes:

Fixes open-metadata/ai-platform#578

The marketplace index alias is already configured in indexMapping.json as a parentAlias on both domain and dataProduct. This PR adds an integration test that pins the behavior end-to-end so the marketplace search UI cannot silently regress.

Type of change:

  • Improvement

Tests:

Use cases covered

  • Querying GET /v1/search/query?index=marketplace returns only Domain and DataProduct entities and excludes other types (verified with a seeded control Table).
  • The marketplace alias is routable against the live cluster without an error response.

Backend integration tests

  • Added openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/MarketplaceSearchIT.java with two tests (marketplaceAliasReturnsOnlyDomainsAndDataProducts, marketplaceAliasIsRoutableWithoutSeededData).

Manual testing performed

  1. mvn test -pl openmetadata-integration-tests -Dtest="MarketplaceSearchIT"Tests run: 2, Failures: 0, Errors: 0, Skipped: 0.
  2. mvn -pl openmetadata-integration-tests spotless:check → clean.

UI screen recording / screenshots:

Not applicable.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR is linked to a GitHub issue via Fixes above.
  • I have added tests and listed them above.

Validates that querying /v1/search/query?index=marketplace returns only
Domain and DataProduct entities, scoped via the parentAliases already
defined in indexMapping.json. Seeds a domain + data product + control
table and confirms the table is excluded from the alias hits.

Fixes open-metadata/ai-platform#578

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 13, 2026 16:45
@github-actions github-actions Bot added Ingestion safe to test Add this label to run secure Github workflows on PRs labels May 13, 2026
Comment on lines +72 to +86
void marketplaceAliasReturnsOnlyDomainsAndDataProducts(TestNamespace ns) throws Exception {
OpenMetadataClient client = SdkClients.adminClient();

String uniqueTag = "mp" + ns.uniqueShortId();

Domain domain = createDomain(client, uniqueTag + "_domain");
DataProduct dataProduct = createDataProduct(client, uniqueTag + "_dp", domain);
Table controlTable = createControlTable(client, ns, uniqueTag + "_table");

Awaitility.await("marketplace alias returns the seeded domain and data product")
.atMost(Duration.ofSeconds(60))
.pollDelay(Duration.ofMillis(500))
.pollInterval(Duration.ofSeconds(1))
.ignoreExceptions()
.untilAsserted(
Copy link
Copy Markdown

@gitar-bot gitar-bot Bot May 13, 2026

Choose a reason for hiding this comment

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

⚠️ Quality: Test does not clean up created entities after execution

The test creates a Domain, DataProduct, DatabaseService, Database, DatabaseSchema, and Table but never deletes them. Other integration tests in this repository (e.g., EventSubscriptionResourceIT) manually call deleteEntity() or the equivalent client delete method after assertions. Without cleanup, repeated test runs or CI executions will accumulate orphan entities in the shared environment.

Suggested approach: add a try/finally block or @AfterEach to delete entities in reverse dependency order (table → schema → database → service → dataProduct → domain).

Wrap entity creation and assertions in try/finally to ensure cleanup:

@Test
void marketplaceAliasReturnsOnlyDomainsAndDataProducts(TestNamespace ns) throws Exception {
  OpenMetadataClient client = SdkClients.adminClient();
  String uniqueTag = "mp" + ns.uniqueShortId();

  Domain domain = createDomain(client, uniqueTag + "_domain");
  DataProduct dataProduct = createDataProduct(client, uniqueTag + "_dp", domain);
  Table controlTable = createControlTable(client, ns, uniqueTag + "_table");

  try {
    Awaitility.await("marketplace alias returns the seeded domain and data product")
        // ... existing await logic ...
  } finally {
    client.tables().delete(controlTable.getId());
    client.databaseSchemas().delete(/* schema id */);
    client.databases().delete(/* db id */);
    client.databaseServices().delete(/* svc id */);
    client.dataProducts().delete(dataProduct.getId());
    client.domains().delete(domain.getId());
  }
}

Was this helpful? React with 👍 / 👎

@gitar-bot
Copy link
Copy Markdown

gitar-bot Bot commented May 13, 2026

Code Review ⚠️ Changes requested 0 resolved / 1 findings

Adds integration tests for the marketplace index alias, but the test suite fails to clean up created entities, risking pollution of the integration environment.

⚠️ Quality: Test does not clean up created entities after execution

📄 openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/MarketplaceSearchIT.java:72-86

The test creates a Domain, DataProduct, DatabaseService, Database, DatabaseSchema, and Table but never deletes them. Other integration tests in this repository (e.g., EventSubscriptionResourceIT) manually call deleteEntity() or the equivalent client delete method after assertions. Without cleanup, repeated test runs or CI executions will accumulate orphan entities in the shared environment.

Suggested approach: add a try/finally block or @AfterEach to delete entities in reverse dependency order (table → schema → database → service → dataProduct → domain).

Wrap entity creation and assertions in try/finally to ensure cleanup
@Test
void marketplaceAliasReturnsOnlyDomainsAndDataProducts(TestNamespace ns) throws Exception {
  OpenMetadataClient client = SdkClients.adminClient();
  String uniqueTag = "mp" + ns.uniqueShortId();

  Domain domain = createDomain(client, uniqueTag + "_domain");
  DataProduct dataProduct = createDataProduct(client, uniqueTag + "_dp", domain);
  Table controlTable = createControlTable(client, ns, uniqueTag + "_table");

  try {
    Awaitility.await("marketplace alias returns the seeded domain and data product")
        // ... existing await logic ...
  } finally {
    client.tables().delete(controlTable.getId());
    client.databaseSchemas().delete(/* schema id */);
    client.databases().delete(/* db id */);
    client.databaseServices().delete(/* svc id */);
    client.dataProducts().delete(dataProduct.getId());
    client.domains().delete(domain.getId());
  }
}
🤖 Prompt for agents
Code Review: Adds integration tests for the marketplace index alias, but the test suite fails to clean up created entities, risking pollution of the integration environment.

1. ⚠️ Quality: Test does not clean up created entities after execution
   Files: openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/MarketplaceSearchIT.java:72-86

   The test creates a Domain, DataProduct, DatabaseService, Database, DatabaseSchema, and Table but never deletes them. Other integration tests in this repository (e.g., `EventSubscriptionResourceIT`) manually call `deleteEntity()` or the equivalent client delete method after assertions. Without cleanup, repeated test runs or CI executions will accumulate orphan entities in the shared environment.
   
   Suggested approach: add a `try/finally` block or `@AfterEach` to delete entities in reverse dependency order (table → schema → database → service → dataProduct → domain).

   Fix (Wrap entity creation and assertions in try/finally to ensure cleanup):
   @Test
   void marketplaceAliasReturnsOnlyDomainsAndDataProducts(TestNamespace ns) throws Exception {
     OpenMetadataClient client = SdkClients.adminClient();
     String uniqueTag = "mp" + ns.uniqueShortId();
   
     Domain domain = createDomain(client, uniqueTag + "_domain");
     DataProduct dataProduct = createDataProduct(client, uniqueTag + "_dp", domain);
     Table controlTable = createControlTable(client, ns, uniqueTag + "_table");
   
     try {
       Awaitility.await("marketplace alias returns the seeded domain and data product")
           // ... existing await logic ...
     } finally {
       client.tables().delete(controlTable.getId());
       client.databaseSchemas().delete(/* schema id */);
       client.databases().delete(/* db id */);
       client.databaseServices().delete(/* svc id */);
       client.dataProducts().delete(dataProduct.getId());
       client.domains().delete(domain.getId());
     }
   }

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

Copy link
Copy Markdown
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

Adds backend integration coverage for the marketplace search alias to ensure it routes correctly and returns only marketplace-scoped entity types.

Changes:

  • Adds MarketplaceSearchIT with end-to-end search assertions for Domain and DataProduct results.
  • Seeds a control Table to verify non-marketplace entities are excluded.
  • Adds a routability smoke test for the marketplace alias.

Comment on lines +114 to +116
assertFalse(
seenIds.contains(controlTable.getId().toString()),
"marketplace alias should not include tables");
@github-actions
Copy link
Copy Markdown
Contributor

🔴 Playwright Results — 8 failure(s), 19 flaky

✅ 4043 passed · ❌ 8 failed · 🟡 19 flaky · ⏭️ 103 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 297 0 2 4
🔴 Shard 2 737 8 5 25
🟡 Shard 3 778 0 6 7
🟡 Shard 4 789 0 1 18
🟡 Shard 5 707 0 2 41
🟡 Shard 6 735 0 3 8

Genuine Failures (failed on all attempts)

Features/DataQuality/IncidentManagerDateFilter.spec.ts › should show "Created At" as the default sort field label (shard 2)
Error: �[2mexpect(�[22m�[31mreceived�[39m�[2m).�[22mtoBe�[2m(�[22m�[32mexpected�[39m�[2m) // Object.is equality�[22m

Expected: �[32m200�[39m
Received: �[31m400�[39m
Features/DataQuality/IncidentManagerDateFilter.spec.ts › should open sort field dropdown on click (shard 2)
Error: �[2mexpect(�[22m�[31mreceived�[39m�[2m).�[22mtoBe�[2m(�[22m�[32mexpected�[39m�[2m) // Object.is equality�[22m

Expected: �[32m200�[39m
Received: �[31m400�[39m
Features/DataQuality/IncidentManagerDateFilter.spec.ts › should switch to "Updated At" and call API with dateField=updatedAt (shard 2)
Error: �[2mexpect(�[22m�[31mreceived�[39m�[2m).�[22mtoBe�[2m(�[22m�[32mexpected�[39m�[2m) // Object.is equality�[22m

Expected: �[32m200�[39m
Received: �[31m400�[39m
Features/DataQuality/IncidentManagerDateFilter.spec.ts › should switch back to "Created at" and call API with dateField=timestamp (shard 2)
Error: �[2mexpect(�[22m�[31mreceived�[39m�[2m).�[22mtoBe�[2m(�[22m�[32mexpected�[39m�[2m) // Object.is equality�[22m

Expected: �[32m200�[39m
Received: �[31m400�[39m
Features/DataQuality/IncidentManagerDateFilter.spec.ts › should close sort dropdown after selecting an option (shard 2)
Error: �[2mexpect(�[22m�[31mreceived�[39m�[2m).�[22mtoBe�[2m(�[22m�[32mexpected�[39m�[2m) // Object.is equality�[22m

Expected: �[32m200�[39m
Received: �[31m400�[39m
Features/DataQuality/IncidentManagerDateFilter.spec.ts › Date picker shows placeholder by default on Incident Manager page (shard 2)
Error: �[2mexpect(�[22m�[31mreceived�[39m�[2m).�[22mtoBe�[2m(�[22m�[32mexpected�[39m�[2m) // Object.is equality�[22m

Expected: �[32m200�[39m
Received: �[31m400�[39m
Features/DataQuality/IncidentManagerDateFilter.spec.ts › Select and clear date range on Incident Manager page (shard 2)
Error: �[2mexpect(�[22m�[31mreceived�[39m�[2m).�[22mtoBe�[2m(�[22m�[32mexpected�[39m�[2m) // Object.is equality�[22m

Expected: �[32m200�[39m
Received: �[31m400�[39m
Features/IncidentManager.spec.ts › Complete Incident lifecycle with table owner (shard 2)
Error: Wait for incident pw_test_case_5f4d8287 to appear in Incident Manager

�[2mexpect(�[22m�[31mreceived�[39m�[2m).�[22mtoBe�[2m(�[22m�[32mexpected�[39m�[2m) // Object.is equality�[22m

Expected: �[32mtrue�[39m
Received: �[31mfalse�[39m

Call Log:
- Timeout 60000ms exceeded while waiting on the predicate
🟡 19 flaky test(s) (passed on retry)
  • Flow/SearchRBAC.spec.ts › User without permission (shard 1, 1 retry)
  • Flow/SearchRBAC.spec.ts › User without permission (shard 1, 2 retries)
  • Features/BulkEditEntity.spec.ts › Glossary (shard 2, 1 retry)
  • Features/KnowledgeCenter.spec.ts › Article mentions in description should working for Knowledge Center (shard 2, 1 retry)
  • Features/KnowledgeCenterTextEditor.spec.ts › Rich Text Editor - Text Formatting (shard 2, 1 retry)
  • Features/KnowledgeCenterTextEditor.spec.ts › Rich Text Editor - Text Formatting (shard 2, 1 retry)
  • Features/KnowledgeCenterTextEditor.spec.ts › Rich Text Editor - Text Formatting (shard 2, 1 retry)
  • Features/Permissions/DataProductPermissions.spec.ts › Data Product allow operations (shard 3, 1 retry)
  • Features/SettingsNavigationPage.spec.ts › should update navigation sidebar (shard 3, 1 retry)
  • Features/UserProfileOnlineStatus.spec.ts › Should show "Active recently" for users active within last hour (shard 3, 1 retry)
  • Features/UserProfileOnlineStatus.spec.ts › Should not show online status for inactive users (shard 3, 1 retry)
  • Flow/AddRoleAndAssignToUser.spec.ts › Create role (shard 3, 2 retries)
  • Flow/AddRoleAndAssignToUser.spec.ts › Verify assigned role to new user (shard 3, 2 retries)
  • Pages/Entity.spec.ts › Tag and Glossary Term preservation in column detail panel (shard 4, 1 retry)
  • Pages/EntityDataConsumer.spec.ts › Follow & Un-follow entity (shard 5, 1 retry)
  • Pages/ExplorePageRightPanel_KnowledgeCenter.spec.ts › Should remove user owner for knowledgeCenter (shard 5, 2 retries)
  • Pages/Lineage/DataAssetLineage.spec.ts › Column lineage for apiEndpoint -> searchIndex (shard 6, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify Impact Analysis service 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

@pmbrull pmbrull closed this May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

2 participants