Skip to content

NETOBSERV-2689: Update PF5 tests#1459

Open
Amoghrd wants to merge 6 commits into
netobserv:main-pf5from
Amoghrd:update-pf5-tests
Open

NETOBSERV-2689: Update PF5 tests#1459
Amoghrd wants to merge 6 commits into
netobserv:main-pf5from
Amoghrd:update-pf5-tests

Conversation

@Amoghrd
Copy link
Copy Markdown
Member

@Amoghrd Amoghrd commented Apr 27, 2026

Description

Dependencies

PF5 cluster(e.g. OCP 4.18)

Checklist

  • Does the changes in PR need specific configuration or environment set up for testing?
    • if so please describe it in PR description.
  • I have added thorough unit tests for the change.
  • QE requirements (check 1 from the list):
    • Standard QE validation, with pre-merge tests unless stated otherwise.
    • Regression tests only (e.g. refactoring with no user-facing change).
    • No QE (e.g. trivial change with high reviewer's confidence, or per agreement with the QE team).

Test Results:

  Spec                                              Tests  Passing  Failing  Pending  Skipped                                                                                                               
┌────────────────────────────────────────────────────────────────────────────────────────────────┐                                                                                                             
│ ✖  client_performance.cy.ts                 01:24        3        1        2        -        - │
├────────────────────────────────────────────────────────────────────────────────────────────────┤                                                                                                             
│ ✔  dns_dashboards.cy.ts                     02:30        2        2        -        -        - │                                                                                                             
├────────────────────────────────────────────────────────────────────────────────────────────────┤                                                                                                             
│ ✔  dns_tracking.cy.ts                       02:03        2        2        -        -        - │                                                                                                             
├────────────────────────────────────────────────────────────────────────────────────────────────┤                                                                                                             
│ ✔  flowRTT.cy.ts                            02:05        2        2        -        -        - │                                                                                                             
├────────────────────────────────────────────────────────────────────────────────────────────────┤                                                                                                             
│ ✔  flowRTT_dashboards.cy.ts                 02:15        2        2        -        -        - │                                                                                                             
├────────────────────────────────────────────────────────────────────────────────────────────────┤                                                                                                             
│ ✔  flow_dashboards_bytes.cy.ts              02:07        1        1        -        -        - │                                                                                                             
├────────────────────────────────────────────────────────────────────────────────────────────────┤                                                                                                             
│ ✔  flow_dashboards_packets.cy.ts            02:11        1        1        -        -        - │                                                                                                             
├────────────────────────────────────────────────────────────────────────────────────────────────┤                                                                                                             
│ ✔  health_dashboards.cy.ts                  02:52        1        1        -        -        - │                                                                                                             
├────────────────────────────────────────────────────────────────────────────────────────────────┤                                                                                                             
│ ✔  ingress_dashboard.cy.ts                  01:02        1        1        -        -        - │                                                                                                             
├────────────────────────────────────────────────────────────────────────────────────────────────┤                                                                                                             
│ ✔  netflow_cluster_admin_group.cy.ts         34ms        2        -        -        2        - │                                                                                                             
├────────────────────────────────────────────────────────────────────────────────────────────────┤                                                                                                             
│ ✔  netflow_conversations.cy.ts              02:28        2        2        -        -        - │                                                                                                             
├────────────────────────────────────────────────────────────────────────────────────────────────┤                                                                                                             
│ ✔  netflow_developer_view.cy.ts              56ms        2        -        -        2        - │                                                                                                             
├────────────────────────────────────────────────────────────────────────────────────────────────┤                                                                                                             
│ ✔  netflow_export.cy.ts                     04:38        3        3        -        -        - │                                                                                                             
├────────────────────────────────────────────────────────────────────────────────────────────────┤                                                                                                             
│ ✔  netflow_external_subnet.cy.ts            02:49        1        1        -        -        - │                                                                                                             
├────────────────────────────────────────────────────────────────────────────────────────────────┤                                                                                                             
│ ✔  netflow_table.cy.ts                      03:20        5        5        -        -        - │                                                                                                             
├────────────────────────────────────────────────────────────────────────────────────────────────┤                                                                                                             
│ ✔  netflow_zone_multiCluster.cy.ts          02:25        2        2        -        -        - │                                                                                                             
├────────────────────────────────────────────────────────────────────────────────────────────────┤                                                                                                             
│ ✔  netobserv_udn.cy.ts                      02:47        2        2        -        -        - │                                                                                                             
├────────────────────────────────────────────────────────────────────────────────────────────────┤                                                                                                             
│ ✖  network_health.cy.ts                     04:11        3        1        2        -        - │                                                                                                             
├────────────────────────────────────────────────────────────────────────────────────────────────┤                                                                                                             
│ ✔  overview_page.cy.ts                      02:32        3        3        -        -        - │                                                                                                             
├────────────────────────────────────────────────────────────────────────────────────────────────┤                                                                                                             
│ ✔  ovn_dashboard.cy.ts                      01:01        1        1        -        -        - │                                                                                                             
├────────────────────────────────────────────────────────────────────────────────────────────────┤                                                                                                             
│ ✖  packet_drop.cy.ts                        01:26        2        -        1        -        1 │                                                                                                             
├────────────────────────────────────────────────────────────────────────────────────────────────┤                                                                                                             
│ ✔  packet_drop_dashboards.cy.ts             02:06        2        2        -        -        - │
├────────────────────────────────────────────────────────────────────────────────────────────────┤                                                                                                             
│ ✔  prom_datasource_only.cy.ts               01:44        1        1        -        -        - │                                                                                                             
├────────────────────────────────────────────────────────────────────────────────────────────────┤                                                                                                             
│ ✔  quickFilters.cy.ts                       03:35        2        2        -        -        - │                                                                                                             
├────────────────────────────────────────────────────────────────────────────────────────────────┤
│ ✔  static_plugin.cy.ts                      03:43        1        1        -        -        - │                                                                                                             
├────────────────────────────────────────────────────────────────────────────────────────────────┤                                                                                                             
│ ✔  table_queryopts.cy.ts                    02:00        3        3        -        -        - │                                                                                                             
├────────────────────────────────────────────────────────────────────────────────────────────────┤                                                                                                             
│ ✖  topology_edges_labels.cy.ts              03:12        5        2        3        -        - │                                                                                                             
├────────────────────────────────────────────────────────────────────────────────────────────────┤                                                                                                             
│ ✔  topology_groups.cy.ts                    02:46        8        8        -        -        - │                                                                                                             
├────────────────────────────────────────────────────────────────────────────────────────────────┤
│ ✔  topology_view.cy.ts                      01:25        3        3        -        -        - │                                                                                                             
├────────────────────────────────────────────────────────────────────────────────────────────────┤
│ ✔  workloads.cy.ts                          01:25        1        1        -        -        - │                                                                                                             
└────────────────────────────────────────────────────────────────────────────────────────────────┘
  ✖  4 of 30 failed (13%)                   1:08:14       69       56        8        4        1                                                                                                               

Failing tests passed on rerun

Jenkins runs:

Summary by CodeRabbit

  • Tests

    • Enhanced test stability through improved UI selectors and interaction patterns, reducing flaky test failures.
    • Updated Gateway API test infrastructure with improved fixture setup and traffic generation.
    • Standardized test cleanup hooks for consistency across test suites.
  • Chores

    • Added test identifiers to UI components for improved test targeting.

@openshift-ci-robot
Copy link
Copy Markdown
Collaborator

openshift-ci-robot commented Apr 27, 2026

@Amoghrd: This pull request references NETOBSERV-2689 which is a valid jira issue.

Details

In response to this:

Description

  • Update PF5 tests to not use brittle selectors.
  • Also move/reorder funcs

Dependencies

PF5 cluster(e.g. OCP 4.18)

Checklist

  • Does the changes in PR need specific configuration or environment set up for testing?
    • if so please describe it in PR description.
  • I have added thorough unit tests for the change.
  • QE requirements (check 1 from the list):
  • Standard QE validation, with pre-merge tests unless stated otherwise.
  • Regression tests only (e.g. refactoring with no user-facing change).
  • No QE (e.g. trivial change with high reviewer's confidence, or per agreement with the QE team).

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 27, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 88f22320-bc27-470a-9990-f469d527e95c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: updating PF5 tests with improved selectors. It is specific and directly relevant to the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed PR description covers objectives, dependencies, and QE requirements but lacks thorough detail on specific test updates and refactoring scope.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Amoghrd Amoghrd changed the title NETOBSERV-2689: Update PF5 tests similar to main NETOBSERV-2689: Update PF5 tests Apr 27, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 9

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (4)
web/src/components/metrics/histogram.tsx (1)

268-275: ⚠️ Potential issue | 🟠 Major

Add ARIA labels to icon-only histogram controls.

These buttons are icon-only; they need explicit accessible names. Tooltips alone are not sufficient for screen-reader labeling.

Proposed fix
             <Button
               data-test="histogram-double-left"
+              aria-label={t('Shift histogram range left')}
               icon={<AngleDoubleLeftIcon />}
               variant="plain"
               className={`metrics-content-button ${loading ? 'loading' : ''}`}
               onClick={() => moveRange(false)}
               ref={arrowRef}
             />
@@
             <Button
               data-test="histogram-single-left"
+              aria-label={t('Page histogram range left')}
               icon={<AngleLeftIcon />}
               variant="plain"
               className={`metrics-content-button ${loading ? 'loading' : ''}`}
               onClick={() => moveHistogramRange(false)}
               ref={pageRef}
             />
@@
             <Button
               data-test="histogram-single-right"
+              aria-label={t('Page histogram range right')}
               icon={<AngleRightIcon />}
               variant="plain"
               className={`metrics-content-button ${loading ? 'loading' : ''}`}
               onClick={() => moveHistogramRange(true)}
             />
@@
             <Button
               data-test="histogram-double-right"
+              aria-label={t('Shift histogram range right')}
               icon={<AngleDoubleRightIcon />}
               variant="plain"
               className={`metrics-content-button ${loading ? 'loading' : ''}`}
               onClick={() => moveRange(true)}
             />
@@
                 <Button
                   data-test="histogram-zoom-out"
+                  aria-label={t('Zoom out histogram')}
                   icon={<SearchMinusIcon />}
                   variant="plain"
                   className={`metrics-content-button ${loading ? 'loading' : ''}`}
                   onClick={() => zoomRange(false)}
                   ref={zoomRef}
                 />
@@
                 <Button
                   data-test="histogram-zoom-in"
+                  aria-label={t('Zoom in histogram')}
                   icon={<SearchPlusIcon />}
                   variant="plain"
                   className={`metrics-content-button ${loading ? 'loading' : ''}`}
                   onClick={() => zoomRange(true)}
                 />

As per coding guidelines, "Implement accessibility with ARIA labels and keyboard navigation in React components".

Also applies to: 282-289, 301-307, 314-320, 331-338, 347-353

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/src/components/metrics/histogram.tsx` around lines 268 - 275, The
icon-only Buttons in histogram.tsx lack accessible names; add explicit
aria-label attributes to each icon-only control (for example the Buttons with
data-test="histogram-double-left", "histogram-left", "histogram-right",
"histogram-double-right" and any other arrow/zoom Buttons) that describe the
action (e.g., "Move range to start", "Move range left", "Move range right",
"Move range to end"); keep the existing tooltip and className/refs/onClick
(e.g., moveRange, arrowRef, loading) unchanged and ensure the aria-label is a
clear, concise verb phrase so screen readers can announce the control.
web/cypress/integration-tests/table_queryopts.cy.ts (1)

46-69: ⚠️ Potential issue | 🟡 Minor

Don't rely on parseFloat for compact counts.

parseFloat() only reads the leading numeric prefix, so values like 1.5k or 1,234 collapse to the wrong number. If these summary metrics can render compact or localized formatting, this assertion stops validating the real count.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/cypress/integration-tests/table_queryopts.cy.ts` around lines 46 - 69,
The test is using parseFloat on the summary metric texts (in the it block that
checks query summary panel) which fails for compact/localized formats like
"1.5k" or "1,234"; add a small parsing helper (e.g., parseCompactCount) that
normalizes strings by removing thousands separators, handling suffixes like k/K,
m/M, g/G (multiplying accordingly) and trimming plus signs, then use that helper
in place of parseFloat when reading querySumSelectors.flowsCount,
querySumSelectors.bytesCount and querySumSelectors.packetsCount so the
assertions compare the true numeric values.
web/cypress/integration-tests/netflow_zone_multiCluster.cy.ts (1)

23-25: ⚠️ Potential issue | 🟠 Major

Register the intercept before the scope change.

topologyPage.selectScopeGroup("resource", "owners") already runs in beforeEach, so this cy.intercept(...) is added after the request has gone out. The fixture will miss the call you are trying to stub.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/cypress/integration-tests/netflow_zone_multiCluster.cy.ts` around lines
23 - 25, The intercept for the network call must be registered before the scope
change so the fixture can stub the request; move the cy.intercept(...) that
stubs the topology request into the setup that runs before
topologyPage.selectScopeGroup("resource", "owners") (e.g. the beforeEach or
immediately before calling selectScopeGroup), ensuring the stub is active before
the request fires; keep references to cy.intercept,
topologyPage.selectScopeGroup("resource","owners"), and
cy.openColumnsModal()/colSelectors.columnsModal so you can locate and update the
test code.
web/cypress/views/netobserv.ts (1)

122-135: ⚠️ Potential issue | 🟠 Major

Fail fast when the FlowCollector link is missing.

The new if (href) guard turns a broken selector into a silent no-op, so the test can keep running on the wrong page. Assert the link exists before visiting it.

Suggested fix
-        cy.get(selector).invoke('attr', 'href').then(href => {
-            if (href) {
-                cy.visit(href)
-            }
-        })
+        cy.get(selector)
+            .should('have.attr', 'href')
+            .invoke('attr', 'href')
+            .then(href => cy.visit(href))
@@
-        cy.contains('Flow Collector').invoke('attr', 'href').then(href => {
-            if (href) {
-                cy.visit(href)
-            }
-        })
+        cy.contains('Flow Collector')
+            .should('have.attr', 'href')
+            .invoke('attr', 'href')
+            .then(href => cy.visit(href))
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/cypress/views/netobserv.ts` around lines 122 - 135, In visitFlowcollector
replace the silent guards that check `if (href)` with explicit assertions so the
test fails fast when links are missing: for the operator row (`selector` built
from Operator.name()) and the 'Flow Collector' cy.contains(...) call, assert the
element has an 'href' (or that the element exists) before calling cy.visit with
that href; remove the conditional no-op logic and use a cy.should/assert to fail
the test when the link is absent.
🧹 Nitpick comments (2)
web/src/components/tabs/netflow-overview/netflow-overview-panel.tsx (1)

63-63: Make the data-test selector resilient to missing id.

id is optional, so this can render netflow-overview-focus-undefined and create duplicate selectors across panels. Either require id when focusOn is used, or add a guaranteed-unique fallback.

Suggested adjustment
 export interface NetflowOverviewPanelProps {
   doubleWidth: boolean;
   bodyClassName: string;
   title: string;
   titleTooltip?: string;
   kebab?: JSX.Element;
   onClick?: () => void;
-  focusOn?: (id?: string) => void;
+  focusOn?: (id: string) => void;
   isSelected?: boolean;
   isFocus?: boolean;
-  id?: string;
+  id: string;
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/src/components/tabs/netflow-overview/netflow-overview-panel.tsx` at line
63, The data-test attribute on NetflowOverviewPanel currently uses the optional
prop id and can render "netflow-overview-focus-undefined", causing duplicate
selectors; update the JSX that sets data-test (the attribute currently written
as data-test={`netflow-overview-focus-${id}`}) to use a guaranteed unique
fallback when id is missing (for example id ?? a stable fallback such as
React.useId(), a passed panelIndex prop, or derived string from focusOn) so the
selector never contains "undefined" and remains unique across panels.
web/cypress/integration-tests/quickFilters.cy.ts (1)

50-63: Drop the remaining container-id dependency.

The checkbox interaction is better than the old class selector, but #quick-filters-dropdown and parent() still tie the test to the current DOM structure. Use the label itself as the anchor for both toggle actions.

Proposed selector cleanup
-        cy.get('#quick-filters-dropdown').contains("Test NS")
-        cy.contains("Test NS").parent().find('input[type="checkbox"]').should('exist').click()
+        cy.contains('label', 'Test NS').find('input[type="checkbox"]').should('exist').click()
...
-        cy.contains("Test NS").parent().find('input[type="checkbox"]').should('exist').click()
+        cy.contains('label', 'Test NS').find('input[type="checkbox"]').should('exist').click()

As per coding guidelines: Verify E2E test stability, proper waits, and selector resilience.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/cypress/integration-tests/quickFilters.cy.ts` around lines 50 - 63, The
test is brittle because it relies on '#quick-filters-dropdown' and parent() DOM
traversal; instead anchor interactions to the visible label text ("Test NS") and
the "Quick filters" trigger so the checkbox toggle doesn't depend on container
structure. Replace uses of '#quick-filters-dropdown' and .parent() with a
label-based lookup anchored on the "Test NS" text (e.g., locate the label
containing "Test NS" and operate on the input within it) for both checking and
unchecking, ensure the "Quick filters" button is visible before clicking, and
keep the final assertion that the filters element is removed (currently
'#filters') but validate visibility/absence with a stable assertion.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@web/cypress/fixtures/gateway-api.yaml`:
- Around line 118-121: The curl loop in the traffic generator (the while true
... curl -s ... sleep 5 loop) never sets the Host header so requests won't match
the Gateway/HTTPRoute; update the curl invocation inside that loop to include
the Host header for gwapi.example.com (use curl's -H "Host: gwapi.example.com")
so the request hostname matches the Gateway and routes to echo-service.

In `@web/cypress/integration-tests/netflow_export.cy.ts`:
- Around line 42-53: After clicking the export button
(cy.byTestID('export-button') inside the export-modal) replace the raw
cy.exec("ls cypress/downloads") + immediate mv with a polling/assertion that
waits for the CSV to appear (e.g., loop or use Cypress retryable commands such
as cy.readFile or a wait-until helper) and assert there is exactly one matching
download before attempting to rename it; specifically update the block that
calls cy.exec("ls cypress/downloads", { timeout: 10000 }).then(...) and the
subsequent cy.exec(`mv ...`) so it first waits for the expected file path to
exist (and is unique) and only then performs the rename and readFile, and
finally clean up the file with the existing rm call.

In `@web/cypress/integration-tests/topology_edges_labels.cy.ts`:
- Around line 23-25: Move the cy.intercept call so it runs before the scope
selection occurs: place the intercept for
topologyPage.getTopologyResourceScopeGroupURL('owners') ahead of the call to
topologyPage.selectScopeGroup("resource", "owners") (which executes in
beforeEach), ensuring cy.intercept(...) is registered before the owners request
is sent so the fixture (flowmetrics/Owners.json) is used instead of live data.

In `@web/cypress/support/commands.ts`:
- Around line 332-346: The cliLogin command silently allows auth failures and
exposes credentials: validate required envs (KUBECONFIG_PATH, LOGIN_USERNAME,
LOGIN_PASSWORD) at the start of Cypress.Commands.add("cliLogin"); stop using
failOnNonZeroExit: false on the oc login cy.exec call so failures surface (or
explicitly check loginresult.code and throw/cy.log + throw on non-zero); avoid
embedding loginPassword directly into the command string (e.g., use a secure
input mechanism or pass the password via stdin/environment to oc, and do not log
raw stdout/stderr that may contain secrets), and replace the current
cy.log(loginresult.stderr|stdout) usage with masked/conditional logging or an
error throw when login fails; reference these symbols: cliLogin, kubeconfig,
loginUsername, loginPassword, cy.exec, loginresult.

In `@web/cypress/views/list-page.ts`:
- Around line 61-65: The selector is flaky because it uses index-based selection
and a global contains: instead of
cy.get('[data-ouia-component-id="DataViewFilters"]').within(() =>
cy.get('button').first().click()) and cy.contains('li', 'Name').click(), scope
the click to the specific filter dropdown element (e.g., target the button that
opens the Name filter by a more specific selector or add a dedicated data hook)
and then search for the "Name" list item only inside the opened dropdown
container (or the menu element with aria attributes) before clicking; update the
helper that contains these steps in list-page.ts to remove .first() and the
global cy.contains and replace them with scoped selectors or a dedicated
data-ouia/data-test hook for the dropdown and its "Name" item.

In `@web/cypress/views/netflow-page.ts`:
- Around line 87-89: The CSS selector used in the Cypress.$ check is malformed
(missing the closing quote/bracket for the transform attribute) in
web/cypress/views/netflow-page.ts; update the selector inside the Cypress.$(...)
call to include the missing quote and closing bracket so it reads something like
[data-surface=true][transform="translate(0, 0) scale(1)"] and keep the rest of
the conditional logic (the cy.get(...).click()) unchanged.

In `@web/cypress/views/netobserv-logo.ts`:
- Around line 11-20: The current test captures a static snapshot by filtering
$nodes inside the .then() callback (nodesWithSvg), which prevents Cypress'
automatic retry from waiting for child <svg> elements; replace that pattern with
a fully retryable selector chain: call cy.get with the same parent selector
(`g[data-id*="o=${resourceType}.${resourceName}"]`) and then use .find('svg')
(or a combined selector `g[data-id*="o=${resourceType}.${resourceName}"] svg`)
and assert on the returned collection with .should('have.length.greaterThan', 0)
and .first().should('be.visible') so the lookup for SVGs is retried instead of
filtered from a static snapshot (update usages of nodesWithSvg and the .then()
block accordingly).

In `@web/cypress/views/netobserv.ts`:
- Around line 260-262: The cy.exec call is interpolating the kubeconfig path
unquoted (kubeconfig variable) which is unsafe for paths with spaces and risks
shell injection; update the invocation around cy.exec(`oc get sc --kubeconfig
${kubeconfig}`) to quote the path by using JSON.stringify(kubeconfig) (or an
equivalent shell-safe quoting) when building the command string so the
kubeconfig value is safely passed to the shell.

In `@web/cypress/views/network-health.ts`:
- Around line 17-25: The close click on the health card should also use a forced
click to avoid intermittent failures when the side panel overlaps the card;
update the second click on the button returned by
cy.get(`[data-test^="health-card-${name}"]`).eq(0).find('button') to include {
force: true } so the code that checks networkHealthSelectors.sidePanel no longer
flakes—keep the initial forced click and add the same forced option to the
closing click, preserving the surrounding visibility/assertion checks for mode
and alertText.

---

Outside diff comments:
In `@web/cypress/integration-tests/netflow_zone_multiCluster.cy.ts`:
- Around line 23-25: The intercept for the network call must be registered
before the scope change so the fixture can stub the request; move the
cy.intercept(...) that stubs the topology request into the setup that runs
before topologyPage.selectScopeGroup("resource", "owners") (e.g. the beforeEach
or immediately before calling selectScopeGroup), ensuring the stub is active
before the request fires; keep references to cy.intercept,
topologyPage.selectScopeGroup("resource","owners"), and
cy.openColumnsModal()/colSelectors.columnsModal so you can locate and update the
test code.

In `@web/cypress/integration-tests/table_queryopts.cy.ts`:
- Around line 46-69: The test is using parseFloat on the summary metric texts
(in the it block that checks query summary panel) which fails for
compact/localized formats like "1.5k" or "1,234"; add a small parsing helper
(e.g., parseCompactCount) that normalizes strings by removing thousands
separators, handling suffixes like k/K, m/M, g/G (multiplying accordingly) and
trimming plus signs, then use that helper in place of parseFloat when reading
querySumSelectors.flowsCount, querySumSelectors.bytesCount and
querySumSelectors.packetsCount so the assertions compare the true numeric
values.

In `@web/cypress/views/netobserv.ts`:
- Around line 122-135: In visitFlowcollector replace the silent guards that
check `if (href)` with explicit assertions so the test fails fast when links are
missing: for the operator row (`selector` built from Operator.name()) and the
'Flow Collector' cy.contains(...) call, assert the element has an 'href' (or
that the element exists) before calling cy.visit with that href; remove the
conditional no-op logic and use a cy.should/assert to fail the test when the
link is absent.

In `@web/src/components/metrics/histogram.tsx`:
- Around line 268-275: The icon-only Buttons in histogram.tsx lack accessible
names; add explicit aria-label attributes to each icon-only control (for example
the Buttons with data-test="histogram-double-left", "histogram-left",
"histogram-right", "histogram-double-right" and any other arrow/zoom Buttons)
that describe the action (e.g., "Move range to start", "Move range left", "Move
range right", "Move range to end"); keep the existing tooltip and
className/refs/onClick (e.g., moveRange, arrowRef, loading) unchanged and ensure
the aria-label is a clear, concise verb phrase so screen readers can announce
the control.

---

Nitpick comments:
In `@web/cypress/integration-tests/quickFilters.cy.ts`:
- Around line 50-63: The test is brittle because it relies on
'#quick-filters-dropdown' and parent() DOM traversal; instead anchor
interactions to the visible label text ("Test NS") and the "Quick filters"
trigger so the checkbox toggle doesn't depend on container structure. Replace
uses of '#quick-filters-dropdown' and .parent() with a label-based lookup
anchored on the "Test NS" text (e.g., locate the label containing "Test NS" and
operate on the input within it) for both checking and unchecking, ensure the
"Quick filters" button is visible before clicking, and keep the final assertion
that the filters element is removed (currently '#filters') but validate
visibility/absence with a stable assertion.

In `@web/src/components/tabs/netflow-overview/netflow-overview-panel.tsx`:
- Line 63: The data-test attribute on NetflowOverviewPanel currently uses the
optional prop id and can render "netflow-overview-focus-undefined", causing
duplicate selectors; update the JSX that sets data-test (the attribute currently
written as data-test={`netflow-overview-focus-${id}`}) to use a guaranteed
unique fallback when id is missing (for example id ?? a stable fallback such as
React.useId(), a passed panelIndex prop, or derived string from focusOn) so the
selector never contains "undefined" and remains unique across panels.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: dd609d2c-497c-47f9-9362-be79cd658ede

📥 Commits

Reviewing files that changed from the base of the PR and between acc8a6f and 5c1af34.

📒 Files selected for processing (56)
  • web/cypress/fixtures/gateway-api-template.yaml
  • web/cypress/fixtures/gateway-api.yaml
  • web/cypress/integration-tests/client_performance.cy.ts
  • web/cypress/integration-tests/dns_dashboards.cy.ts
  • web/cypress/integration-tests/dns_tracking.cy.ts
  • web/cypress/integration-tests/flowRTT.cy.ts
  • web/cypress/integration-tests/flowRTT_dashboards.cy.ts
  • web/cypress/integration-tests/flow_dashboards_bytes.cy.ts
  • web/cypress/integration-tests/flow_dashboards_packets.cy.ts
  • web/cypress/integration-tests/gateway_topology_logo.cy.ts
  • web/cypress/integration-tests/health_dashboards.cy.ts
  • web/cypress/integration-tests/ingress_dashboard.cy.ts
  • web/cypress/integration-tests/netflow_conversations.cy.ts
  • web/cypress/integration-tests/netflow_developer_view.cy.ts
  • web/cypress/integration-tests/netflow_export.cy.ts
  • web/cypress/integration-tests/netflow_external_subnet.cy.ts
  • web/cypress/integration-tests/netflow_table.cy.ts
  • web/cypress/integration-tests/netflow_zone_multiCluster.cy.ts
  • web/cypress/integration-tests/netobserv_udn.cy.ts
  • web/cypress/integration-tests/network_health.cy.ts
  • web/cypress/integration-tests/overview_page.cy.ts
  • web/cypress/integration-tests/packet_drop.cy.ts
  • web/cypress/integration-tests/packet_drop_dashboards.cy.ts
  • web/cypress/integration-tests/prom_datasource_only.cy.ts
  • web/cypress/integration-tests/quickFilters.cy.ts
  • web/cypress/integration-tests/static_plugin.cy.ts
  • web/cypress/integration-tests/table_queryopts.cy.ts
  • web/cypress/integration-tests/topology_edges_labels.cy.ts
  • web/cypress/integration-tests/topology_groups.cy.ts
  • web/cypress/integration-tests/topology_view.cy.ts
  • web/cypress/integration-tests/workloads.cy.ts
  • web/cypress/support/commands.ts
  • web/cypress/views/dashboards-page.ts
  • web/cypress/views/list-page.ts
  • web/cypress/views/netflow-page.ts
  • web/cypress/views/netobserv-logo.ts
  • web/cypress/views/netobserv.ts
  • web/cypress/views/network-health.ts
  • web/cypress/views/operator-hub-page.ts
  • web/cypress/views/pages.ts
  • web/cypress/views/yaml-editor.ts
  • web/src/components/drawer/record/record-panel.tsx
  • web/src/components/forms/consumption.tsx
  • web/src/components/forms/dynamic-form/dynamic-form.tsx
  • web/src/components/forms/dynamic-form/fields.tsx
  • web/src/components/forms/dynamic-form/templates.tsx
  • web/src/components/forms/dynamic-form/widgets.tsx
  • web/src/components/forms/flowCollector-status.tsx
  • web/src/components/forms/flowCollector-wizard.tsx
  • web/src/components/health/health-card.tsx
  • web/src/components/health/health-drawer-container.tsx
  • web/src/components/health/rule-details.tsx
  • web/src/components/messages/error.tsx
  • web/src/components/metrics/histogram.tsx
  • web/src/components/query-summary/summary-panel-content.tsx
  • web/src/components/tabs/netflow-overview/netflow-overview-panel.tsx
💤 Files with no reviewable changes (1)
  • web/cypress/fixtures/gateway-api-template.yaml

Comment thread web/cypress/fixtures/gateway-api.yaml
Comment thread web/cypress/integration-tests/netflow_export.cy.ts Outdated
Comment thread web/cypress/integration-tests/topology_edges_labels.cy.ts Outdated
Comment thread web/cypress/support/commands.ts
Comment thread web/cypress/views/list-page.ts Outdated
Comment thread web/cypress/views/netflow-page.ts Outdated
Comment thread web/cypress/views/netobserv-logo.ts Outdated
Comment thread web/cypress/views/netobserv.ts Outdated
Comment thread web/cypress/views/network-health.ts Outdated
@Amoghrd
Copy link
Copy Markdown
Member Author

Amoghrd commented Apr 27, 2026

/ok-to-test

@openshift-ci openshift-ci Bot added the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Apr 27, 2026
@github-actions
Copy link
Copy Markdown

New image:

quay.io/netobserv/network-observability-console-plugin:a3a0b2c

It will expire in two weeks.

To deploy this build, run from the operator repo, assuming the operator is running:

USER=netobserv VERSION=a3a0b2c make set-plugin-image

@github-actions github-actions Bot removed the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Apr 27, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.53%. Comparing base (acc8a6f) to head (852f526).
⚠️ Report is 3 commits behind head on main-pf5.

Additional details and impacted files
@@            Coverage Diff            @@
##           main-pf5    #1459   +/-   ##
=========================================
  Coverage     52.53%   52.53%           
=========================================
  Files           232      232           
  Lines         12355    12355           
  Branches       1551     1551           
=========================================
  Hits           6491     6491           
  Misses         5269     5269           
  Partials        595      595           
Flag Coverage Δ
uitests 56.74% <ø> (ø)
unittests 40.96% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
web/src/components/drawer/record/record-panel.tsx 45.80% <ø> (ø)
web/src/components/health/health-card.tsx 24.32% <ø> (ø)
web/src/components/health/rule-details.tsx 33.33% <ø> (ø)
web/src/components/messages/error.tsx 23.37% <ø> (ø)
web/src/components/metrics/histogram.tsx 16.51% <ø> (ø)
...components/query-summary/summary-panel-content.tsx 61.83% <ø> (ø)
...s/tabs/netflow-overview/netflow-overview-panel.tsx 88.88% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Amoghrd
Copy link
Copy Markdown
Member Author

Amoghrd commented Apr 28, 2026

/ok-to-test

@openshift-ci openshift-ci Bot added the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Apr 28, 2026
@github-actions github-actions Bot removed the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Apr 28, 2026
@Amoghrd
Copy link
Copy Markdown
Member Author

Amoghrd commented Apr 28, 2026

/ok-to-test

@openshift-ci openshift-ci Bot added the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Apr 28, 2026
@github-actions
Copy link
Copy Markdown

New image:

quay.io/netobserv/network-observability-console-plugin:6f2ca64

It will expire in two weeks.

To deploy this build, run from the operator repo, assuming the operator is running:

USER=netobserv VERSION=6f2ca64 make set-plugin-image

@github-actions github-actions Bot removed the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Apr 28, 2026
@Amoghrd Amoghrd force-pushed the update-pf5-tests branch 3 times, most recently from a5c0328 to 1f0ea90 Compare April 28, 2026 21:40
@Amoghrd Amoghrd requested review from jpinsonneau and memodi April 28, 2026 21:40
@Amoghrd Amoghrd added the needs-review Tells that the PR needs a review label Apr 28, 2026
Amoghrd added a commit to Amoghrd/netobserv-web-console that referenced this pull request Apr 29, 2026
- Remove duplicate cliLogin command registration in commands.ts
- Add .clear() before .type() in network_health.cy.ts to prevent flakes
- Fix topology selector in client_performance.cy.ts
- Update memory and load time thresholds to match PR netobserv#1459

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@Amoghrd Amoghrd force-pushed the update-pf5-tests branch 3 times, most recently from 6d5ee02 to afbdca3 Compare April 30, 2026 13:50
@Amoghrd
Copy link
Copy Markdown
Member Author

Amoghrd commented May 8, 2026

/ok-to-test

@openshift-ci openshift-ci Bot added the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label May 8, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

New image:

quay.io/netobserv/network-observability-console-plugin:aee6db2

It will expire in two weeks.

To deploy this build, run from the operator repo, assuming the operator is running:

USER=netobserv VERSION=aee6db2 make set-plugin-image

@Amoghrd Amoghrd force-pushed the update-pf5-tests branch from 1267da4 to 0446e9c Compare May 8, 2026 15:20
@github-actions github-actions Bot removed the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label May 8, 2026
@Amoghrd Amoghrd force-pushed the update-pf5-tests branch from 0446e9c to b0d4f1d Compare May 8, 2026 15:26
@memodi
Copy link
Copy Markdown
Member

memodi commented May 8, 2026

@Amoghrd - I can't see the diff for commit b0d4f1d because of force push, but when I was working on migration I had code generated by claude so that we can manage selectors compatibility and test selection dynamically for different ocp versions . I didn't commit this since we adopted different branch strategy but by looking at the commit message of b0d4f1d, I wonder, if it would be something that will help to what you're trying to do in that commit?

@Amoghrd
Copy link
Copy Markdown
Member Author

Amoghrd commented May 8, 2026

I reverted it.
The code we have now in main cy.contains('label', 'Refresh interval').parent().siblings().find('button').first().click() is working as expected on 4.20
UPDATE: seems like there is a selector mismatch on 4.18, using an if condition for the same

@Amoghrd Amoghrd force-pushed the update-pf5-tests branch from b0d4f1d to 2f0ddd4 Compare May 8, 2026 17:14
@Amoghrd Amoghrd force-pushed the update-pf5-tests branch from 2f0ddd4 to b024a84 Compare May 8, 2026 18:44
@Amoghrd
Copy link
Copy Markdown
Member Author

Amoghrd commented May 8, 2026

4.20 jenkins run: noo-frontend-tests#61 -> Quick filters is flaky due to usage of client server template. Converting that to basic YAML and also moving the deployment post flowcollector install. It passed locally. Will verify it jenkins on other OCP versions.
Jenkins runs on 4.21, 4.19-4.17 are still in progress. Will update here once they complete

@Amoghrd
Copy link
Copy Markdown
Member Author

Amoghrd commented May 8, 2026

/hold

@Amoghrd Amoghrd force-pushed the update-pf5-tests branch from d38d473 to 6e7598e Compare May 8, 2026 23:10
jpinsonneau
jpinsonneau previously approved these changes May 11, 2026
@memodi
Copy link
Copy Markdown
Member

memodi commented May 11, 2026

@Amoghrd did you mean to put hold on this PR? I don't think this repo recognizes that label :)

@Amoghrd
Copy link
Copy Markdown
Member Author

Amoghrd commented May 11, 2026

Yeah, I wanted to hold it. I am looking into a better approach for skipping the tests(gateway, UDN) based on OCP versions.

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 11, 2026

New changes are detected. LGTM label has been removed.

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 11, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from jpinsonneau. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Amoghrd
Copy link
Copy Markdown
Member Author

Amoghrd commented May 11, 2026

Jenkins runs have been pasted in PR description, the failing tests were due to incorrect logic in test skip(UDN, gateway). Fixed the issue and UDN passing and gateway_topology skipped on 4.18
✔ netobserv_udn.cy.ts 02:32 2 2 - - -
✔ gateway_topology_logo.cy.ts 00:30 1 - - 1 -

@Amoghrd
Copy link
Copy Markdown
Member Author

Amoghrd commented May 11, 2026

Imaginary /unhold :P

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

Labels

jira/valid-reference needs-review Tells that the PR needs a review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants