Automate OCP-88799-Verify reclaimPolicy and volumeBindingMode combinations#2383
Automate OCP-88799-Verify reclaimPolicy and volumeBindingMode combinations#2383mmakwana30 wants to merge 1 commit into
Conversation
WalkthroughAdded 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. ChangesLVMS StorageClass Policy Test
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 8❌ Failed checks (1 warning, 7 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mmakwana30 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
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
📒 Files selected for processing (3)
test/integration/qe_tests/lvms.gotest/integration/qe_tests/lvms_utils.gotest/integration/qe_tests/testdata/storageclass-template.yaml
There was a problem hiding this comment.
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
📒 Files selected for processing (3)
test/integration/qe_tests/lvms.gotest/integration/qe_tests/lvms_utils.gotest/integration/qe_tests/testdata/storageclass-template.yaml
✅ Files skipped from review due to trivial changes (1)
- test/integration/qe_tests/testdata/storageclass-template.yaml
| 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, "") | ||
|
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
♻️ Duplicate comments (1)
test/integration/qe_tests/lvms.go (1)
5046-5049:⚠️ Potential issue | 🟠 Major | ⚡ Quick winUse a unique namespace name to avoid test collisions.
testNs := "lvms-test-88799"is static and can collide across reruns/parallel jobs, causing flakyAlreadyExistsfailures.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
📒 Files selected for processing (3)
test/integration/qe_tests/lvms.gotest/integration/qe_tests/lvms_utils.gotest/integration/qe_tests/testdata/storageclass-template.yaml
|
/retest |
|
@mmakwana30: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. |
Jira: https://redhat.atlassian.net/browse/OCPEDGE-2612
Logs: https://privatebin.corp.redhat.com/?997d713cea408dd4#5DHbHrhDAznEZ9bvTD89xdU1WTtQLCkDDgJYsjfcfhmi
Summary by CodeRabbit
Tests
Chores