Skip to content

fix(test-suite): pre-select existing tests + correct Table filter scope (#28400)#28543

Merged
manerow merged 3 commits into
mainfrom
fix/issue-28400-pre-select-existing-test-cases
Jun 1, 2026
Merged

fix(test-suite): pre-select existing tests + correct Table filter scope (#28400)#28543
manerow merged 3 commits into
mainfrom
fix/issue-28400-pre-select-existing-test-cases

Conversation

@manerow
Copy link
Copy Markdown
Contributor

@manerow manerow commented May 29, 2026

Fixes #28400. Also fixes a related — and previously unreported — bug in the same modal's Table filter that surfaced while investigating.

1. Already-added test cases not pre-selected (#28400)

Cause

  • TestSuiteDetailsPage never requested the tests field, so it passed selectedTest = testCaseResult.map(t => t.name) — only the currently visible page of names.
  • AddTestCaseList declared an existingTest: EntityReference[] prop but never consumed it; hydration was destructive and name-based.

Fix

  • TestSuiteDetailsPage: request TabSpecificField.TESTS so testSuite.tests carries the full reference list; refetch the suite after a successful add; drop the paginated selectedTest.
  • AddTestCaseList: seed selectedItems from existingTest by id via seedSelectedFromExistingTest; merge-and-upgrade in fetchTestCases instead of replacing. Legacy name-based path preserved for BundleSuiteForm.

2. Table filter silently drops column-level tests

CauseTestCaseResource.executeTestCaseSearch parses the UI's entityLink=<#E::table::FQN> and rewrites it into entityFQN=FQN on the search filter. SearchListFilter.getTestCaseCondition then chooses between exact-match and prefix-match based on the includeAllTests flag:

includeAllTests
  ? getTestCaseForEntityCondition(entityFQN, "entityFQN")   // entityFQN == FQN OR starts with "FQN."
  : "{\"term\":{\"entityFQN\":\"FQN\"}}"                     // exact match

Column-level tests have entityFQN = "<table>.<column>", so the default exact-match drops them all. Picking a table with only column-level tests returned zero results.

Fix — pair includeAllTests: true with entityLink in the modal's request. The semantic ("all tests under this table") matches the UI intent exactly; the backend flag exists for precisely this purpose. No backend change.

// includeAllTests=true: prefix-match entityFQN so column tests
// under the selected table are included.
...(entityLink && { entityLink, includeAllTests: true }),

Sibling-prefix collisions are not possible: the prefix uses entityFQN + "." so orders matches orders.col but not orders_archive.

Type of change

  • Bug fix

Tests

  • Unit — 90/90 tests in AddTestCaseList.* and TestSuiteDetailsPage.* pass. New tests added for: (a) pre-selection by existingTest, (b) persistence after user adds an extra pick, (c) seedSelectedFromExistingTest helper, (d) Table filter must send includeAllTests=true, (e) includeAllTests is omitted when no Table filter is set.
  • Filter matrix (live backend) — 18/18 scenarios pass covering every filter in isolation, every meaningful pair, and discrimination tests (Status=Queued → 0, Column=non-existent → 0, Table=non-existent → 0, q=*no_match* → 0). Includes a regression check that demonstrates the broken pre-fix behavior (Table=orders without includeAllTests returns 1 instead of 4).
  • Live UI (Playwright) — opened the modal on a suite with 15 existing tests + applied the Table filter:
    • Pre-selection: 14 unique testids render checked=true.
    • Table-filter request now contains &includeAllTests=true and the modal renders all 4 tests on the selected table (was 0).

@manerow manerow requested a review from a team as a code owner May 29, 2026 11:22
@manerow manerow added the To release Will cherry-pick this PR into the release branch label May 29, 2026
@github-actions github-actions Bot added backend safe to test Add this label to run secure Github workflows on PRs labels May 29, 2026
@manerow manerow self-assigned this May 29, 2026
@manerow manerow added UI UI specific issues and removed backend labels May 29, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 62%
63.07% (66745/105817) 43.92% (36630/83384) 46.12% (10851/23523)

@manerow manerow changed the title fix(test-suite): pre-select every test case already in the suite (#28400) fix(test-suite): pre-select existing tests + correct Table filter scope (#28400) May 29, 2026
@sonarqubecloud
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown
Contributor

🟡 Playwright Results — all passed (16 flaky)

✅ 4255 passed · ❌ 0 failed · 🟡 16 flaky · ⏭️ 88 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 298 0 1 4
🟡 Shard 2 805 0 2 9
🟡 Shard 3 805 0 1 8
🟡 Shard 4 839 0 7 12
🟡 Shard 5 719 0 1 47
🟡 Shard 6 789 0 4 8
🟡 16 flaky test(s) (passed on retry)
  • Pages/AuditLogs.spec.ts › should apply both User and EntityType filters simultaneously (shard 1, 1 retry)
  • Features/DataQuality/BundleSuiteBulkOperations.spec.ts › Add test case to existing Bundle Suite (shard 2, 1 retry)
  • Features/Glossary/GlossaryWorkflow.spec.ts › should display correct status badge color and icon (shard 2, 1 retry)
  • Features/KnowledgeCenter.spec.ts › Article mentions in description should working for Knowledge Center (shard 3, 1 retry)
  • Pages/CustomProperties.spec.ts › Sql Query (shard 4, 1 retry)
  • Pages/CustomProperties.spec.ts › Hyperlink (shard 4, 1 retry)
  • Pages/CustomProperties.spec.ts › Hyperlink (shard 4, 1 retry)
  • Pages/CustomProperties.spec.ts › Duration (shard 4, 1 retry)
  • Pages/CustomProperties.spec.ts › Date (shard 4, 2 retries)
  • Pages/CustomProperties.spec.ts › Set enum custom property on column and verify in UI (shard 4, 2 retries)
  • Pages/DataContracts.spec.ts › Create Data Contract and validate for Table (shard 4, 1 retry)
  • Pages/Entity.spec.ts › User as Owner with unsorted list (shard 5, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage schema filter selection (shard 6, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab IS visible for supported type: searchIndex (shard 6, 1 retry)
  • Pages/Lineage/PlatformLineage.spec.ts › Verify domain platform view (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

@manerow manerow merged commit e3d9c8c into main Jun 1, 2026
49 checks passed
@manerow manerow deleted the fix/issue-28400-pre-select-existing-test-cases branch June 1, 2026 05:21
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

Failed to cherry-pick changes to the 1.12.10 branch.
Please cherry-pick the changes manually.
You can find more details here.

@gitar-bot
Copy link
Copy Markdown

gitar-bot Bot commented Jun 1, 2026

Code Review ✅ Approved

Pre-selects existing test cases by ID and ensures the Table filter correctly retrieves column-level tests by enabling includeAllTests=true. No issues found.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

Changes have been cherry-picked to the 1.13 branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend safe to test Add this label to run secure Github workflows on PRs To release Will cherry-pick this PR into the release branch UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test Case Selection Modal Does Not Indicate Already-Added Test Cases

2 participants