Skip to content

🌱 OPRUN-4784: Prepare shared helpers for independent E2E step extractions - #3145

Merged
openshift-merge-bot[bot] merged 1 commit into
operator-framework:mainfrom
fao89:OPRUN-4784-pr3-shared-helpers
Nov 11, 2026
Merged

openshift-merge-bot[bot] merged 1 commit into
operator-framework:mainfrom
fao89:OPRUN-4784-pr3-shared-helpers

Conversation

@fao89

@fao89 fao89 commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Description

Extract port-forward and metrics helpers before catalogd steps move, export the common assertion helpers used by component packages, and make recording-hook registration explicit in platform and legacy entry points. Document incremental step ownership. These common prerequisites let the four component extractions build and land independently.

Serial — merge wave 2. Depends on #3138. This draft targets main because the preparation branches exist only in the fork, so its current overall diff includes that prerequisite. After shared-state is squash-merged, rebase only this branch’s own commit onto refreshed main. The four component extractions can land in parallel after this PR merges.

The focused change is ce52d8ed: 8 changed files relative to 348df94c74ddc6c6e3d431667934376a919289d1. Feature contents and tag policy are preserved.

Jira: https://redhat.atlassian.net/browse/OPRUN-4784
Design: docs/designs/e2e-per-component.md

Validation

Local validation uses Go 1.26.5 and GOFLAGS=-buildvcs=false:

  • This branch's component, upgrade, and legacy entry points compile; helper tests pass.
  • All 16 subsets of the four component extractions were checked through actual Git merge trees, compilation, exact step-definition matching, and helper tests.
  • All 27 E2E/upgrade feature files remain byte-identical to main.
  • The combined result passes make verify, make lint (zero issues), and umask 022; make test-unit (55 passing packages, race detection and coverage).
  • Full live standard, experimental, and upgrade E2E runs were not repeated for this restructuring.

Reviewer Checklist

  • API Go Documentation (no API type changes)
  • Tests: Unit Tests (and E2E Tests, if appropriate)
  • Comprehensive Commit Messages
  • Links to related GitHub Issue(s)

Summary by CodeRabbit

  • Documentation
    • Updated end-to-end testing guidance for shared and component-specific steps, suite execution, scenario isolation, and polling.
    • Clarified how scenario identifiers and resource names remain distinct across features.
  • Tests
    • Expanded support for component-specific lifecycle hooks and shared test helpers.
    • Improved metrics access through reusable port-forwarding support.

Extract port-forward and metrics helpers before moving catalogd steps.
Make recording hooks explicit in platform and legacy suites, and document
the incremental ownership boundary. Keep cross-component object lookups
shared so component branches can build and land independently.

Refs: OPRUN-4784
Signed-off-by: Fabricio Aguiar <fabricio.aguiar@gmail.com>

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
@netlify

netlify Bot commented Nov 10, 2026

Copy link
Copy Markdown

👷 Deploy request for olmv1 pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 3e80685

@openshift-ci
openshift-ci Bot requested review from fgiudici and tmshort November 10, 2026 17:14
@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Explain Change →

Walkthrough

The E2E step package exposes reusable helpers for port forwarding, metrics-service lookup, condition checks, label parsing, matching, and nested lookup. Hook registration accepts suite-specific callbacks. The README documents component step ownership and scenario naming.

Changes: E2E Step Sharing

Layer / File(s) Summary
Shared step helpers
test/internal/e2e/steps/portforward.go, steps.go, tls_steps.go, demo_steps.go
Adds helpers for port forwarding and metrics-service lookup. Existing step code adopts these helpers. Several package-private helpers are exported with unchanged behavior.
Suite hook registration and documentation
test/internal/e2e/steps/hooks.go, test/e2e/features_test.go, test/e2e/platform/suite_test.go, test/e2e/README.md
RegisterHooks accepts optional callbacks and invokes them after shared hooks; suite callers pass RegisterAsciiCastHooks. The README describes component step ownership, shared helpers, suite execution, and feature-scoped scenario naming.

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

Change: Refactor

Possibly related PRs

Suggested reviewers: pedjak, perdasilva

Merge Risk: Low · up to 3e806

The change is mergeable with a small documentation correction: readers following the hook-registration guidance in the existing suite would use an undefined package name.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title clearly identifies the preparation of shared helpers for independent E2E step extractions, which matches the main change.
Description check Passed The description summarizes the changes and motivation, includes validation details, and contains the required Reviewer Checklist. It also links the related issue. The checklist items are present but r…
Docstring Coverage Passed Docstring coverage is 85.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentati…
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.
Full details: Description check

Explanation

The description summarizes the changes and motivation, includes validation details, and contains the required Reviewer Checklist. It also links the related issue. The checklist items are present but remain unchecked.

Full details: Docstring Coverage

Explanation

Docstring coverage is 85.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 20 functions across 7 files. (1 skipped: 1 unsupported.)

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

golangci-lint (2.15.0)

level=error msg="[linters_context] typechecking error: build constraints exclude all Go files in /test/e2e"

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Additional comments: 2

test/internal/e2e/steps/portforward.go: 1

40-45: Trivial · Maintainability & Code Quality · Low value

Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.

Cleanup is not idempotent and Wait can block.

cleanup calls p.Kill() and pfCmd.Wait() on every invocation. ScenarioCleanup and resetCatalogPortForward can both call the stored CatalogCleanup. The second Wait returns an error, which the code ignores, so the behavior is safe. The code does not guard against this explicitly. Wrap the body in sync.Once if you want a clear contract for the exported helper.

test/internal/e2e/steps/hooks.go: 1

115-121: Trivial · Maintainability & Code Quality

Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.

Suites that call RegisterHooks(sc) with no hook no longer register ASCII-cast hooks.

Before this change, RegisterHooks registered RegisterAsciiCastHooks unconditionally. Now only the platform suite and features_test.go pass it. The catalogd, object-controller, and operator-controller suites lose it. The supplied search found @demo only in test/e2e/platform/features/demos.feature, so recording stays wired for the demo path. If any @demo feature moves to another suite later, it will run without recording and no error will appear.

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: 3d0cfdc6-8ae0-4254-8461-2c18c0265823
Commits

Reviewing files that changed from the base of the PR and between 8091f36 and 3e80685.

Files selected for processing: 8

  • test/e2e/README.md
  • test/e2e/features_test.go
  • test/e2e/platform/suite_test.go
  • test/internal/e2e/steps/demo_steps.go
  • test/internal/e2e/steps/hooks.go
  • test/internal/e2e/steps/portforward.go
  • test/internal/e2e/steps/steps.go
  • test/internal/e2e/steps/tls_steps.go

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

@fao89

fao89 commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

/cc @perdasilva

@openshift-ci
openshift-ci Bot requested a review from perdasilva November 10, 2026 17:53
@tmshort

tmshort commented Nov 10, 2026

Copy link
Copy Markdown
Member

/approve

@openshift-ci

openshift-ci Bot commented Nov 10, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tmshort

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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 10, 2026
@perdasilva

Copy link
Copy Markdown
Contributor

/lgtm

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. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants