Skip to content

[WIP] OCPBUGS-79355: Fix and enable OLM Package E2E tests disabled during the public/ directory useK8sWatchResource refactoring#16220

Open
cajieh wants to merge 1 commit intoopenshift:mainfrom
cajieh:fix-olm-packages-e2e-tests-skipped-in-firhose-removal
Open

[WIP] OCPBUGS-79355: Fix and enable OLM Package E2E tests disabled during the public/ directory useK8sWatchResource refactoring#16220
cajieh wants to merge 1 commit intoopenshift:mainfrom
cajieh:fix-olm-packages-e2e-tests-skipped-in-firhose-removal

Conversation

@cajieh
Copy link
Copy Markdown
Contributor

@cajieh cajieh commented Mar 30, 2026

…irectory useK8sWatchResource refactoring

Summary by CodeRabbit

  • Bug Fixes

    • Fixed action menu visibility on Operator details pages to properly reflect data load state.
    • Improved rendering of page headings and navigation to correctly wait for data availability before displaying content.
  • Tests

    • Enhanced test reliability with improved timeouts and wait conditions for UI assertions.
    • Re-enabled previously skipped integration tests for operator installation and uninstallation.

@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Mar 30, 2026
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 30, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@cajieh: This pull request references Jira Issue OCPBUGS-79355, which is invalid:

  • expected the bug to target the "4.22.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

…irectory useK8sWatchResource refactoring

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.

@openshift-ci openshift-ci bot requested review from jhadvig and spadgett March 30, 2026 15:32
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Mar 30, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cajieh

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

The pull request process is described 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

@openshift-ci openshift-ci bot added component/core Related to console core functionality component/olm Related to OLM approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/cypress Related to Cypress e2e integration testing labels Mar 30, 2026
@cajieh cajieh changed the title [WIP] OCPBUGS-79355: Fix and re-enable OLM Package E2E tests disabled during the public/ directory useK8sWatchResource refactoring [WIP] OCPBUGS-79355: Fix and enable OLM Package E2E tests disabled during the public/ directory useK8sWatchResource refactoring Mar 30, 2026
@cajieh cajieh force-pushed the fix-olm-packages-e2e-tests-skipped-in-firhose-removal branch from 8c9b484 to 280bce5 Compare March 30, 2026 19:28
@openshift-ci openshift-ci bot added the kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated label Mar 30, 2026
@cajieh cajieh force-pushed the fix-olm-packages-e2e-tests-skipped-in-firhose-removal branch 2 times, most recently from 9215b54 to 807b4ba Compare March 30, 2026 20:01
@cajieh cajieh changed the title [WIP] OCPBUGS-79355: Fix and enable OLM Package E2E tests disabled during the public/ directory useK8sWatchResource refactoring OCPBUGS-79355: Fix and enable OLM Package E2E tests disabled during the public/ directory useK8sWatchResource refactoring Mar 31, 2026
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 31, 2026
@cajieh
Copy link
Copy Markdown
Contributor Author

cajieh commented Mar 31, 2026

/test e2e-gcp-console

@cajieh
Copy link
Copy Markdown
Contributor Author

cajieh commented Mar 31, 2026

/retest

@cajieh cajieh force-pushed the fix-olm-packages-e2e-tests-skipped-in-firhose-removal branch from 807b4ba to 77d38f4 Compare March 31, 2026 01:30
@openshift-ci openshift-ci bot added the component/helm Related to helm-plugin label Mar 31, 2026
@cajieh cajieh changed the title OCPBUGS-79355: Fix and enable OLM Package E2E tests disabled during the public/ directory useK8sWatchResource refactoring [WIP] OCPBUGS-79355: Fix and enable OLM Package E2E tests disabled during the public/ directory useK8sWatchResource refactoring Mar 31, 2026
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 31, 2026
{_.isFunction(customActionMenu)
? customActionMenu(kindObj, data, extraResources)
: customActionMenu}
{hasData &&
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

TODO: Temporary addition for CI testing. To be removed once (#16219) merged.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 31, 2026

📝 Walkthrough

Walkthrough

This changeset re-enables previously skipped integration tests for operator install and uninstall scenarios across three test suites. It enhances test reliability by adding explicit timeout options to Cypress selector commands and wait assertions. Component rendering logic is refined to gate the display of custom action menus and navigation pages on resource load states. Test cleanup procedures are extended to delete operand instances before deleting operator-scoped resources. Mock implementations for Kubernetes watch hooks are updated to report loaded: true by default. Navigation view helpers gain timeout parameters and assertion checks for post-navigation state validation.

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

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

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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@frontend/packages/operator-lifecycle-manager/integration-tests-cypress/views/operator.view.ts`:
- Around line 95-101: The two hardcoded cy.wait(...) sleeps should be replaced
with deterministic readiness assertions: remove the cy.wait(3000) before
cy.byTestOperatorRow(operatorName).click() and instead assert the operator row
is visible and interactable (e.g., .should('be.visible') and
.should('not.have.attr', 'disabled')) before clicking; remove the trailing
cy.wait(2000) and replace it with an assertion that the horizontal nav finished
rendering by checking a stable element such as
cy.byLegacyTestID('horizontal-link-Details').should('be.visible', { timeout:
60000 }) (or other nav tab container visibility) after the
cy.url(...).should('include', 'ClusterServiceVersion') check so navigation
readiness is deterministic.
🪄 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: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 19c05969-1cc0-44a3-b578-2d57649c2758

📥 Commits

Reviewing files that changed from the base of the PR and between 703563f and 77d38f4.

📒 Files selected for processing (10)
  • frontend/packages/helm-plugin/src/components/details-page/__tests__/HelmReleaseDetails.spec.tsx
  • frontend/packages/integration-tests-cypress/support/selectors.ts
  • frontend/packages/operator-lifecycle-manager/integration-tests-cypress/tests/operator-install-global.cy.ts
  • frontend/packages/operator-lifecycle-manager/integration-tests-cypress/tests/operator-install-single-namespace.cy.ts
  • frontend/packages/operator-lifecycle-manager/integration-tests-cypress/tests/operator-uninstall.cy.ts
  • frontend/packages/operator-lifecycle-manager/integration-tests-cypress/views/operator.view.ts
  • frontend/packages/operator-lifecycle-manager/src/components/clusterserviceversion.tsx
  • frontend/public/components/factory/__tests__/details.spec.tsx
  • frontend/public/components/utils/headings.tsx
  • frontend/public/components/utils/horizontal-nav.tsx
📜 Review details
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.

Files:

  • frontend/public/components/factory/__tests__/details.spec.tsx
  • frontend/public/components/utils/horizontal-nav.tsx
  • frontend/packages/operator-lifecycle-manager/src/components/clusterserviceversion.tsx
  • frontend/packages/operator-lifecycle-manager/integration-tests-cypress/tests/operator-install-global.cy.ts
  • frontend/public/components/utils/headings.tsx
  • frontend/packages/operator-lifecycle-manager/integration-tests-cypress/tests/operator-uninstall.cy.ts
  • frontend/packages/helm-plugin/src/components/details-page/__tests__/HelmReleaseDetails.spec.tsx
  • frontend/packages/operator-lifecycle-manager/integration-tests-cypress/tests/operator-install-single-namespace.cy.ts
  • frontend/packages/integration-tests-cypress/support/selectors.ts
  • frontend/packages/operator-lifecycle-manager/integration-tests-cypress/views/operator.view.ts
🔇 Additional comments (11)
frontend/public/components/utils/headings.tsx (1)

150-153: LGTM — Defensive gating on hasData aligns with the component's existing guard pattern.

This mirrors the guards already applied to hasButtonActions and hasMenuActions at lines 134 and 138. The change protects against callers (like operand/index.tsx per the context snippets) that don't null-check obj in their customActionMenu callbacks, preventing runtime errors during the loading phase.

frontend/public/components/utils/horizontal-nav.tsx (1)

331-334: LGTM — Prevents pagesFor callback from receiving undefined data.

The guard ensures props.pagesFor(props.obj.data) isn't invoked until loaded is true. The StatusBox wrapper already handles the loading state visually, and plugin-derived pages remain available immediately since they don't depend on resource data.

frontend/packages/operator-lifecycle-manager/src/components/clusterserviceversion.tsx (1)

1346-1355: LGTM — Guards action menu context against undefined csv.

Passing undefined to customActionMenu when csv isn't loaded prevents the LazyActionMenu from receiving an undefined resource in its context object. This aligns with the hasData gate added in headings.tsx.

frontend/public/components/factory/__tests__/details.spec.tsx (1)

36-36: LGTM — Mock state aligns with updated HorizontalNav guard.

Since HorizontalNav now only derives base pages when props.obj?.loaded is true, the mocks must return loaded: true for the navigation tabs to render. The test assertions verify the expected UI presence correctly.

Also applies to: 71-72

frontend/packages/helm-plugin/src/components/details-page/__tests__/HelmReleaseDetails.spec.tsx (1)

12-17: LGTM — Consistent mock setup with details.spec.tsx.

The mock pattern mirrors frontend/public/components/factory/__tests__/details.spec.tsx, ensuring LoadedHelmReleaseDetails (which uses DetailsPage internally) renders tabs correctly after the HorizontalNav loading guard changes. The beforeEach reset ensures proper test isolation.

Also applies to: 39-41

frontend/packages/integration-tests-cypress/support/selectors.ts (1)

31-38: Good update: selector helpers now support Cypress options end-to-end.

The new optional options typing and pass-through to cy.get(...) are consistent and make timeout-driven assertions in OLM tests much cleaner.

Also applies to: 87-99

frontend/packages/operator-lifecycle-manager/integration-tests-cypress/views/operator.view.ts (2)

103-104: horizontalNavTab timeout parameter is a solid reliability improvement.

Centralizing timeout control in this helper keeps tab navigation assertions consistent across tests.


139-140: Nice guard for create-flow completion.

Waiting for URL to drop ~new after submit makes the operand create path less race-prone.

frontend/packages/operator-lifecycle-manager/integration-tests-cypress/tests/operator-uninstall.cy.ts (1)

25-25: Good re-enable plus timeout hardening.

Reactivating this suite and adding explicit wait budgets for key details-page assertions should reduce flakes while restoring uninstall coverage.

Also applies to: 53-55

frontend/packages/operator-lifecycle-manager/integration-tests-cypress/tests/operator-install-global.cy.ts (1)

22-26: Strong reliability improvements in setup/cleanup and assertions.

Deleting operand instances first, re-enabling the suite, and adding explicit assertion timeouts all move this test toward more stable, repeatable execution.

Also applies to: 41-41, 59-61

frontend/packages/operator-lifecycle-manager/integration-tests-cypress/tests/operator-install-single-namespace.cy.ts (1)

24-28: Nice parity with global-install flow.

This brings single-namespace tests in line with the same cleanup-first and explicit-timeout strategy, which should help reduce intermittent failures.

Also applies to: 43-43, 68-70

Comment on lines +95 to +101
// Wait for operator row to be fully interactive
cy.wait(3000);
cy.byTestOperatorRow(operatorName).click();
cy.url({ timeout: 30000 }).should('include', 'ClusterServiceVersion');
cy.byLegacyTestID('horizontal-link-Details', { timeout: 60000 }).should('exist');
// Extra wait to ensure all horizontal nav tabs render
cy.wait(2000);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify static waits in OLM Cypress flows and their locations.
rg -n --type=ts 'cy\.wait\(\d+\)' \
  frontend/packages/operator-lifecycle-manager/integration-tests-cypress/views/operator.view.ts \
  frontend/packages/operator-lifecycle-manager/integration-tests-cypress/tests/operator-*.cy.ts

Repository: openshift/console

Length of output: 293


🏁 Script executed:

#!/bin/bash
# Read the full context around the disputed lines
sed -n '85,110p' frontend/packages/operator-lifecycle-manager/integration-tests-cypress/views/operator.view.ts

Repository: openshift/console

Length of output: 1400


🏁 Script executed:

#!/bin/bash
# Check for custom command definitions
rg -n "byTestOperatorRow|byLegacyTestID" \
  frontend/packages/operator-lifecycle-manager/integration-tests-cypress/ \
  --type=ts -A 2 | head -50

Repository: openshift/console

Length of output: 6294


🏁 Script executed:

#!/bin/bash
# Find custom command definitions
find frontend/packages/operator-lifecycle-manager/integration-tests-cypress -name "*.ts" -o -name "*.js" | \
  xargs grep -l "byTestOperatorRow\|byLegacyTestID" | grep -i command

Repository: openshift/console

Length of output: 43


🏁 Script executed:

#!/bin/bash
# Look for Cypress custom command definitions in support files
find frontend/packages/operator-lifecycle-manager/integration-tests-cypress -path "*/support/*" -type f

Repository: openshift/console

Length of output: 43


🏁 Script executed:

#!/bin/bash
# Look for Cypress command definitions more broadly
rg -n "byTestOperatorRow|byLegacyTestID" --type=ts \
  frontend/packages/operator-lifecycle-manager/integration-tests-cypress/ \
  -B 3 | grep -E "(export|Cypress.Commands)" -A 2 | head -30

Repository: openshift/console

Length of output: 43


🏁 Script executed:

#!/bin/bash
# Search for command definitions in the broader Cypress support structure
find frontend -path "*/cypress/support*" -type f -name "*.ts" -o -name "*.js" | head -20

Repository: openshift/console

Length of output: 845


🏁 Script executed:

#!/bin/bash
# Search more broadly for custom command definitions
rg -n "byTestOperatorRow|byLegacyTestID" --type=ts --type=js \
  frontend/packages/operator-lifecycle-manager/ | grep -E "export|command|Command" -i | head -20

Repository: openshift/console

Length of output: 43


🏁 Script executed:

#!/bin/bash
# Search the entire codebase for these command definitions
rg -n "byTestOperatorRow|byLegacyTestID" --type=ts --type=js -B 2 | \
  grep -E "Cypress.Commands.add|export.*=" | head -20

Repository: openshift/console

Length of output: 1986


🏁 Script executed:

#!/bin/bash
# Read the definition of byTestOperatorRow and byLegacyTestID
sed -n '83,100p' frontend/packages/integration-tests-cypress/support/selectors.ts

Repository: openshift/console

Length of output: 631


🏁 Script executed:

#!/bin/bash
# Find byLegacyTestID definition
rg -n "byLegacyTestID" frontend/packages/integration-tests-cypress/support/selectors.ts -A 3 | head -15

Repository: openshift/console

Length of output: 418


🏁 Script executed:

#!/bin/bash
# Get full definition of byTestOperatorRow to see if it returns
sed -n '83,88p' frontend/packages/integration-tests-cypress/support/selectors.ts

Repository: openshift/console

Length of output: 258


🏁 Script executed:

#!/bin/bash
# Search for all cy.wait() calls in OLM integration tests (broader search)
rg -n "cy\.wait\(" \
  frontend/packages/operator-lifecycle-manager/integration-tests-cypress/ \
  --type=ts

Repository: openshift/console

Length of output: 572


Replace fixed cy.wait(...) sleeps with deterministic readiness checks.

Lines 96 and 101 inject 5 seconds of arbitrary latency into every details-page navigation. These hardcoded sleeps still risk flakiness on slower environments and violate the performance-first principle. Prefer visibility checks with explicit timeouts instead.

Suggested change
-    cy.byTestOperatorRow(operatorName, { timeout: 30000 }).should('exist');
-    // Wait for operator row to be fully interactive
-    cy.wait(3000);
-    cy.byTestOperatorRow(operatorName).click();
+    cy.byTestOperatorRow(operatorName, { timeout: 30000 }).should('be.visible').click();
     cy.url({ timeout: 30000 }).should('include', 'ClusterServiceVersion');
-    cy.byLegacyTestID('horizontal-link-Details', { timeout: 60000 }).should('exist');
-    // Extra wait to ensure all horizontal nav tabs render
-    cy.wait(2000);
+    cy.byLegacyTestID('horizontal-link-Details', { timeout: 60000 }).should('be.visible');
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@frontend/packages/operator-lifecycle-manager/integration-tests-cypress/views/operator.view.ts`
around lines 95 - 101, The two hardcoded cy.wait(...) sleeps should be replaced
with deterministic readiness assertions: remove the cy.wait(3000) before
cy.byTestOperatorRow(operatorName).click() and instead assert the operator row
is visible and interactable (e.g., .should('be.visible') and
.should('not.have.attr', 'disabled')) before clicking; remove the trailing
cy.wait(2000) and replace it with an assertion that the horizontal nav finished
rendering by checking a stable element such as
cy.byLegacyTestID('horizontal-link-Details').should('be.visible', { timeout:
60000 }) (or other nav tab container visibility) after the
cy.url(...).should('include', 'ClusterServiceVersion') check so navigation
readiness is deterministic.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Mar 31, 2026

@cajieh: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-gcp-console 77d38f4 link true /test e2e-gcp-console

Full PR test history. Your PR dashboard.

Details

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. component/core Related to console core functionality component/helm Related to helm-plugin component/olm Related to OLM do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. kind/cypress Related to Cypress e2e integration testing kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants