Skip to content

TRT-2795: Test Analysis: Regressions disappear when variant filters are applied - #331

Open
openshift-trt-agent[bot] wants to merge 1 commit into
eval/case-005-basefrom
fix-TRT-2795-eval-20260824-175947
Open

TRT-2795: Test Analysis: Regressions disappear when variant filters are applied#331
openshift-trt-agent[bot] wants to merge 1 commit into
eval/case-005-basefrom
fix-TRT-2795-eval-20260824-175947

Conversation

@openshift-trt-agent

Copy link
Copy Markdown

TRT-2795: Fix regressions disappearing when variant filters are applied

Summary

  • Fixed a data format mismatch in the Test Analysis page's regressions widget where variant filter values from autocomplete (e.g. Platform:gcp) were compared against only the parsed value part of regression variants (e.g. gcp), causing all regressions to disappear when any variant filter was applied.
  • Extracted the variant filtering logic into a testable filterRegressionsByVariants function and added comprehensive unit tests.

Root Cause

The TestRegressionsTable component applied variant filters client-side by parsing regression variant strings through parseVariantName(), which extracts just the value portion ("gcp" from "Platform:gcp"). However, filter values from the autocomplete dropdown retain the full Key:Value format ("Platform:gcp"). The comparison "gcp" === "Platform:gcp" always failed, filtering out all regressions.

Fix

The updated matching logic compares each regression variant against the filter value using both the full variant string and the parsed name. This correctly handles:

  • Full Key:Value filter values from autocomplete (e.g. Platform:gcp)
  • Simple filter values from default filters (e.g. never-stable, aggregated)
  • Negated filters (e.g. not aggregated)
  • Case-insensitive matching

Test plan

  • Unit tests for filterRegressionsByVariants covering positive, negated, combined, case-insensitive, and null-variant scenarios
  • make test passes (29/29 Jest + Go tests)
  • make e2e passes (120/120 tests, 1 skipped)
  • Manual: Navigate to Test Analysis for a test with regressions, add a Platform:gcp variant filter, and confirm regressions are filtered (not empty)

Always review AI generated responses prior to use.
Generated with Claude Code via openshift-developer plugin


Generated with Claude Code

The client-side variant filtering in TestRegressionsTable compared
filter values (e.g. "Platform:gcp" from autocomplete) against only
the parsed value part of regression variants (e.g. "gcp" from
"Platform:gcp"). This mismatch caused all regressions to disappear
when any variant filter was applied.

The fix compares each regression variant against the filter value
using both the full variant string and the parsed name, so both
"Platform:gcp" (autocomplete) and "never-stable" (default filters)
match correctly.

Extracts the filtering logic into a testable exported function and
adds unit tests covering positive, negated, combined, and
case-insensitive filter scenarios.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants