Skip to content

Automate OCP-88799-Verify reclaimPolicy and volumeBindingMode combinations#2383

Open
mmakwana30 wants to merge 1 commit into
openshift:mainfrom
mmakwana30:OCP_88799
Open

Automate OCP-88799-Verify reclaimPolicy and volumeBindingMode combinations#2383
mmakwana30 wants to merge 1 commit into
openshift:mainfrom
mmakwana30:OCP_88799

Conversation

@mmakwana30
Copy link
Copy Markdown
Contributor

@mmakwana30 mmakwana30 commented May 19, 2026

Jira: https://redhat.atlassian.net/browse/OCPEDGE-2612

Logs: https://privatebin.corp.redhat.com/?997d713cea408dd4#5DHbHrhDAznEZ9bvTD89xdU1WTtQLCkDDgJYsjfcfhmi

Summary by CodeRabbit

  • Tests

    • Added integration tests validating LVMS behavior across reclaimPolicy and volumeBindingMode combinations.
    • Covers immediate-binding with automatic reclamation and delayed-binding with retained (manual) reclamation.
    • Exercises PVC and pod lifecycles, verifies PV bind/unbind and final reclaim states, and cleans up retained volumes.
  • Chores

    • Added a parameterized StorageClass template and test utilities to create StorageClasses for test scenarios.

@mmakwana30 mmakwana30 assigned mmakwana30 and unassigned mmakwana30 May 19, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 19, 2026

Walkthrough

Added integration test coverage for LVMS StorageClass behavior across reclaim policies and volume binding modes. Includes a parameterized OpenShift Template for StorageClass creation, a helper function that applies the template with sensible defaults, and a Ginkgo test validating PV/PVC lifecycle under Delete/Immediate and Retain/WaitForFirstConsumer scenarios.

Changes

LVMS StorageClass Policy Test

Layer / File(s) Summary
StorageClass template and creation helper
test/integration/qe_tests/testdata/storageclass-template.yaml, test/integration/qe_tests/lvms_utils.go
Parameterized OpenShift Template defines StorageClass with provisioner, filesystem, device class, reclaimPolicy, allowVolumeExpansion, and volumeBindingMode; createStorageClassWithOC fills defaults (provisioner=topolvm.io, fsType=xfs, reclaimPolicy=Delete, volumeBindingMode=WaitForFirstConsumer), always passes ALLOWEXPANSION="true", and applies the template via applyResourceFromTemplate.
StorageClass lifecycle integration test
test/integration/qe_tests/lvms.go
Ginkgo test validates two scenarios: Delete/Immediate creates PVC without a pod, verifies binding and PV deletion after PVC removal; Retain/WaitForFirstConsumer creates PVC that stays Pending until a pod is created, verifies PV reaches Released after PVC deletion, deletes orphaned PV, and calls cleanupLogicalVolumeByName for retained volumes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 8

❌ Failed checks (1 warning, 7 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Stable And Deterministic Test Names ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Test Structure And Quality ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Microshift Test Compatibility ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Single Node Openshift (Sno) Test Compatibility ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Topology-Aware Scheduling Compatibility ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Ote Binary Stdout Contract ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Ipv6 And Disconnected Network Test Compatibility ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and specifically summarizes the main change: automating verification of reclaimPolicy and volumeBindingMode combinations for OCP-88799.
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.

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

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

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@openshift-ci openshift-ci Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 19, 2026
@openshift-ci openshift-ci Bot requested review from jaypoulz and qJkee May 19, 2026 16:54
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 19, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

Comment thread test/integration/qe_tests/lvms.go Outdated
Comment thread test/integration/qe_tests/lvms.go Outdated
Comment thread test/integration/qe_tests/lvms.go Outdated
Comment thread test/integration/qe_tests/lvms.go Outdated
Comment thread test/integration/qe_tests/lvms.go Outdated
Comment thread test/integration/qe_tests/lvms.go Outdated
Comment thread test/integration/qe_tests/lvms.go
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

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/integration/qe_tests/lvms_utils.go`:
- Around line 2010-2032: The helper currently forces ALLOWEXPANSION to false
when callers omit allowExpansion because Go's zero value is false; change
storageClassConfig.allowExpansion from bool to *bool so you can distinguish
"unset" (nil) from set values, then update createStorageClassWithOC to only set
allowExpansionStr/ALOWEXPANSION when cfg.allowExpansion != nil (use "true" or
"false" based on *cfg.allowExpansion); update callers of
storageClassConfig/createStorageClassWithOC to pass a pointer when they need to
override the default.
🪄 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: 7d9d79af-1719-446d-9e5f-58496a1c6dc0

📥 Commits

Reviewing files that changed from the base of the PR and between 5d77a65 and a30ef1a.

📒 Files selected for processing (3)
  • test/integration/qe_tests/lvms.go
  • test/integration/qe_tests/lvms_utils.go
  • test/integration/qe_tests/testdata/storageclass-template.yaml

Comment thread test/integration/qe_tests/lvms_utils.go Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

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/integration/qe_tests/lvms.go`:
- Around line 5055-5066: The StorageClass names (e.g., the scDeleteImmediate
variable used in the createStorageClassWithOC call and its matching
deleteSpecifiedResource defer) are fixed and must be made unique by appending
the existing uniqueSuffix; update each cluster-scoped StorageClass name
assignment (e.g., scDeleteImmediate and the other SC variables around lines
5105-5116) to include "+" uniqueSuffix (or fmt.Sprintf("%s-%s", name,
uniqueSuffix)) and ensure the same unique name is passed into
createStorageClassWithOC and deleteSpecifiedResource so creation and cleanup use
the identical, unique identifier.
🪄 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: e4d67c65-8ae8-4208-b4d6-ca22c79db9bd

📥 Commits

Reviewing files that changed from the base of the PR and between a30ef1a and 8f23d88.

📒 Files selected for processing (3)
  • test/integration/qe_tests/lvms.go
  • test/integration/qe_tests/lvms_utils.go
  • test/integration/qe_tests/testdata/storageclass-template.yaml
✅ Files skipped from review due to trivial changes (1)
  • test/integration/qe_tests/testdata/storageclass-template.yaml

Comment on lines +5055 to +5066
scDeleteImmediate := "lvms-88799-delete-immediate"
err = createStorageClassWithOC(storageClassConfig{
name: scDeleteImmediate,
provisioner: provisioner,
fsType: "xfs",
deviceClass: volumeGroup,
reclaimPolicy: "Delete",
volumeBindingMode: "Immediate",
})
o.Expect(err).NotTo(o.HaveOccurred())
defer deleteSpecifiedResource("storageclass", scDeleteImmediate, "")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Use unique names for cluster-scoped StorageClasses to avoid test collisions.

Line 5055 and Line 5105 use fixed StorageClass names. Because StorageClass is cluster-scoped, parallel runs/retries can conflict and make this test flaky. Append the existing uniqueSuffix to both names.

Suggested diff
-		scDeleteImmediate := "lvms-88799-delete-immediate"
+		scDeleteImmediate := fmt.Sprintf("lvms-88799-delete-immediate-%s", uniqueSuffix[:10])
@@
-		scRetainWFFC := "lvms-88799-retain-wffc"
+		scRetainWFFC := fmt.Sprintf("lvms-88799-retain-wffc-%s", uniqueSuffix[:10])

Also applies to: 5105-5116

🤖 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/integration/qe_tests/lvms.go` around lines 5055 - 5066, The StorageClass
names (e.g., the scDeleteImmediate variable used in the createStorageClassWithOC
call and its matching deleteSpecifiedResource defer) are fixed and must be made
unique by appending the existing uniqueSuffix; update each cluster-scoped
StorageClass name assignment (e.g., scDeleteImmediate and the other SC variables
around lines 5105-5116) to include "+" uniqueSuffix (or fmt.Sprintf("%s-%s",
name, uniqueSuffix)) and ensure the same unique name is passed into
createStorageClassWithOC and deleteSpecifiedResource so creation and cleanup use
the identical, unique identifier.

Comment thread test/integration/qe_tests/lvms.go Outdated
Comment thread test/integration/qe_tests/lvms.go
Comment thread test/integration/qe_tests/lvms.go
Comment thread test/integration/qe_tests/lvms_utils.go Outdated
Comment thread test/integration/qe_tests/lvms_utils.go Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
test/integration/qe_tests/lvms.go (1)

5046-5049: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Use a unique namespace name to avoid test collisions.

testNs := "lvms-test-88799" is static and can collide across reruns/parallel jobs, causing flaky AlreadyExists failures.

Suggested diff
-		testNs := "lvms-test-88799"
+		testNs := fmt.Sprintf("lvms-test-88799-%d", time.Now().UnixNano())
🤖 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/integration/qe_tests/lvms.go` around lines 5046 - 5049, The test uses a
static namespace name via the testNs variable which can cause AlreadyExists
collisions; change the setup to generate a unique namespace name for each run
(e.g., append a timestamp/UUID/random suffix) where testNs is assigned before
calling createNamespaceWithOC, so createNamespaceWithOC(testNs) and the deferred
deleteSpecifiedResource("namespace", testNs, "") use that generated unique name.
🤖 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/integration/qe_tests/lvms.go`:
- Around line 5046-5049: The test uses a static namespace name via the testNs
variable which can cause AlreadyExists collisions; change the setup to generate
a unique namespace name for each run (e.g., append a timestamp/UUID/random
suffix) where testNs is assigned before calling createNamespaceWithOC, so
createNamespaceWithOC(testNs) and the deferred
deleteSpecifiedResource("namespace", testNs, "") use that generated unique name.

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: cebbfdcf-452e-4cbb-ac6e-d55977a87ecf

📥 Commits

Reviewing files that changed from the base of the PR and between 8f23d88 and e7e39ac.

📒 Files selected for processing (3)
  • test/integration/qe_tests/lvms.go
  • test/integration/qe_tests/lvms_utils.go
  • test/integration/qe_tests/testdata/storageclass-template.yaml

@pacevedom
Copy link
Copy Markdown
Contributor

/retest

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 29, 2026

@mmakwana30: The following tests 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-aws-hypershift e7e39ac link true /test e2e-aws-hypershift
ci/prow/snyk-deps e7e39ac link false /test snyk-deps
ci/prow/unit-test e7e39ac link true /test unit-test
ci/prow/e2e-aws-single-node e7e39ac link true /test e2e-aws-single-node
ci/prow/e2e-aws e7e39ac link true /test e2e-aws

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

size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants