add: hotplug persist, migrate, and reboot conformance tests with 4 disks#5597
add: hotplug persist, migrate, and reboot conformance tests with 4 disks#5597Ahmad-Hafe wants to merge 1 commit into
Conversation
|
Warning Review limit reached
Next review available in: 50 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe hotplug serial-persistence tests now create three blank DataVolumes, attach them to an explicitly configured Fedora VM, validate serial behavior, conditionally test migration, and verify serial persistence after reboot. ChangesSerial persistence hotplug workflow
Estimated code review effort: 4 (Complex) | ~40 minutes Possibly related PRs
Suggested reviewers: Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (1 error)
✅ Passed checks (5 passed)
✨ 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 |
|
D/S test |
a6a09bd to
a7fb95d
Compare
|
D/S test |
a7fb95d to
6dbcbd9
Compare
6dbcbd9 to
91c6043
Compare
|
D/S test |
91c6043 to
96ed839
Compare
96ed839 to
4857e34
Compare
|
D/S test |
|
Report bugs in Issues Welcome! 🎉This pull request will be automatically processed with the following features: 🔄 Automatic Actions
📋 Available CommandsPR Status Management
Review & Approval
Testing & Validation
Container Operations
Cherry-pick Operations
Branch Management
Label Management
✅ Merge RequirementsThis PR will be automatically approved when the following conditions are met:
📊 Review ProcessApprovers and ReviewersApprovers:
Reviewers:
Available Labels
AI Features
Security Checks
💡 Tips
📌 Additional InformationCustom Commands:
For more information, please refer to the project documentation or contact the maintainers. |
There was a problem hiding this comment.
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 `@tests/storage/test_hotplug.py`:
- Around line 282-293: Remove the redundant class-level
`@pytest.mark.usefixtures`("vm_with_hotplugged_disks_scope_class") from
TestHotPlugWithSerialPersist, while keeping the explicit fixture parameters on
test_hotplug_volume_with_serial_and_persist and
test_hotplug_volume_with_serial_and_persist_migrate unchanged.
- Around line 292-293: Update assert_hotplugvolume_nonexist and its call site in
the hotplug test to identify the target volume by name rather than assuming
volumeStatus[0]. Pass the expected volume name into the helper or iterate
volumeStatus entries to find it, then validate that matched volume’s hotplug
state so the persist case checks the correct disk.
🪄 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: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 4c719141-5fce-43f7-ba53-58a47aa41d4b
📒 Files selected for processing (2)
tests/storage/constants.pytests/storage/test_hotplug.py
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
RedHatQE/openshift-virtualization-tests-design-docs(manual)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5597 +/- ##
=======================================
Coverage 98.67% 98.68%
=======================================
Files 25 42 +17
Lines 2487 2504 +17
=======================================
+ Hits 2454 2471 +17
Misses 33 33
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Clean rebase detected — no code changes compared to previous head ( |
There was a problem hiding this comment.
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 `@tests/storage/test_hotplug.py`:
- Around line 285-294: Add a concise comment immediately before the dependency
decorator for test_hotplug_volume_with_serial_and_persist_migrate, explaining
that migration relies on the hotplugged and persisted disks validated by
test_hotplug_volume_with_serial_and_persist. Keep the existing dependency
configuration unchanged.
In `@utilities/storage.py`:
- Around line 809-813: Update assert_hotplugvolume_nonexist to perform the
HOTPLUG_VOLUME membership check against volume_status_entry.keys() rather than
the ResourceField-backed object itself, preserving the existing assertion
message and behavior.
🪄 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: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: a540a9fa-0cbc-499d-aaa5-f76fe7f482d4
📒 Files selected for processing (3)
tests/storage/constants.pytests/storage/test_hotplug.pyutilities/storage.py
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
RedHatQE/openshift-virtualization-tests-design-docs(manual)
|
/retest all Auto-triggered: Files in this PR were modified by merged PR #5606. Overlapping filestests/storage/test_hotplug.py |
|
/test-plan |
Test execution plan request detailsCRITICAL: You MUST post an inline review comment on the first changed line of the first file. As an expert software testing engineer, analyze all modified files in this PR and create a targeted test execution plan. Analysis Requirements:
Output rules: Your deliverable: Test Execution Plan
Use these formats:
Real test commands (MANDATORY when changes affect session/runtime code): When the affected code runs at session/collection time (conftest fixtures, pytest plugins,
Example output for a session-startup fix: Guidelines:
Hardware-Related Checks (SR-IOV, GPU, DPDK): When PR modifies fixtures for hardware-specific resources:
CRITICAL WORKFLOW COMPLETION RULES: When responding to this test execution plan request, you MUST follow these rules EXACTLY:
ABSOLUTE PROHIBITIONS (violating these creates empty/meaningless reviews):
Remember: The pull request review is visible to users. Additional comments are redundant noise. CRITICAL — Verification rules for smoke and gating decisions: |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
git fetch origin pull/5597/head:pr5597 2>&1 | tail -5
git checkout pr5597 2>&1 | tail -5
echo "---diff files---"
git diff main...pr5597 --stat
echo "---diff constants---"
git diff main...pr5597 -- tests/storage/constants.py
echo "---diff storage.py---"
git diff main...pr5597 -- utilities/storage.py
echo "---first changed file first hunk---"
git diff main...pr5597 -- tests/storage/constants.py | head -30Length of output: 2454 🏁 Script executed: #!/bin/bash
set -euo pipefail
rg -n "assert_hotplugvolume_nonexist" --type py
echo "---smoke---"
rg -l '`@pytest.mark.smoke`' tests/storage || true
echo "---gating---"
rg -l '`@pytest.mark.gating`' tests/storage/test_hotplug.py || true
echo "---markers in test_hotplug---"
rg -n "pytest.mark" tests/storage/test_hotplug.pyLength of output: 2336 🏁 Script executed: #!/bin/bash
set -euo pipefail
gh api repos/RedHatQE/openshift-virtualization-tests/pulls/5597/files --paginate --jq '.[] | {filename, patch}' 2>&1 | head -200Length of output: 8617 🏁 Script executed: #!/bin/bash
set -euo pipefail
gh api repos/RedHatQE/openshift-virtualization-tests/pulls/5597/files --paginate --jq '.[] | select(.filename=="utilities/storage.py") | .patch'
echo "---search callers---"
gh api -X GET search/code -f q='assert_hotplugvolume_nonexist repo:RedHatQE/openshift-virtualization-tests' --jq '.items[].path' 2>&1 || true
echo "---first line file---"
gh api repos/RedHatQE/openshift-virtualization-tests/pulls/5597/files --paginate --jq '.[0].filename, .[0].patch' | head -20Length of output: 995 🏁 Script executed: #!/bin/bash
set -euo pipefail
gh api repos/RedHatQE/openshift-virtualization-tests/pulls/5597/files --paginate | python3 -c "
import json,sys
data = json.load(sys.stdin)
for f in data:
if f['filename']=='utilities/storage.py':
print(f.get('patch',''))
"
echo "---upgrade storage usage---"
gh api repos/RedHatQE/openshift-virtualization-tests/contents/tests/storage/upgrade/test_upgrade_storage.py --jq '.content' | base64 -d | grep -n -B3 -A3 "assert_hotplugvolume_nonexist"
echo "---markers hotplug/upgrade---"
gh api repos/RedHatQE/openshift-virtualization-tests/contents/tests/storage/upgrade/test_upgrade_storage.py --jq '.content' | base64 -d | grep -n "pytest.mark"Length of output: 3151
Test Execution Plan
Affected tests to run
Real tests (cluster required) Happy path (regression, new multi-disk fixture and updated Migration path: Upgrade-utility regression check (unchanged single-disk case): [resolve] |
|
/build-and-push-container |
|
New container for quay.io/openshift-cnv/openshift-virtualization-tests:pr-5597 published |
|
/verified tests/storage/test_hotplug.py::TestHotPlugWithSerialPersist::test_hotplug_volume_with_serial_and_persist I also executed the tests is self valdation and confrom it works |
Test execution plan request detailsCRITICAL: You MUST post an inline review comment on the first changed line of the first file. As an expert software testing engineer, analyze all modified files in this PR and create a targeted test execution plan. Analysis Requirements:
Output rules: Your deliverable: Test Execution Plan
Use these formats:
Real test commands (MANDATORY when changes affect session/runtime code): When the affected code runs at session/collection time (conftest fixtures, pytest plugins,
Example output for a session-startup fix: Guidelines:
Hardware-Related Checks (SR-IOV, GPU, DPDK): When PR modifies fixtures for hardware-specific resources:
CRITICAL WORKFLOW COMPLETION RULES: When responding to this test execution plan request, you MUST follow these rules EXACTLY:
ABSOLUTE PROHIBITIONS (violating these creates empty/meaningless reviews):
Remember: The pull request review is visible to users. Additional comments are redundant noise. CRITICAL — Verification rules for smoke and gating decisions: |
|
Test Execution Plan
Affected tests to run
Real tests (cluster required) Happy path (regression, new multi-disk fixture and updated Migration path: Upgrade-utility regression check (unchanged single-disk case): Note: this is identical to the plan already posted for this PR since no new code changes were introduced (the last activity was a container build/publish and manual ✅ Action performedComments resolved and changes approved. |
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 `@tests/storage/test_hotplug.py`:
- Around line 304-311: Update the hotplug migration test flow around
is_dv_migratable and migrate_vm_and_verify so non-migratable storage is
explicitly gated or visibly reported rather than silently returning; ensure the
test is not presented as coverage for the mixed RHCOS 9/10 P0 migration scenario
unless that topology is encoded.
🪄 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: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: a7c881be-13be-42ef-a78d-fefb6c86d1e0
📒 Files selected for processing (2)
tests/storage/constants.pytests/storage/test_hotplug.py
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
RedHatQE/openshift-virtualization-tests-design-docs(manual)
…ithSerialPersist (CNV-88911) Signed-off-by: Ahmad Hafe <ahafe@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
|
/verified |
Test execution plan request detailsCRITICAL: You MUST post an inline review comment on the first changed line of the first file. As an expert software testing engineer, analyze all modified files in this PR and create a targeted test execution plan. Analysis Requirements:
Output rules: Your deliverable: Test Execution Plan
Use these formats:
Real test commands (MANDATORY when changes affect session/runtime code): When the affected code runs at session/collection time (conftest fixtures, pytest plugins,
Example output for a session-startup fix: Guidelines:
Hardware-Related Checks (SR-IOV, GPU, DPDK): When PR modifies fixtures for hardware-specific resources:
CRITICAL WORKFLOW COMPLETION RULES: When responding to this test execution plan request, you MUST follow these rules EXACTLY:
ABSOLUTE PROHIBITIONS (violating these creates empty/meaningless reviews):
Remember: The pull request review is visible to users. Additional comments are redundant noise. CRITICAL — Verification rules for smoke and gating decisions: |
|
Test Execution Plan
Affected tests to run
Real tests (cluster required) Happy path (regression, new multi-disk fixture and updated Migration path: Upgrade-utility regression check (unchanged single-disk case): Note: no new code changes since the last identical plan; this reflects the current diff state (Ahmad-Hafe's second ✅ Action performedComments resolved and changes approved. |
|
|
||
| LOGGER = logging.getLogger(__name__) | ||
|
|
||
| BLANK_DV_SIZE = "1Gi" |
There was a problem hiding this comment.
Move it outside to tests/storage/constants.py and combine it with BLANK_DV_SIZE in tests/storage/test_wffc.py.
| vm_instance_type=VirtualMachineClusterInstancetype(name=U1_SMALL, client=unprivileged_client), | ||
| vm_preference=VirtualMachineClusterPreference(name=OS_FLAVOR_FEDORA, client=unprivileged_client), |
There was a problem hiding this comment.
Inference from volume will use the values in the volume annotation instancetype.kubevirt.io/default :
| vm_instance_type=VirtualMachineClusterInstancetype(name=U1_SMALL, client=unprivileged_client), | |
| vm_preference=VirtualMachineClusterPreference(name=OS_FLAVOR_FEDORA, client=unprivileged_client), | |
| vm_instance_type_infer=True | |
| vm_preference_infer=True |
What this PR does / why we need it:
Expands
TestHotPlugWithSerialPersistfrom 1 hotplugged disk to 3 (4 total with boot disk) and adds a reboot-persistence test for cloud provider conformance coverage (CNV-88911).What changed:
fedora_vm_for_hotplug_scope_classmodernized: replacesfedora_vm_body()+is_jira_openworkaround with golden image DataSource,U1_SMALLinstance type, andOS_FLAVOR_FEDORApreferenceblank_dvs_for_hotplug_scope_class— creates 3 blank 1Gi DVs viacontextlib.ExitStackfor proper cleanup on partial failurevm_with_hotplugged_disks_scope_class— hotplugs all 3 DVs with persist (first gets serial), waits for each to be ready before proceedingTestHotPlugWithSerialPersistno longer parametrized overhotplug_volume_scope_class; setup is now fully encapsulated in the new fixturesTestHotPlugWithSerialPersist::test_hotplug_volume_with_serial_and_persist) to avoid collisions with other classestest_hotplug_persist_survives_reboot— reboots the VM after persist, verifies all 3 hotplugged disks survive the restart and serial is preserved. Covers the "Make permanent (reboot, and we see it)" conformance requirement.Which issue(s) this PR fixes:
Expands coverage for:
Special notes for reviewer:
The tests have no external registry dependencies (no quay.io, no artifactory). They use only golden images (already on the cluster) and blank DataVolumes, making them suitable for self-validation runs.
jira-ticket:
https://redhat.atlassian.net/browse/CNV-92782
https://redhat.atlassian.net/browse/CNV-88911