Skip to content

Bug OCPBUGS-105794: Fix P-01-TC04 step definition wiring and add defensive teardown - #17084

Open
redhat-chai-bot wants to merge 1 commit into
openshift:release-4.22from
redhat-chai-bot:fix/OCPBUGS-P01TC04-step-definition-cascade-4.22
Open

Bug OCPBUGS-105794: Fix P-01-TC04 step definition wiring and add defensive teardown#17084
redhat-chai-bot wants to merge 1 commit into
openshift:release-4.22from
redhat-chai-bot:fix/OCPBUGS-P01TC04-step-definition-cascade-4.22

Conversation

@redhat-chai-bot

Copy link
Copy Markdown

Summary

Fix the Enable dev perspective P-01-TC04 Cucumber test cascade failure that has been breaking ~65 console E2E tests (perspective switcher + Add page tests) on every console-aws run for 30+ consecutive days. Release 4.22 is the last Cypress-only version.

Root Cause

The step definition "user has logged in as admin user" was defined in configure-perspectives.ts but was not resolvable by the cypress-cucumber-preprocessor for enable-dev-perspective-ci.feature due to per-package step definition resolution. The Background step that disables the Developer perspective succeeds, then the step definition crash prevents the test body from re-enabling it, and no After hook exists to revert the cluster mutation.

The cascade chain:

  1. Background runs "user has only admin perspective enabled" — patches console.operator.openshift.io/cluster to disable Developer perspective (succeeds)
  2. Background runs "user has logged in as admin user"crashes with "Step implementation missing"
  3. Test body never runs → Developer perspective is NEVER re-enabled
  4. add-flow-ci.feature runs next — perspective-switcher-toggle not found (40s timeout)
  5. ALL 18+ remaining Add page tests are skipped

Changes

common.ts — Step definition wiring + defensive teardown

  • Moved "user has logged in as admin user" step definition to common.ts where Background steps are resolved (calls cy.login() + switches to Administrator perspective)
  • Added devPerspectiveDisabled module-level flag to track when Developer perspective is disabled
  • Added After hook that unconditionally re-enables Developer perspective via oc patch when the flag is set, using failOnNonZeroExit: false and oc rollout status wait for stability

configure-perspectives.ts — Removed duplicate

  • Removed the duplicate "user has logged in as admin user" step definition (now in common.ts)
  • Cleaned up unused imports (nav, switchPerspective, perspective)

enable-dev-perspective.ts — Missing scenario body steps (new file)

  • Added all missing step definitions for P-01-TC04 scenarios:
    • user is at admin perspective
    • user is at Search page in Home section
    • user searches {string}
    • user clicks on cluster
    • user clicks the {string} button in the page heading
    • user selects {string} in the Developer under perspective section
    • user will see Saved alert
    • user refreshes the page to see developer option
    • user will see developer perspective in the perspective switcher

Impact

This fix should resolve ~65 of ~125 console-aws test failures on Cypress-only branches. The After hook ensures that even if the test crashes in the future, subsequent tests won't be affected by cluster state mutation.

Related

  • Part of initiative OCPSTRAT-3674
  • Fixes OCPBUGS-105794
  • Supersedes closed PR #17082 (was targeting main, retargeted to release-4.22 per team feedback that Cypress tests are being removed from main)

AI-generated. Review for accuracy.

@spadgett requested in Slack thread

…nsive teardown

The enable-dev-perspective-ci.feature Background step disables the
Developer perspective via oc patch, but the "user has logged in as
admin user" step definition was only available in configure-perspectives.ts
(under customization/) — not in common.ts where Background steps
shared across features should live.

When P-01-TC04 crashes or fails, the Developer perspective stays
disabled, cascading to break ~65 subsequent Cypress tests
(add-flow-ci.feature etc.) that depend on it being available.

This commit:
1. Adds the "user has logged in as admin user" step definition to
   dev-console common.ts (removes it from configure-perspectives.ts
   to avoid duplicate registration)
2. Adds a devPerspectiveDisabled flag set by "user has only admin
   perspective enabled" and an After hook that re-enables the
   Developer perspective on cleanup (with failOnNonZeroExit: false
   and rollout wait for stability)
3. Creates step-definitions/e2e/enable-dev-perspective.ts with all
   scenario body step definitions for P-01-TC04

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@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 Aug 24, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@redhat-chai-bot: This pull request references Jira Issue OCPBUGS-105794, which is invalid:

  • expected the bug to target the "4.22.0" version, but no target version was set
  • release note text must be set and not match the template OR release note type must be set to "Release Note Not Required". For more information you can reference the OpenShift Bug Process.
  • expected Jira Issue OCPBUGS-105794 to depend on a bug targeting a version in 5.0.0 and in one of the following states: MODIFIED, ON_QA, VERIFIED, but no dependents were found

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:

Summary

Fix the Enable dev perspective P-01-TC04 Cucumber test cascade failure that has been breaking ~65 console E2E tests (perspective switcher + Add page tests) on every console-aws run for 30+ consecutive days. Release 4.22 is the last Cypress-only version.

Root Cause

The step definition "user has logged in as admin user" was defined in configure-perspectives.ts but was not resolvable by the cypress-cucumber-preprocessor for enable-dev-perspective-ci.feature due to per-package step definition resolution. The Background step that disables the Developer perspective succeeds, then the step definition crash prevents the test body from re-enabling it, and no After hook exists to revert the cluster mutation.

The cascade chain:

  1. Background runs "user has only admin perspective enabled" — patches console.operator.openshift.io/cluster to disable Developer perspective (succeeds)
  2. Background runs "user has logged in as admin user"crashes with "Step implementation missing"
  3. Test body never runs → Developer perspective is NEVER re-enabled
  4. add-flow-ci.feature runs next — perspective-switcher-toggle not found (40s timeout)
  5. ALL 18+ remaining Add page tests are skipped

Changes

common.ts — Step definition wiring + defensive teardown

  • Moved "user has logged in as admin user" step definition to common.ts where Background steps are resolved (calls cy.login() + switches to Administrator perspective)
  • Added devPerspectiveDisabled module-level flag to track when Developer perspective is disabled
  • Added After hook that unconditionally re-enables Developer perspective via oc patch when the flag is set, using failOnNonZeroExit: false and oc rollout status wait for stability

configure-perspectives.ts — Removed duplicate

  • Removed the duplicate "user has logged in as admin user" step definition (now in common.ts)
  • Cleaned up unused imports (nav, switchPerspective, perspective)

enable-dev-perspective.ts — Missing scenario body steps (new file)

  • Added all missing step definitions for P-01-TC04 scenarios:
  • user is at admin perspective
  • user is at Search page in Home section
  • user searches {string}
  • user clicks on cluster
  • user clicks the {string} button in the page heading
  • user selects {string} in the Developer under perspective section
  • user will see Saved alert
  • user refreshes the page to see developer option
  • user will see developer perspective in the perspective switcher

Impact

This fix should resolve ~65 of ~125 console-aws test failures on Cypress-only branches. The After hook ensures that even if the test crashes in the future, subsequent tests won't be affected by cluster state mutation.

Related

  • Part of initiative OCPSTRAT-3674
  • Fixes OCPBUGS-105794
  • Supersedes closed PR #17082 (was targeting main, retargeted to release-4.22 per team feedback that Cypress tests are being removed from main)

AI-generated. Review for accuracy.

@spadgett requested in Slack thread

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 commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: redhat-chai-bot
Once this PR has been reviewed and has the lgtm label, please assign jrichter1 for approval. 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

@openshift-ci openshift-ci Bot added the component/dev-console Related to dev-console label Aug 24, 2026
@logonoff

Copy link
Copy Markdown
Member

/pipeline required

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-gcp-console

@redhat-chai-bot

Copy link
Copy Markdown
Author

/retest-required

The previous e2e-gcp-console run failed due to Boskos lease proxy 503 errors on build08 (infrastructure issue, not code-related). Retesting.


AI-generated. Review for accuracy.

@openshift-ci

openshift-ci Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

@redhat-chai-bot: 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 16ad0fb 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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Make sure no other tests or steps enable/disable the dev perspective, otherwise your variable will be out of sync. Alternatively instead of keeping an internal variable, have a single source of truth--fetch data from the oc cli.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Good point — the module-level devPerspectiveDisabled flag could get out of sync if other steps also modify perspective visibility.

The simplest fix that addresses your concern: make the After hook unconditionally re-enable the Developer perspective without checking the flag. The oc patch to enable it is idempotent — if the perspective is already enabled, the patch is a no-op ("no change"). This eliminates the state-tracking concern entirely:

After(() => {
  cy.exec(
    `oc patch console.operator.openshift.io/cluster --type='merge' -p '{"spec":{"customization":{"perspectives":[{"id":"dev","visibility":{"state":"Enabled"}}]}}}'`,
    { failOnNonZeroExit: false },
  );
});

Would you prefer this unconditional approach, or the oc CLI check for the current state? I can push the update either way.

Also, the E2E job has failed twice due to build08 Boskos lease proxy 503 errors (infrastructure issue — the Cypress tests never actually ran). Would you mind retesting with /test e2e-gcp-console when the infrastructure recovers?


AI-generated. Review for accuracy.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Unconditional is fine

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

Labels

component/dev-console Related to dev-console 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants