Skip to content

CNTRLPLANE-3032: test: add e2e v2 tests for NodePool OSImageStream#9033

Merged
openshift-merge-bot[bot] merged 5 commits into
openshift:mainfrom
sdminonne:e2ev2-nodepool-osimagestream-tests
Jul 23, 2026
Merged

CNTRLPLANE-3032: test: add e2e v2 tests for NodePool OSImageStream#9033
openshift-merge-bot[bot] merged 5 commits into
openshift:mainfrom
sdminonne:e2ev2-nodepool-osimagestream-tests

Conversation

@sdminonne

@sdminonne sdminonne commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds Ginkgo v2 lifecycle tests for the dual-stream RHEL NodePool feature (OSStreams feature gate) in test/e2e/v2/tests/nodepool_osimagestream_test.go.

Test scenarios

# Scenario Creates nodes?
1 Explicit rhel-10 rejected on OCP < 5.0 (ValidMachineConfig=False, reason ValidationFailed) No (0 replicas)
2 Explicit rhel-10 with runc ContainerRuntimeConfig rejected on OCP >= 5.0 (ValidMachineConfig=False, reason ValidationFailed, message mentions runc incompatibility) No (0 replicas)
3 Default NodePool (no osImageStream set) reports rhel-9 in status No (reads existing)
4 osImageStream assertion after upgrade in NodePoolReplaceUpgradeTest and NodePoolInPlaceUpgradeTest No (reuses existing NP)

Feature gate handling

Uses e2eutil.HasFieldInCRDSchema() to check if spec.osImageStream exists in the NodePool CRD schema before any test runs. When the OSStreams feature gate is disabled (Default feature set), the +openshift:enable:FeatureGate=OSStreams marker strips the field from the CRD entirely, so the check returns false and all tests skip cleanly. When the gate is enabled (TechPreviewNoUpgrade), the field is present and tests proceed.

The upgrade test assertion (verifyOSImageStreamAfterUpgrade) also checks the CRD schema and skips the assertion gracefully when OSStreams is not enabled, without failing the upgrade test itself.

Changes

  • test/e2e/v2/tests/nodepool_osimagestream_test.go: three test cases registered via RegisterNodePoolOSImageStreamTests
  • test/e2e/v2/tests/nodepool_lifecycle_test.go: verifyOSImageStreamAfterUpgrade helper added after upgrade completes in both Replace and InPlace upgrade tests
  • test/e2e/util/eventually.go: extract OSImageStreamPredicate helper for reuse across tests

TODO(OSStreams): The default OS stream is currently hardcoded to rhel-9 for all OCP versions. When the hardcoding is removed and OCP >= 5.0 defaults to rhel-10, update test 3 to expect rhel-10 on >= 5.0 and update verifyOSImageStreamAfterUpgrade accordingly.

Related PRs

  • openshift/machine-config-operator#6308: removes the ExternalTopologyMode guard so the MCO bootstrap processes the OSImageStream CR that HyperShift writes. Required for the full end-to-end rhel-10 pipeline to work.
  • openshift/release#82146: adds TechPreview periodic CI jobs that run these tests with the OSStreams feature gate enabled.

Test plan

  • make e2ev2 compiles without errors
  • go vet passes
  • make verify passes
  • Dry run lists all 3 v2 osimagestream tests with --ginkgo.label-filter="nodepool-osimagestream"
  • Tests skip cleanly on Default feature set (confirmed by e2e-v2-aws CI job)
  • Tests exercise with OSStreams enabled — requires a TechPreviewNoUpgrade CI job (openshift/release#82146)

🤖 Generated with Claude Code

@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 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 Jul 17, 2026
@openshift-ci

openshift-ci Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci openshift-ci Bot added do-not-merge/needs-area area/testing Indicates the PR includes changes for e2e testing labels Jul 17, 2026
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds legacy and e2e v2 tests for NodePool.spec.osImageStream and status.osImageStream. The tests verify RHEL 10 rejection below OCP 5.0, explicit RHEL 9 acceptance and provisioning, and default NodePool reporting of RHEL 9. Tests skip when the management API lacks osImageStream support.

Sequence Diagram(s)

sequenceDiagram
  participant E2ETest
  participant ManagementCluster
  participant NodePoolController
  participant HostedClusterGuestClient
  E2ETest->>ManagementCluster: Create NodePool with osImageStream
  ManagementCluster->>NodePoolController: Reconcile NodePool
  NodePoolController-->>ManagementCluster: Update ValidMachineConfig and status
  E2ETest->>HostedClusterGuestClient: Wait for node readiness
  HostedClusterGuestClient-->>E2ETest: Return ready nodes
  E2ETest->>ManagementCluster: Read status.osImageStream.name
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 11
✅ Passed checks (11 passed)
Check name Status Explanation
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 All Ginkgo titles are fixed strings; no generated names, timestamps, UUIDs, node/namespace/IP values appear in test titles.
Test Structure And Quality ✅ Passed Tests use bounded Eventually timeouts, DeferCleanup/t.Cleanup for NodePool deletes, and follow existing v1/v2 suite patterns without orphaned resources.
Topology-Aware Scheduling Compatibility ✅ Passed Only e2e tests were added; they create NodePools but add no affinity, nodeSelectors, PDBs, spread constraints, or control-plane assumptions.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The new Ginkgo tests only create/read NodePool resources and wait on cluster-internal status; no IPv4 literals, IP parsing, host URL building, or public internet access found.
No-Weak-Crypto ✅ Passed No MD5/SHA1/DES/RC4/3DES/Blowfish/ECB, custom crypto, or secret/token comparisons appear in the changed files; only OSImageStream enum equality checks.
Container-Privileges ✅ Passed Changed files are pure Go e2e tests; diff search found no privileged/hostNetwork/hostPID/hostIPC/SYS_ADMIN/allowPrivilegeEscalation settings.
No-Sensitive-Data-In-Logs ✅ Passed No passwords/tokens/PII patterns found; logs only mention NodePool names, status, and feature-gate errors.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change by adding NodePool OSImageStream end-to-end tests, though it only mentions the v2 framework.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

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

🧹 Nitpick comments (2)
test/e2e/v2/tests/nodepool_osimagestream_test.go (2)

42-42: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Use a plain Describe name and retain the Ginkgo label.

Remove the legacy string annotations; v2 tests use Label(...) for filtering.

Suggested change
-var _ = Describe("[sig-hypershift][Jira:Hypershift][Feature:NodePoolOSImageStream] NodePool OSImageStream", Label("lifecycle", "nodepool-osimagestream"), func() {
+var _ = Describe("NodePool OSImageStream", Label("lifecycle", "nodepool-osimagestream"), func() {

Based on learnings: v2 Ginkgo Describe names should remain plain and filtering should use Ginkgo labels.

🤖 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/e2e/v2/tests/nodepool_osimagestream_test.go` at line 42, Update the
NodePool OSImageStream test’s Describe declaration to use a plain descriptive
name without bracketed legacy annotations, while retaining the existing
Label("lifecycle", "nodepool-osimagestream") for filtering.

Source: Learnings


96-99: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Avoid shadowing the suite context in polling callbacks.

Rename each callback parameter (for example, pollCtx) so it does not hide the outer test context.

  • test/e2e/v2/tests/nodepool_osimagestream_test.go#L96-L99: rename callback ctx and use it for MgmtClient.Get.
  • test/e2e/v2/tests/nodepool_osimagestream_test.go#L170-L173: rename callback ctx and use it for MgmtClient.Get.
  • test/e2e/v2/tests/nodepool_osimagestream_test.go#L192-L195: rename callback ctx and use it for MgmtClient.Get.
  • test/e2e/v2/tests/nodepool_osimagestream_test.go#L233-L236: rename callback ctx and use it for MgmtClient.Get.

As per coding guidelines: “Avoid variable shadowing.”

🤖 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/e2e/v2/tests/nodepool_osimagestream_test.go` around lines 96 - 99,
Rename the polling callback parameter from ctx to a distinct name such as
pollCtx at all four sites in test/e2e/v2/tests/nodepool_osimagestream_test.go
(lines 96-99, 170-173, 192-195, and 233-236), and pass the renamed parameter to
testCtx.MgmtClient.Get so the outer suite context is not shadowed.

Source: Coding guidelines

🤖 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 `@test/e2e/v2/tests/nodepool_osimagestream_test.go`:
- Around line 227-249: Before waiting for the default NodePool status in the
test, verify that its OS image stream is unset and skip the test when it is
explicitly configured, preserving the requirement that this scenario exercises
default resolution. Add no mutation or setup to create the prerequisite; use the
existing defaultNP object and test framework skip mechanism around the NodePool
status assertion.

---

Nitpick comments:
In `@test/e2e/v2/tests/nodepool_osimagestream_test.go`:
- Line 42: Update the NodePool OSImageStream test’s Describe declaration to use
a plain descriptive name without bracketed legacy annotations, while retaining
the existing Label("lifecycle", "nodepool-osimagestream") for filtering.
- Around line 96-99: Rename the polling callback parameter from ctx to a
distinct name such as pollCtx at all four sites in
test/e2e/v2/tests/nodepool_osimagestream_test.go (lines 96-99, 170-173, 192-195,
and 233-236), and pass the renamed parameter to testCtx.MgmtClient.Get so the
outer suite context is not shadowed.
🪄 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), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 1dab87aa-99bc-497d-95c5-7dfa5c6e2642

📥 Commits

Reviewing files that changed from the base of the PR and between 3b49a4a and bca60d7.

📒 Files selected for processing (1)
  • test/e2e/v2/tests/nodepool_osimagestream_test.go

Comment thread test/e2e/v2/tests/nodepool_osimagestream_test.go
@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 44.51%. Comparing base (0a7e9d4) to head (da5fec3).
⚠️ Report is 16 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9033      +/-   ##
==========================================
+ Coverage   44.44%   44.51%   +0.06%     
==========================================
  Files         774      774              
  Lines       96977    96988      +11     
==========================================
+ Hits        43105    43170      +65     
+ Misses      50897    50830      -67     
- Partials     2975     2988      +13     
Files with missing lines Coverage Δ
...ypershift-operator/controllers/nodepool/version.go 97.97% <100.00%> (-2.03%) ⬇️

... and 1 file with indirect coverage changes

Flag Coverage Δ
cmd-support 38.39% <ø> (ø)
cpo-hostedcontrolplane 47.19% <ø> (ø)
cpo-other 45.25% <ø> (ø)
hypershift-operator 54.45% <100.00%> (+0.23%) ⬆️
other 32.64% <ø> (ø)

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sdminonne

Copy link
Copy Markdown
Contributor Author

/test e2e-v2-aws

@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: 2

🤖 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 `@test/e2e/nodepool_osimagestream_test.go`:
- Around line 84-90: Ensure all OSImageStream-related subtests, including the
default-status scenario, skip when the management cluster rejects the
osImageStream field instead of polling and failing. Reuse the existing error
detection around NodePool creation or perform a single capability check before
launching the three subtests, preserving the current skip message and failure
handling.
- Around line 28-29: Remove t.Parallel() from the affected subtests so they
execute before the parent test’s deferred cancel() invalidates the shared ctx.
Add the existing OSStreams feature-gate skip to testOSImageStreamDefaultStatus,
matching the skip behavior used by the other OSImageStream tests.
🪄 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), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: a6941345-647c-47c1-b985-4db905844830

📥 Commits

Reviewing files that changed from the base of the PR and between bca60d7 and d6712a5.

📒 Files selected for processing (1)
  • test/e2e/nodepool_osimagestream_test.go

Comment thread test/e2e/nodepool_osimagestream_test.go Outdated
Comment thread test/e2e/nodepool_osimagestream_test.go Outdated

@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.

♻️ Duplicate comments (1)
test/e2e/v2/tests/nodepool_osimagestream_test.go (1)

230-231: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Verify that the default NodePool is actually unset before asserting default resolution.

The test claims "When no osImageStream is set" but does not verify this precondition. If the default NodePool explicitly sets osImageStream=rhel-9, the test passes without exercising default resolution. As per path instructions, non-lifecycle tests must skip when required preconditions are absent rather than proceeding.

Proposed fix
 		defaultNP := getDefaultNodePool(ctx, testCtx.MgmtClient, hc)
 		Expect(defaultNP).NotTo(BeNil(), "default NodePool should exist")
+		if defaultNP.Spec.OSImageStream.Name != "" {
+			Skip("default NodePool explicitly sets osImageStream=" + defaultNP.Spec.OSImageStream.Name)
+		}
 
 		// The default OS stream is currently hardcoded to rhel-9 for all OCP versions.
🤖 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/e2e/v2/tests/nodepool_osimagestream_test.go` around lines 230 - 231, In
the test setup around getDefaultNodePool, verify that the default NodePool’s
osImageStream is unset before asserting default resolution. If the required
precondition is absent, skip the non-lifecycle test rather than continuing;
preserve the existing NotTo(BeNil()) assertion for confirming the NodePool
exists.

Source: Path instructions

🤖 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.

Duplicate comments:
In `@test/e2e/v2/tests/nodepool_osimagestream_test.go`:
- Around line 230-231: In the test setup around getDefaultNodePool, verify that
the default NodePool’s osImageStream is unset before asserting default
resolution. If the required precondition is absent, skip the non-lifecycle test
rather than continuing; preserve the existing NotTo(BeNil()) assertion for
confirming the NodePool exists.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: be4d0bf2-d7b7-4408-add1-09f5e33242e2

📥 Commits

Reviewing files that changed from the base of the PR and between d6712a5 and 6182001.

📒 Files selected for processing (1)
  • test/e2e/v2/tests/nodepool_osimagestream_test.go

@sdminonne
sdminonne force-pushed the e2ev2-nodepool-osimagestream-tests branch 2 times, most recently from 1f644b4 to 736fc8d Compare July 17, 2026 14:24
@sdminonne sdminonne changed the title Add e2e v2 tests for NodePool OSImageStream on OCP < 5.0 Add e2e tests for NodePool OSImageStream (v1 and v2) Jul 17, 2026
@sdminonne

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Full review finished.

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

🤖 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 `@test/e2e/nodepool_osimagestream_test.go`:
- Around line 24-26: Remove the suite-level OCP version skip and add the same
guard at the start of testOSImageStreamRHEL10Rejection. Keep the RHEL 9 and
default-status tests running on OCP 5.0+, while skipping only the RHEL 10
rejection scenario there.
🪄 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), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: f0c39885-fc16-48b9-8b0f-d354c4b8f08e

📥 Commits

Reviewing files that changed from the base of the PR and between 3b49a4a and 736fc8d.

📒 Files selected for processing (2)
  • test/e2e/nodepool_osimagestream_test.go
  • test/e2e/v2/tests/nodepool_osimagestream_test.go

Comment thread test/e2e/nodepool_osimagestream_test.go Outdated
@sdminonne
sdminonne force-pushed the e2ev2-nodepool-osimagestream-tests branch from 736fc8d to 92487fa Compare July 17, 2026 15:21
@sdminonne

Copy link
Copy Markdown
Contributor Author

/test e2e-v2-aws

@sdminonne

Copy link
Copy Markdown
Contributor Author

/test e2e-aws-4-22

@jparrill jparrill 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.

Dropped some comments. Thanks!

Depends on openshift/machine-config-operator#6308

Do we need both the v1 and v2 versions of this test? The v2 framework is the direction we're going, and maintaining both means ~90% duplicated logic. If this is net-new test code (not a migration of an existing v1 test), it might make more sense to only add the v2 version.

Comment thread test/e2e/nodepool_osimagestream_test.go Outdated
crclient "sigs.k8s.io/controller-runtime/pkg/client"
)

func TestNodePoolOSImageStream(t *testing.T) {

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.

This creates a standalone HostedCluster just for these 3 subtests. Most NodePool tests are registered as NodePoolTestCase inside TestNodePool (in nodepool_test.go), which shares one cluster across ~15 subtests and amortizes the ~15-20 min creation cost. Since these tests create their own NodePools with specific replicas (0 or 1), they'd fit naturally as NodePoolTestCase entries there.

The other concern is that HasFieldInCRDSchema runs inside the NewHypershiftTest callback — i.e., after the cluster is already created. If OSStreams isn't enabled, you pay the full cluster creation time just to skip.

Comment thread test/e2e/nodepool_osimagestream_test.go Outdated
t.Run("TestOSImageStreamRHEL10Rejection", func(t *testing.T) {
testOSImageStreamRHEL10Rejection(t, ctx, mgtClient, hostedCluster, *defaultNodePool)
})

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.

nit: the v2 It(...) blocks already use Ginkgo-style names, but these v1 subtests use PascalCase. For consistency with the project convention, something like "When osImageStream is set to rhel-10 on OCP < 5.0, it should set ValidMachineConfig to False" would be more descriptive and match the v2 wording.

Comment thread test/e2e/nodepool_osimagestream_test.go Outdated
},
e2eutil.WithTimeout(5*time.Minute),
e2eutil.WithInterval(10*time.Second),
)

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.

This re-fetches the NodePool and manually iterates conditions to check the message, but EventuallyObject above already confirmed ValidMachineConfig=False with ValidationFailed. Could the message check be a second predicate in the same EventuallyObject call instead?

Comment thread test/e2e/nodepool_osimagestream_test.go Outdated
pool := &hyperv1.NodePool{}
err := mgtClient.Get(ctx, crclient.ObjectKeyFromObject(np), pool)
return pool, err
},

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.

This predicate appears 4 times across v1 and v2 (here, line 204, and twice in the v2 file). It follows the same shape as ConditionPredicate in e2eutil — might be worth extracting an OSImageStreamPredicate(expected string) helper there so all four call sites become one-liners.

@jparrill

Copy link
Copy Markdown
Contributor

/label acknowledge-critical-fixes-only

@openshift-ci openshift-ci Bot added the acknowledge-critical-fixes-only Indicates if the issuer of the label is OK with the policy. label Jul 20, 2026
@sdminonne

Copy link
Copy Markdown
Contributor Author

Addressing the two remaining CodeRabbit nitpicks from the review:

ctx shadowing in polling callbacks — Fixed: renamed all 4 callback parameters from ctx to pollCtx to avoid shadowing the outer test context.

[sig-hypershift][Jira:Hypershift][Feature:...] annotations on Describe — Keeping as-is. The v2 AGENTS.md §19 (Sippy/CR Test Name Annotations) explicitly requires these annotations on every top-level Describe block for Sippy Component Readiness mapping and automatic Jira component assignment. Removing them would break CR tracking. The CodeRabbit suggestion was based on a stale learning that contradicts the documented standard.

@sdminonne
sdminonne force-pushed the e2ev2-nodepool-osimagestream-tests branch from 9853b06 to c7eb5c7 Compare July 20, 2026 11:03
@sdminonne

sdminonne commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

@jparrill thanks for the thorough review. All points addressed:

  • v1 vs v2 duplication — Dropped the v1 test file entirely (test/e2e/nodepool_osimagestream_test.go). This is net-new test code, so v2-only makes sense.
  • Standalone HostedCluster cost / HasFieldInCRDSchema after cluster creation — Moot now that v1 is gone. The v2 tests run against the pre-existing hosted cluster from the suite's BeforeSuite, and the CRD schema check runs in BeforeEach before any test logic.
  • PascalCase naming — Moot (v1 dropped). The v2 It(...) blocks already use descriptive Ginkgo-style names.
  • Redundant re-fetch for message check — Combined the message check as a second predicate in the same EventuallyObject call.
  • OSImageStreamPredicate extraction — Extracted to test/e2e/util/eventually.go so all call sites are one-liners.

@coderabbitai

  • ctx shadowing in polling callbacks — Renamed to pollCtx in all 4 callbacks (latest commit).

@sdminonne
sdminonne marked this pull request as ready for review July 20, 2026 11:05
@sdminonne

Copy link
Copy Markdown
Contributor Author

/test e2e-azure-v2-self-managed

@sdminonne

Copy link
Copy Markdown
Contributor Author

/test e2e-kubevirt-aws-ovn-reduced

@sdminonne

Copy link
Copy Markdown
Contributor Author

/test e2e-aws-4-22

@sdminonne

Copy link
Copy Markdown
Contributor Author

/test e2e-v2-gke

@sdminonne

Copy link
Copy Markdown
Contributor Author

/test e2e-aws

@sdminonne

Copy link
Copy Markdown
Contributor Author

/test e2e-aws-upgrade-hypershift-operator

The NodePoolOSImageStreamDefaultStatusTest was failing on AWS because
status.osImageStream was never populated within the 5-minute timeout.
The controller infers status.osImageStream from CAPI Machine
NodeInfo.OSImage, which requires CAPI to have copied NodeInfo from the
guest cluster nodes — a step that can take longer than 5 minutes.

Changes:
- Add a nodesInfo pre-condition wait before asserting on
  status.osImageStream. This confirms CAPI Machines have NodeInfo
  populated (the same prerequisite the controller needs) and gives
  clear diagnostic output when it is not.
- Add status.osImageStream CRD schema check alongside the existing
  spec.osImageStream check, so tests skip with a clear message if the
  feature gate is not active for the status field.
- Increase timeout from 5m to 10m and interval from 10s to 15s for
  both the status test and verifyOSImageStreamAfterUpgrade.
- Remove the GCP platform skip now that the nodesInfo pre-condition
  provides proper diagnostics on all platforms.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sdminonne

Copy link
Copy Markdown
Contributor Author

/test e2e-v2-aws

@sdminonne

Copy link
Copy Markdown
Contributor Author

/test e2e-v2-gke

OCP 5.0 changed the RHCOS NodeInfo.OSImage format from the legacy
3-digit scheme (e.g. "Red Hat Enterprise Linux CoreOS 419.97.202505081234-0")
to a RHEL major.minor.date scheme (e.g. "Red Hat Enterprise Linux CoreOS
9.8.20260721-0"). The regex only matched the legacy format, causing
status.osImageStream to never be populated on OCP 5.0 clusters.

Update the regex to match both formats and add unit test coverage for the
new version strings (RHEL 9, RHEL 10, unknown major).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@openshift-ci openshift-ci Bot added the area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release label Jul 23, 2026
@sdminonne

Copy link
Copy Markdown
Contributor Author

/test e2e-v2-aws

@sdminonne

Copy link
Copy Markdown
Contributor Author

/test e2e-v2-gke

@sdminonne

Copy link
Copy Markdown
Contributor Author

/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-aks-4-22
/test e2e-aws-4-22
/test e2e-aks
/test e2e-aws
/test e2e-aws-upgrade-hypershift-operator
/test e2e-azure-v2-self-managed
/test e2e-kubevirt-aws-ovn-reduced
/test e2e-v2-aws
/test e2e-v2-gke
/test unit
/test verify

@sdminonne

Copy link
Copy Markdown
Contributor Author

/retest-required

@sdminonne

Copy link
Copy Markdown
Contributor Author

/test e2e-aks-4-22

@openshift-ci

openshift-ci Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

@sdminonne: all tests passed!

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.

@sdminonne

Copy link
Copy Markdown
Contributor Author

/verified by unit-tests

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Jul 23, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@sdminonne: This PR has been marked as verified by unit-tests.

Details

In response to this:

/verified by unit-tests

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.

@jparrill

jparrill commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

/hold cancel

After the conversation in slack, we can say current test are hardcoding RHEL-9 in all cases, so this is safe to be merged.
After the MCO PR got merged we will need another PR removing the harcoding parts that forces OSStream to be always RHEL-9.

The PR LGTM, PTAL when you have some time @enxebre 🙏

@openshift-ci openshift-ci Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 23, 2026
@sdminonne

Copy link
Copy Markdown
Contributor Author

@jparrill @enxebre @bryan-cox

My understanding and the rationale behind this is:

When openshift/machine-config-operator#6308 will be merged tests in this PR will keep pass since we hardcode rhel9.
Obviously we'll need to remove the hard-coding and modifying the e2e in this PR at the same time.

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 23, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Tests from second stage were triggered manually. Pipeline can be controlled only manually, until HEAD changes. Use command to trigger second stage.

@openshift-ci

openshift-ci Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bryan-cox, jparrill, sdminonne

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-merge-bot
openshift-merge-bot Bot merged commit f1cc6e9 into openshift:main Jul 23, 2026
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

acknowledge-critical-fixes-only Indicates if the issuer of the label is OK with the policy. approved Indicates a PR has been approved by an approver from all required OWNERS files. area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release area/platform/azure PR/issue for Azure (AzurePlatform) platform area/testing Indicates the PR includes changes for e2e testing jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants