Skip to content

NO-ISSUE: Add TechPreview and feature-gate E2E test filtering infrastructure#16770

Closed
perdasilva wants to merge 8 commits into
openshift:mainfrom
perdasilva:main
Closed

NO-ISSUE: Add TechPreview and feature-gate E2E test filtering infrastructure#16770
perdasilva wants to merge 8 commits into
openshift:mainfrom
perdasilva:main

Conversation

@perdasilva

@perdasilva perdasilva commented Jul 16, 2026

Copy link
Copy Markdown

Analysis / Root cause:
test-prow-e2e-techpreview.sh and test-prow-playwright-e2e-techpreview.sh
were empty placeholders. CI jobs running against TechPreviewNoUpgrade clusters
had no mechanism to select only the tests that require TechPreview or a specific
feature gate to be enabled.

Solution description:

  • Adds @tech-preview and @feature-gate Playwright tags as the selection
    mechanism for CI scripts.
  • Adds two fixtures to frontend/e2e/fixtures/index.ts:
    • techPreviewOnly — skips the test if the cluster's FeatureGate
      spec.featureSet is not TechPreviewNoUpgrade (reads via k8sClient).
    • requireFeatureGate(gateName) — skips unless the named gate appears in
      the cluster's enabled list; throws on infrastructure errors so failures
      are visible rather than silently skipped.
  • Adds an example @tech-preview test (e2e/tests/olm/olmv1-catalog.spec.ts)
    as the first consumer of the new fixtures.
  • Populates test-prow-playwright-e2e-techpreview.sh to run
    --grep "@tech-preview|@feature-gate".
  • Adds a feature-gate scenario to test-prow-playwright-e2e.sh so
    feature-gate tests also run on standard clusters (fixture skips when the
    gate is not enabled; tests pass naturally as gates graduate to GA).
  • Creates frontend/integration-tests/support/tech-preview-guard.ts with a
    Cypress before() guard (skips suite unless TechPreviewNoUpgrade) and a
    requireFeatureGate(gateName) helper.
  • Populates test-prow-e2e-techpreview.sh to run the olm Cypress package
    (OLMv1 UI is active on TechPreview clusters).

Screenshots / screen recording:
N/A — CI infrastructure change.

Test setup:

  • Playwright fixtures are verified by TypeScript compilation and --list.
  • Full validation requires a cluster with featureSet: TechPreviewNoUpgrade.

Test cases:

  • playwright test --list --grep "@tech-preview" shows olmv1-catalog.spec.ts
  • On a TechPreview cluster: @tech-preview tests run; techPreviewOnly skips nothing.
  • On a standard cluster: techPreviewOnly skips the test; requireFeatureGate
    skips tests whose gates are not enabled.
  • Infrastructure error (bad kubeconfig): requireFeatureGate throws visibly
    rather than silently skipping.

Browser conformance: N/A

Additional info:
Feature gate graduation is handled transparently: when a gate moves from
TechPreview to GA, requireFeatureGate finds it in the cluster's enabled list
on GA clusters without any test changes. The @feature-gate tag runs in both
the regular and techpreview scripts.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added Tech Preview and feature-gate filtering for Playwright and Cypress end-to-end tests.
    • Added automatic test skipping based on cluster Tech Preview status and enabled feature gates.
    • Added dedicated CI entry points for Tech Preview test suites.
    • Added an OLMv1 Software Catalog Tech Preview end-to-end test.
  • Documentation

    • Documented the test tagging, filtering, fixture behavior, and CI execution approach.

Per G. da Silva and others added 8 commits July 16, 2026 13:50
Spec for populating test-prow-e2e-techpreview.sh and
test-prow-playwright-e2e-techpreview.sh with a @tech-preview
Playwright tag + techPreviewOnly fixture approach and an inverted
Cypress before() guard.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…upport

Add @feature-gate tag, requireFeatureGate Playwright fixture, and
requireFeatureGate Cypress guard so tests can target a specific
feature gate and run on both TechPreview and GA clusters as the gate
matures, without needing test changes at graduation time.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
… error handling

- Replace page.evaluate() in techPreviewOnly with k8sClient.getClusterCustomResource()
  to avoid TypeError when window.SERVER_FLAGS is undefined on about:blank
- Surface infrastructure errors in requireFeatureGate instead of silently skipping

Co-Authored-By: Claude Sonnet 4.6 (1M context) <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 the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 16, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@perdasilva: This pull request explicitly references no jira issue.

Details

In response to this:

Analysis / Root cause:
test-prow-e2e-techpreview.sh and test-prow-playwright-e2e-techpreview.sh
were empty placeholders. CI jobs running against TechPreviewNoUpgrade clusters
had no mechanism to select only the tests that require TechPreview or a specific
feature gate to be enabled.

Solution description:

  • Adds @tech-preview and @feature-gate Playwright tags as the selection
    mechanism for CI scripts.
  • Adds two fixtures to frontend/e2e/fixtures/index.ts:
  • techPreviewOnly — skips the test if the cluster's FeatureGate
    spec.featureSet is not TechPreviewNoUpgrade (reads via k8sClient).
  • requireFeatureGate(gateName) — skips unless the named gate appears in
    the cluster's enabled list; throws on infrastructure errors so failures
    are visible rather than silently skipped.
  • Adds an example @tech-preview test (e2e/tests/olm/olmv1-catalog.spec.ts)
    as the first consumer of the new fixtures.
  • Populates test-prow-playwright-e2e-techpreview.sh to run
    --grep "@tech-preview|@feature-gate".
  • Adds a feature-gate scenario to test-prow-playwright-e2e.sh so
    feature-gate tests also run on standard clusters (fixture skips when the
    gate is not enabled; tests pass naturally as gates graduate to GA).
  • Creates frontend/integration-tests/support/tech-preview-guard.ts with a
    Cypress before() guard (skips suite unless TechPreviewNoUpgrade) and a
    requireFeatureGate(gateName) helper.
  • Populates test-prow-e2e-techpreview.sh to run the olm Cypress package
    (OLMv1 UI is active on TechPreview clusters).

Screenshots / screen recording:
N/A — CI infrastructure change.

Test setup:

  • Playwright fixtures are verified by TypeScript compilation and --list.
  • Full validation requires a cluster with featureSet: TechPreviewNoUpgrade.

Test cases:

  • playwright test --list --grep "@tech-preview" shows olmv1-catalog.spec.ts
  • On a TechPreview cluster: @tech-preview tests run; techPreviewOnly skips nothing.
  • On a standard cluster: techPreviewOnly skips the test; requireFeatureGate
    skips tests whose gates are not enabled.
  • Infrastructure error (bad kubeconfig): requireFeatureGate throws visibly
    rather than silently skipping.

Browser conformance: N/A

Additional info:
Feature gate graduation is handled transparently: when a gate moves from
TechPreview to GA, requireFeatureGate finds it in the cluster's enabled list
on GA clusters without any test changes. The @feature-gate tag runs in both
the regular and techpreview scripts.

🤖 Generated with Claude Code

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.

@perdasilva

Copy link
Copy Markdown
Author

/hold

@openshift-ci
openshift-ci Bot requested review from TheRealJon and spadgett July 16, 2026 16:18
@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 16, 2026
@openshift-ci

openshift-ci Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: perdasilva
Once this PR has been reviewed and has the lgtm label, please assign therealjon 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

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

Adds documented and implemented TechPreview and feature-gate filtering for Playwright and Cypress E2E tests, including cluster-state guards, tagged test coverage, dedicated CI scripts, and a Playwright feature-gate scenario.

Changes

TechPreview E2E filtering

Layer / File(s) Summary
Filtering design and implementation plan
docs/superpowers/plans/..., docs/superpowers/specs/...
Documents tags, fixture and guard contracts, FeatureGate behavior, CI wiring, and graduation handling.
Playwright cluster-state guards
frontend/e2e/fixtures/index.ts, frontend/e2e/tests/olm/olmv1-catalog.spec.ts
Adds techPreviewOnly and requireFeatureGate fixtures and a tagged OLMv1 smoke test.
Cypress TechPreview guards
frontend/integration-tests/support/tech-preview-guard.ts, frontend/integration-tests/{tsconfig.json,.eslintrc.cjs}, frontend/.eslintignore
Adds suite-level TechPreview and feature-gate guards with supporting TypeScript and ESLint configuration.
Filtered CI entrypoints
test-prow-*-e2e*.sh
Runs filtered Playwright and Cypress suites, adds the Playwright feature-gate scenario, and executes CSP checks.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

Playwright filtering

sequenceDiagram
  participant CI
  participant Playwright
  participant k8sClient
  participant FeatureGate
  CI->>Playwright: Run `@tech-preview`|`@feature-gate` tests
  Playwright->>k8sClient: Read cluster FeatureGate
  k8sClient->>FeatureGate: Fetch cluster configuration
  FeatureGate-->>Playwright: Return featureSet and enabled gates
  Playwright-->>CI: Execute or skip tests
Loading

Cypress filtering

sequenceDiagram
  participant CI
  participant Cypress
  participant tech-preview-guard
  participant oc
  CI->>Cypress: Run TechPreview packages
  Cypress->>tech-preview-guard: Register suite guard
  tech-preview-guard->>oc: Query cluster FeatureGate
  oc-->>tech-preview-guard: Return featureSet and enabled gates
  tech-preview-guard-->>Cypress: Continue or skip suite
Loading

Suggested labels: docs-approved, px-approved


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error, 2 warnings)

Check name Status Explanation Resolution
No-Sensitive-Data-In-Logs ❌ Error Both techpreview scripts enable xtrace before exporting BRIDGE_BASE_ADDRESS, so CI logs can print the cluster console URL/hostname. Assign BRIDGE_BASE_ADDRESS with xtrace disabled, validate it is non-empty, then re-enable tracing.
Title check ⚠️ Warning The title matches the change but violates the repo rule requiring a Jira issue prefix. Replace NO-ISSUE with a valid Jira key, e.g. CONSOLE-XXXX: Add TechPreview and feature-gate E2E test filtering infrastructure.
Microshift Test Compatibility ⚠️ Warning New Playwright tests/fixtures depend on config.openshift.io FeatureGate and OLM/CSV routes, and there’s no MicroShift skip/tag/guard protecting them. Add a MicroShift guard or skip/tag these specs before they can run in MicroShift-capable CI, or move them behind an equivalent MicroShift exclusion.
✅ Passed checks (12 passed)
Check name Status Explanation
Description check ✅ Passed Most required sections are present with concrete details; only reviewers/assignees is missing and browser conformance is left as N/A.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Stable And Deterministic Test Names ✅ Passed The new test titles are static strings; no interpolated, generated, or runtime-derived names were added in the changed test files.
Test Structure And Quality ✅ Passed No Ginkgo tests were added or modified; the PR changes are Playwright/Cypress/docs/scripts, so this check is not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; the PR only changes Playwright/Cypress code and scripts, with no multi-node or HA assumptions found.
Topology-Aware Scheduling Compatibility ✅ Passed Only docs, test fixtures, and CI scripts changed; no manifests/controllers were added that impose scheduling constraints.
Ote Binary Stdout Contract ✅ Passed No changed process-level code writes to stdout; only a per-test console.error (stderr) remains, and no stdout/logging patterns were added.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The new Playwright/Cypress tests and CI scripts use only cluster-internal oc/k8s calls; I found no hardcoded IPv4s, host formatting bugs, or public-internet dependencies in the added files.
No-Weak-Crypto ✅ Passed No MD5/SHA1/DES/RC4/3DES/Blowfish, custom crypto, or secret/token comparisons were added; the new comparisons are only non-secret cluster/tag strings.
Container-Privileges ✅ Passed No changed manifest defines privileged settings; touched files are docs, TS, and CI shell scripts only.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@perdasilva

Copy link
Copy Markdown
Author

/hold experimental

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 7

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/superpowers/specs/2026-07-16-techpreview-e2e-test-filtering-design.md`:
- Around line 64-80: The documentation describes an outdated SERVER_FLAGS-based
contract; update
docs/superpowers/specs/2026-07-16-techpreview-e2e-test-filtering-design.md at
lines 64-80 to document FeatureGate-CR lookup through k8sClient, lines 89-100 to
show valid narrowing of the CR response, and lines 113-126 to match the existing
helper and return contract. Update
docs/superpowers/plans/2026-07-16-techpreview-e2e-test-filtering.md at lines
28-55 so its implementation steps match the actual fixture behavior.

In `@frontend/e2e/fixtures/index.ts`:
- Around line 63-79: Validate the FeatureGate payload in the techPreviewOnly
fixture before calling test.skip: require spec.featureSet to be a string and
fail with an infrastructure/data error when missing or malformed. Also update
the active status.featureGates handling in the same fixture to require the
section and enabled entries to be present and correctly shaped, failing rather
than treating malformed data as a disabled gate; apply these changes at
frontend/e2e/fixtures/index.ts lines 63-79 and 83-105.

In `@frontend/e2e/tests/olm/olmv1-catalog.spec.ts`:
- Around line 9-10: Update the URL assertion in the OLM catalog test to group
the route alternatives and anchor the regex at the route boundary or URL end,
allowing only /k8s/cluster/clusterserviceversions or /software-catalog matches
while preserving the existing timeout.

In `@frontend/integration-tests/.eslintrc.cjs`:
- Around line 9-13: Update the parserOptions configuration in the ESLint config
to set sourceType to module, allowing the exported requireFeatureGate symbol in
tech-preview-guard.ts to parse correctly while preserving the existing parser
and project settings.

In `@frontend/integration-tests/support/tech-preview-guard.ts`:
- Around line 14-21: Update the before hook around cy.exec for the featuregate
lookup to inspect result.exitCode, falling back to result.code for older Cypress
versions, and fail immediately when the command fails. Only call this.skip()
after a successful command whose trimmed stdout is not TechPreviewNoUpgrade;
apply the same handling to both hooks if the file contains another equivalent oc
check.

In `@test-prow-playwright-e2e-techpreview.sh`:
- Around line 35-39: Split the setup assignments in
test-prow-playwright-e2e-techpreview.sh lines 35-39 and
test-prow-e2e-techpreview.sh lines 22-26: assign the kubeadmin password and
console URL to temporary variables, export them only after successful retrieval,
and explicitly fail when either required value is empty. Preserve the existing
set +x protection around the password.

In `@test-prow-playwright-e2e.sh`:
- Around line 62-67: Update the scenario list in the header of
test-prow-playwright-e2e.sh to include feature-gate alongside e2e, release, and
smoke, keeping the documentation consistent with the SCENARIO branch and
unknown-scenario message.
🪄 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: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 56cf2a0e-1aeb-4fa8-b869-b97371e0a05b

📥 Commits

Reviewing files that changed from the base of the PR and between 41d3938 and 506c07d.

📒 Files selected for processing (11)
  • docs/superpowers/plans/2026-07-16-techpreview-e2e-test-filtering.md
  • docs/superpowers/specs/2026-07-16-techpreview-e2e-test-filtering-design.md
  • frontend/.eslintignore
  • frontend/e2e/fixtures/index.ts
  • frontend/e2e/tests/olm/olmv1-catalog.spec.ts
  • frontend/integration-tests/.eslintrc.cjs
  • frontend/integration-tests/support/tech-preview-guard.ts
  • frontend/integration-tests/tsconfig.json
  • test-prow-e2e-techpreview.sh
  • test-prow-playwright-e2e-techpreview.sh
  • test-prow-playwright-e2e.sh

Comment on lines +64 to +80
Added to the `TestFixtures` type and `base.extend()` chain in `frontend/e2e/fixtures/index.ts`.
Reads `SERVER_FLAGS.techPreview` from the page and skips if the cluster is not on TechPreview.

```ts
type TestFixtures = {
cleanup: CleanupFixture;
techPreviewOnly: void;
requireFeatureGate: (gateName: string) => Promise<void>;
};

// In base.extend():
techPreviewOnly: async ({ page }, use) => {
const isTechPreview = await page.evaluate(() => window.SERVER_FLAGS.techPreview);
test.skip(!isTechPreview, 'This test requires a TechPreviewNoUpgrade cluster');
await use();
},
```

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.

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

The Playwright documentation describes an older contract.

  • docs/superpowers/specs/2026-07-16-techpreview-e2e-test-filtering-design.md#L64-L80: document FeatureGate-CR lookup through k8sClient, not SERVER_FLAGS.
  • docs/superpowers/specs/2026-07-16-techpreview-e2e-test-filtering-design.md#L89-L100: show valid narrowing for the CR response.
  • docs/superpowers/specs/2026-07-16-techpreview-e2e-test-filtering-design.md#L113-L126: describe the existing helper and its current return contract.
  • docs/superpowers/plans/2026-07-16-techpreview-e2e-test-filtering.md#L28-L55: update the implementation steps to match the actual fixture.
📍 Affects 2 files
  • docs/superpowers/specs/2026-07-16-techpreview-e2e-test-filtering-design.md#L64-L80 (this comment)
  • docs/superpowers/specs/2026-07-16-techpreview-e2e-test-filtering-design.md#L89-L100
  • docs/superpowers/specs/2026-07-16-techpreview-e2e-test-filtering-design.md#L113-L126
  • docs/superpowers/plans/2026-07-16-techpreview-e2e-test-filtering.md#L28-L55
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/superpowers/specs/2026-07-16-techpreview-e2e-test-filtering-design.md`
around lines 64 - 80, The documentation describes an outdated SERVER_FLAGS-based
contract; update
docs/superpowers/specs/2026-07-16-techpreview-e2e-test-filtering-design.md at
lines 64-80 to document FeatureGate-CR lookup through k8sClient, lines 89-100 to
show valid narrowing of the CR response, and lines 113-126 to match the existing
helper and return contract. Update
docs/superpowers/plans/2026-07-16-techpreview-e2e-test-filtering.md at lines
28-55 so its implementation steps match the actual fixture behavior.

Comment on lines +63 to +79
techPreviewOnly: async ({ k8sClient }, use) => {
let isTechPreview = false;
try {
const fg = await k8sClient.getClusterCustomResource(
'config.openshift.io',
'v1',
'featuregates',
'cluster',
);
isTechPreview = (fg as any)?.spec?.featureSet === 'TechPreviewNoUpgrade';
} catch {
// If the CR can't be read, don't skip — surface the infrastructure error
throw new Error(
`techPreviewOnly: could not read FeatureGate CR 'cluster': check cluster connectivity`,
);
}
test.skip(!isTechPreview, 'This test requires a TechPreviewNoUpgrade cluster');

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
git ls-files frontend/e2e/fixtures/index.ts
wc -l frontend/e2e/fixtures/index.ts
cat -n frontend/e2e/fixtures/index.ts | sed -n '1,180p'

Repository: openshift/console

Length of output: 4895


🏁 Script executed:

#!/bin/bash
set -euo pipefail
wc -l frontend/e2e/fixtures/index.ts
sed -n '1,180p' frontend/e2e/fixtures/index.ts | nl -ba

Repository: openshift/console

Length of output: 230


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the Kubernetes client method and nearby usages of feature gate handling.
ast-grep outline frontend/e2e/clients/kubernetes-client.ts --view expanded || true
printf '\n---\n'
rg -n "getClusterCustomResource|featureGates|featureSet|TechPreviewNoUpgrade" frontend/e2e -S
printf '\n---\n'
cat -n frontend/e2e/clients/kubernetes-client.ts | sed -n '1,260p'

Repository: openshift/console

Length of output: 14376


🏁 Script executed:

#!/bin/bash
set -euo pipefail

ast-grep outline frontend/e2e/clients/kubernetes-client.ts --view expanded || true
printf '\n---\n'
rg -n "getClusterCustomResource|featureGates|featureSet|TechPreviewNoUpgrade" frontend/e2e -S
printf '\n---\n'
sed -n '1,260p' frontend/e2e/clients/kubernetes-client.ts | cat -n

Repository: openshift/console

Length of output: 14376


🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n "interface FeatureGate|type FeatureGate|featureSet:|featureGates:" frontend -S
printf '\n---\n'
rg -n "FeatureGate" frontend -g '!**/node_modules/**' -S

Repository: openshift/console

Length of output: 1250


🏁 Script executed:

#!/bin/bash
set -euo pipefail

wc -l frontend/integration-tests/support/tech-preview-guard.ts
sed -n '1,220p' frontend/integration-tests/support/tech-preview-guard.ts | cat -n

Repository: openshift/console

Length of output: 1629


Guard against malformed FeatureGate payloads before skipping tests.

  • frontend/e2e/fixtures/index.ts#L63-L79: fail when spec.featureSet is missing or not a string; otherwise a bad CR looks like a non-TechPreview cluster and silently skips the suite.
  • frontend/e2e/fixtures/index.ts#L83-L105: fail when the active status.featureGates section or enabled entries are missing or malformed; otherwise a bad CR looks like the gate is disabled.
📍 Affects 1 file
  • frontend/e2e/fixtures/index.ts#L63-L79 (this comment)
  • frontend/e2e/fixtures/index.ts#L83-L105
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@frontend/e2e/fixtures/index.ts` around lines 63 - 79, Validate the
FeatureGate payload in the techPreviewOnly fixture before calling test.skip:
require spec.featureSet to be a string and fail with an infrastructure/data
error when missing or malformed. Also update the active status.featureGates
handling in the same fixture to require the section and enabled entries to be
present and correctly shaped, failing rather than treating malformed data as a
disabled gate; apply these changes at frontend/e2e/fixtures/index.ts lines 63-79
and 83-105.

Source: Path instructions

Comment on lines +9 to +10
await expect(page).toHaveURL(/\/k8s\/cluster\/clusterserviceversions|\/software-catalog/, {
timeout: 30_000,

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- target file ---'
sed -n '1,120p' frontend/e2e/tests/olm/olmv1-catalog.spec.ts | cat -n

echo
echo '--- similar URL assertions in frontend/e2e/tests/olm ---'
rg -n "toHaveURL\\(" frontend/e2e/tests/olm -S

Repository: openshift/console

Length of output: 884


Constrain the URL regex. Group the alternation and anchor it to the route boundary/end of URL so only /k8s/cluster/clusterserviceversions or /software-catalog matches here.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@frontend/e2e/tests/olm/olmv1-catalog.spec.ts` around lines 9 - 10, Update the
URL assertion in the OLM catalog test to group the route alternatives and anchor
the regex at the route boundary or URL end, allowing only
/k8s/cluster/clusterserviceversions or /software-catalog matches while
preserving the existing timeout.

Source: Path instructions

Comment on lines +9 to +13
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: __dirname,
ecmaVersion: 2018,

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.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

rg -n "sourceType|export function" frontend/integration-tests/.eslintrc.cjs frontend/integration-tests/support/tech-preview-guard.ts

Repository: openshift/console

Length of output: 276


Configure ESLint for module syntax. tech-preview-guard.ts exports requireFeatureGate, but this config still parses the file as a script. Add parserOptions.sourceType: 'module' so ESLint can handle the export syntax.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@frontend/integration-tests/.eslintrc.cjs` around lines 9 - 13, Update the
parserOptions configuration in the ESLint config to set sourceType to module,
allowing the exported requireFeatureGate symbol in tech-preview-guard.ts to
parse correctly while preserving the existing parser and project settings.

Comment on lines +14 to +21
before(function () {
cy.exec('oc get featuregate cluster -o jsonpath={.spec.featureSet}', {
failOnNonZeroExit: false,
}).then((result) => {
if (result.stdout.trim() !== 'TechPreviewNoUpgrade') {
this.skip();
}
});

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.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

set -e
git ls-files frontend/integration-tests/support/tech-preview-guard.ts
wc -l frontend/integration-tests/support/tech-preview-guard.ts
cat -n frontend/integration-tests/support/tech-preview-guard.ts

Repository: openshift/console

Length of output: 1686


🏁 Script executed:

set -e
rg -n "requireFeatureGate|tech-preview-guard|failOnNonZeroExit" frontend/integration-tests -S

Repository: openshift/console

Length of output: 775


🌐 Web query:

Cypress cy.exec failOnNonZeroExit false result.code stdout documentation

💡 Result:

When using cy.exec in Cypress, setting the option failOnNonZeroExit to false prevents the test from failing if the executed command returns a non-zero exit code [1][2]. The cy.exec command yields an object that allows you to inspect the results of the command. As of Cypress v15, this result object includes the following key properties [2][3]: exitCode: The numeric exit code returned by the command (formerly named code in older versions) [3]. stdout: The standard output string from the command [2]. stderr: The standard error string from the command [2]. Example usage: cy.exec('your-command', { failOnNonZeroExit: false }).then((result) => { // Use result.exitCode to check if the command succeeded or failed expect(result.exitCode).to.eq(1); // Use result.stdout or result.stderr to verify output cy.log(result.stdout); }); Note: If you are upgrading from an older version of Cypress, ensure you use exitCode, as the code property was renamed in v15 [3]. The command must still eventually exit, or it will time out according to the configured execTimeout [1][2].

Citations:


Surface oc failures instead of skipping the suite. Both hooks ignore the exit status. If oc get featuregate fails, failOnNonZeroExit: false can turn an infrastructure problem into this.skip(). Check result.exitCode (or result.code on older Cypress) and fail before skipping.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@frontend/integration-tests/support/tech-preview-guard.ts` around lines 14 -
21, Update the before hook around cy.exec for the featuregate lookup to inspect
result.exitCode, falling back to result.code for older Cypress versions, and
fail immediately when the command fails. Only call this.skip() after a
successful command whose trimmed stdout is not TechPreviewNoUpgrade; apply the
same handling to both hooks if the file contains another equivalent oc check.

Comment on lines +35 to +39
# don't log kubeadmin-password
set +x
export BRIDGE_KUBEADMIN_PASSWORD="$(cat "${KUBEADMIN_PASSWORD_FILE:-${INSTALLER_DIR}/auth/kubeadmin-password}")"
set -x
export BRIDGE_BASE_ADDRESS="$(oc get consoles.config.openshift.io cluster -o jsonpath='{.status.consoleURL}')"

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.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== test-prow-playwright-e2e-techpreview.sh ==\n'
nl -ba test-prow-playwright-e2e-techpreview.sh | sed -n '1,120p'

printf '\n== test-prow-e2e-techpreview.sh ==\n'
nl -ba test-prow-e2e-techpreview.sh | sed -n '1,120p'

printf '\n== search for set -e / export patterns ==\n'
rg -n 'set -e|set \+e|set -u|set -x|export BRIDGE_KUBEADMIN_PASSWORD|consoleURL|kubeadmin-password' test-prow-playwright-e2e-techpreview.sh test-prow-e2e-techpreview.sh

Repository: openshift/console

Length of output: 242


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Probe shell semantics for export + command substitution failure handling.
bash -lc '
set -u
printf "No set -e:\n"
( export X="$(false)" ); echo "status=$?"
set -e
printf "With set -e in subshell:\n"
( export X="$(false)" ); echo "status=$?" || true
'

# Also probe assignment-only and export separately.
bash -lc '
set -e
f() { return 42; }
( y="$(f)"; echo "assign status=$?" )
( export y="$(f)"; echo "export status=$?" )
'

Repository: openshift/console

Length of output: 211


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Read only: inspect script headers and relevant lines with context.
printf '\n== test-prow-playwright-e2e-techpreview.sh ==\n'
sed -n '1,120p' test-prow-playwright-e2e-techpreview.sh | nl -ba | sed -n '1,120p'

printf '\n== test-prow-e2e-techpreview.sh ==\n'
sed -n '1,120p' test-prow-e2e-techpreview.sh | nl -ba | sed -n '1,120p'

Repository: openshift/console

Length of output: 242


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
import pathlib, re
for path in ["test-prow-playwright-e2e-techpreview.sh", "test-prow-e2e-techpreview.sh"]:
    text = pathlib.Path(path).read_text()
    print(f"\n== {path} ==")
    for pat in [r"set -e", r"set \+e", r"export BRIDGE_KUBEADMIN_PASSWORD", r"consoleURL", r"kubeadmin-password"]:
        print(f"-- {pat}")
        for i, line in enumerate(text.splitlines(), 1):
            if re.search(pat, line):
                print(f"{i}: {line}")
PY

Repository: openshift/console

Length of output: 1238


🌐 Web query:

bash export command substitution exit status set -e export VAR=$(false)

💡 Result:

When you run the command export VAR=$(false), the exit status ($?) of that command will be 0, not 1 [1][2][3]. This occurs because export is a shell builtin command [3]. When you use command substitution (the $(...) syntax) in an assignment, the shell first executes the command inside the substitution and then assigns the result to the variable [1][4]. If you perform a simple assignment like VAR=$(false), the exit status $? is preserved and correctly reflects the failure of the false command (which is 1) [2][3]. However, when you prefix the assignment with a builtin like export, local, or declare, the exit status of the entire line becomes the exit status of that builtin command itself [4][3]. Because the export command successfully completes the operation of setting the variable (even if the value assigned is the empty output of a failed command), it returns an exit status of 0 [1][3]. To correctly capture the exit status of a command while using export, you should perform the assignment and the export in two separate steps [2][5]: VAR=$(false) status=$? export VAR # Now you can check $status or use it for control flow Alternatively, you can assign the output and check the status before exporting: if VAR=$(false); then export VAR else # Handle the error fi This pattern ensures that the exit status of your command is not masked by the export builtin [4][3].

Citations:


Split these setup assignments so failures surface.
export BRIDGE_KUBEADMIN_PASSWORD="$(...)" and export BRIDGE_BASE_ADDRESS="$(...)" can still exit 0 when cat or oc get fails. Assign first, export second, and fail on empty required values in:

  • test-prow-playwright-e2e-techpreview.sh#L35-L39
  • test-prow-e2e-techpreview.sh#L22-L26
🧰 Tools
🪛 Shellcheck (0.11.0)

[warning] 37-37: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 39-39: Declare and assign separately to avoid masking return values.

(SC2155)

📍 Affects 2 files
  • test-prow-playwright-e2e-techpreview.sh#L35-L39 (this comment)
  • test-prow-e2e-techpreview.sh#L22-L26
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test-prow-playwright-e2e-techpreview.sh` around lines 35 - 39, Split the
setup assignments in test-prow-playwright-e2e-techpreview.sh lines 35-39 and
test-prow-e2e-techpreview.sh lines 22-26: assign the kubeadmin password and
console URL to temporary variables, export them only after successful retrieval,
and explicitly fail when either required value is empty. Preserve the existing
set +x protection around the password.

Source: Linters/SAST tools

Comment on lines +62 to +67
elif [ "$SCENARIO" == "feature-gate" ]; then
# Run only tests tagged @feature-gate; the requireFeatureGate fixture skips any
# test whose gate is not enabled on this cluster.
./integration-tests/test-playwright-e2e.sh -- --grep @feature-gate "$@"
else
echo "error: unknown scenario '$SCENARIO' (use: e2e, release, or smoke)" >&2
echo "error: unknown scenario '$SCENARIO' (use: e2e, release, smoke, or feature-gate)" >&2

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.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Document the new feature-gate scenario.

The implementation adds this scenario, but the script header still lists only e2e, release, and smoke. Add feature-gate to the documented scenario list.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test-prow-playwright-e2e.sh` around lines 62 - 67, Update the scenario list
in the header of test-prow-playwright-e2e.sh to include feature-gate alongside
e2e, release, and smoke, keeping the documentation consistent with the SCENARIO
branch and unknown-scenario message.

@TheRealJon

Copy link
Copy Markdown
Member

I'm debating whether we should just have a new test suite just for tech preview features instead of running all of the e2e tests twice. For the most part, tech preview shouldn't impact most of the UI except places where we explicitly gate a behavior, so this seems fairly low risk.

@perdasilva

Copy link
Copy Markdown
Author

/retest

@openshift-ci

openshift-ci Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

@perdasilva: 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-playwright-techpreview 506c07d link false /test e2e-playwright-techpreview

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

do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. 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