Skip to content

CNTRLPLANE-3577: test(nodepool): add NodeDrainTimeout propagation tests#8737

Open
mgencur wants to merge 1 commit into
openshift:mainfrom
mgencur:CNTRLPLANE-3577_drain_timeout
Open

CNTRLPLANE-3577: test(nodepool): add NodeDrainTimeout propagation tests#8737
mgencur wants to merge 1 commit into
openshift:mainfrom
mgencur:CNTRLPLANE-3577_drain_timeout

Conversation

@mgencur

@mgencur mgencur commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Cover two gaps in CAPI reconciliation test coverage:

  • MachineDeployment (UpgradeTypeReplace): add a test case with non-nil timeout values so existing assertions exercise real comparisons instead of vacuous nil==nil
  • MachineSet (UpgradeTypeInPlace): add TestCAPIReconcileMachineSet with sub-cases for non-nil and nil timeout propagation

Which issue(s) this PR fixes:

Fixes https://redhat.atlassian.net/browse/CNTRLPLANE-3577

Special notes for your reviewer:

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

Summary by CodeRabbit

  • Tests
    • Expanded test coverage for NodePool timeout propagation to CAPI resources, including validation scenarios for drain and detach timeout configurations.

…agation tests

Cover two gaps in CAPI reconciliation test coverage:
- MachineDeployment (UpgradeTypeReplace): add a test case with non-nil
  timeout values so existing assertions exercise real comparisons
  instead of vacuous nil==nil
- MachineSet (UpgradeTypeInPlace): add TestCAPIReconcileMachineSet
  with sub-cases for non-nil and nil timeout propagation

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@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

@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Two test additions in capi_test.go cover propagation of NodeDrainTimeout and NodeVolumeDetachTimeout from a NodePool spec into CAPI machine resources. A new table-driven test case is added to TestCAPIReconcile for UpgradeTypeReplace, asserting that non-nil timeout values reach the MachineDeployment template. A new top-level function TestCAPIReconcileMachineSet is introduced for UpgradeTypeInPlace, setting up an existing MachineSet and AWSMachineTemplate, then asserting both timeout propagation and nil-timeout pass-through into the MachineSet template.

🚥 Pre-merge checks | ✅ 10 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Test Structure And Quality ❓ Inconclusive Custom check is for Ginkgo tests (It blocks, BeforeEach/AfterEach, Eventually/Consistently), but capi_test.go uses standard Go testing with Gomega assertions, not Ginkgo framework. Clarify whether check applies to standard Go testing + Gomega or only Ginkgo BDD tests. If applicable to this testing style, adjust criteria for t.Run subtests and Gomega assertions.
✅ Passed checks (10 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: adding test coverage for NodeDrainTimeout (and NodeVolumeDetachTimeout) propagation in CAPI reconciliation tests for NodePool.
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 file contains no Ginkgo tests (It, Describe, Context, When), using Go's standard t.Run() pattern instead. The check is not applicable to this PR.
Topology-Aware Scheduling Compatibility ✅ Passed This PR adds test coverage for timeout propagation in CAPI reconciliation. It modifies only a test file (_test.go) without introducing any scheduling constraints, deployment manifests, or topology-...
Ipv6 And Disconnected Network Test Compatibility ✅ Passed This PR adds unit tests using Go's standard testing package with Gomega assertions, not Ginkgo e2e tests. The custom check only applies to Ginkgo e2e tests (It(), Describe(), Context(), When()), so...
No-Weak-Crypto ✅ Passed PR contains only test code for timeout propagation in CAPI resources; no weak cryptography patterns (MD5, SHA1, DES, RC4, 3DES, Blowfish, ECB), custom crypto, or insecure token comparisons detected.
Container-Privileges ✅ Passed PR adds test coverage for timeout propagation in Go unit tests, not container/K8s manifests. No privileged container configurations, hostPID/hostNetwork/hostIPC, SYS_ADMIN capabilities, or allowPri...
No-Sensitive-Data-In-Logs ✅ Passed PR adds test coverage for timeout propagation in CAPI reconciliation tests. Comprehensive search of the modified test file reveals no logging statements that output sensitive data, passwords, token...
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

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

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

@mgencur mgencur changed the title test(nodepool): add NodeDrainTimeout propagation tests CNTRLPLANE-3577: test(nodepool): add NodeDrainTimeout propagation tests Jun 15, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jun 15, 2026
@openshift-ci-robot

openshift-ci-robot commented Jun 15, 2026

Copy link
Copy Markdown

@mgencur: This pull request references CNTRLPLANE-3577 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "5.0.0" version, but no target version was set.

Details

In response to this:

What this PR does / why we need it:

Cover two gaps in CAPI reconciliation test coverage:

  • MachineDeployment (UpgradeTypeReplace): add a test case with non-nil timeout values so existing assertions exercise real comparisons instead of vacuous nil==nil
  • MachineSet (UpgradeTypeInPlace): add TestCAPIReconcileMachineSet with sub-cases for non-nil and nil timeout propagation

Which issue(s) this PR fixes:

Fixes https://redhat.atlassian.net/browse/CNTRLPLANE-3577

Special notes for your reviewer:

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes 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.

@openshift-ci openshift-ci Bot requested review from clebs and sdminonne June 15, 2026 12:45
@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 Jun 15, 2026
@openshift-ci

openshift-ci Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 41.66%. Comparing base (712ba58) to head (dc61ffd).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8737   +/-   ##
=======================================
  Coverage   41.66%   41.66%           
=======================================
  Files         758      758           
  Lines       93929    93929           
=======================================
  Hits        39135    39135           
  Misses      52046    52046           
  Partials     2748     2748           
Flag Coverage Δ
cmd-support 34.96% <ø> (ø)
cpo-hostedcontrolplane 44.00% <ø> (ø)
cpo-other 43.45% <ø> (ø)
hypershift-operator 51.65% <ø> (ø)
other 31.56% <ø> (ø)

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.

@openshift-ci

openshift-ci Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

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

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

Labels

area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release 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.

2 participants