Repository navigation
feat: MTV-569: Add concurrent XCOPY and VDDK migration test - #289
Conversation
|
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
Label Management
✅ Merge RequirementsThis PR will be automatically approved when the following conditions are met:
📊 Review ProcessApprovers and ReviewersApprovers:
Reviewers:
Available Labels
💡 Tips
For more information, please refer to the project documentation or contact the maintainers. |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
💡 Tool usage guide:Overview: The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on any PR.
See the review usage page for a comprehensive guide on using this tool. |
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds a new test class to run concurrent XCOPY (copyoffload) and VDDK migrations, a concurrency-wait utility to assert multiple Plans reach Executing simultaneously, and a test config entry for the concurrent migration scenario. Changes
Sequence Diagram(s)sequenceDiagram
participant TestRunner as Test Runner
participant API as OpenShift API
participant SrcProv as Source Provider
participant DstProv as Destination Provider
TestRunner->>API: create storagemap (xcopy)
TestRunner->>API: create storagemap (vddk)
TestRunner->>API: create networkmap (xcopy)
TestRunner->>API: create networkmap (vddk)
TestRunner->>API: create plan_xcopy
TestRunner->>API: create plan_vddk
TestRunner->>API: start migration (plan_xcopy)
TestRunner->>API: start migration (plan_vddk)
loop poll (wait_for_concurrent_migration_execution)
API->>TestRunner: return plan statuses
TestRunner-->API: continue polling / assert states
end
TestRunner->>API: assert both plans = Executing
API->>DstProv: provision migrated VMs
TestRunner->>DstProv: validate migrated VMs (disk count, connectivity)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 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 |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
💡 Tool usage guide:Overview: The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on any PR.
See the review usage page for a comprehensive guide on using this tool. |
PR Code Suggestions ✨Latest suggestions up to 99d345d
Previous suggestionsSuggestions up to commit cb77c50
✅ Suggestions up to commit 627d1fe
✅ Suggestions up to commit db02ea8
✅ Suggestions up to commit 92a786d
✅ Suggestions up to commit 98be08a
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
d8a2c33 to
319a497
Compare
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
💡 Tool usage guide:Overview: The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on any PR.
See the review usage page for a comprehensive guide on using this tool. |
|
/verified |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Fix all issues with AI agents
In `@tests/test_copyoffload_migration.py`:
- Around line 3255-3258: The assertion currently accesses offloadPlugin via
attribute access on self.storage_map_xcopy.instance.spec.map[0].offloadPlugin
which can raise AttributeError; change it to use dict-style access/ResourceField
get (e.g., self.storage_map_xcopy.instance.spec.map[0].get('offloadPlugin')) so
the assertion fails with your custom message if the key is missing (follow the
same pattern used in the VDDK check below), keeping the same assertion text.
- Around line 3214-3227: Update the one-line docstring of the
test_create_storagemap_xcopy function to the project's Args/Returns/Raises
format: expand the docstring to describe the purpose briefly and add an "Args"
section listing each fixture parameter (prepared_plan_1, fixture_store,
ocp_admin_client, source_provider, destination_provider,
source_provider_inventory, target_namespace, source_provider_data,
copyoffload_storage_secret) with their types, a "Returns" section (e.g., None),
and a "Raises" section indicating any expected exceptions (or "None" if none
expected); keep the text concise and consistent with other tests in this class
and use the exact function name test_create_storagemap_xcopy to locate where to
update.
In `@utilities/mtv_migration.py`:
- Around line 547-560: The docstring for wait_for_concurrent_migration_execution
is missing a Returns section; update the docstring for the function
wait_for_concurrent_migration_execution to include a Returns entry that states
it returns None and briefly describes the meaning (e.g., "None: returns nothing;
raises AssertionError on failure") so the docstring follows the project's
Args/Returns/Raises format.
319a497 to
40203b1
Compare
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
💡 Tool usage guide:Overview: The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on any PR.
See the review usage page for a comprehensive guide on using this tool. |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
💡 Tool usage guide:Overview: The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on any PR.
See the review usage page for a comprehensive guide on using this tool. |
|
/verified |
|
/approve |
|
Failed to build and push ghcr.io/redhatqe/mtv-api-tests:latest |


User description
Summary
This PR adds a new test
TestConcurrentXcopyVddkMigrationto validate the simultaneous execution of an XCOPY-based migration plan and a VDDK-based migration plan.Key changes:
TestConcurrentXcopyVddkMigrationclass intests/test_copyoffload_migration.py.wait_for_concurrent_migration_executionutility inutilities/mtv_migration.pyto handle simultaneous execution verification, replacing duplicated logic.TestSimultaneousCopyoffloadMigrationsto use the new utility.offloadPluginpresence/absence in StorageMaps to distinguish between XCOPY and VDDK plans.tests/tests_config/config.pywith the new test configuration.Test plan
pytest tests/test_copyoffload_migration.py::TestConcurrentXcopyVddkMigrationoffloadPluginconfigured in its StorageMap.offloadPluginconfigured in its StorageMap.PR Type
Enhancement, Tests
Description
Add new test class
TestConcurrentXcopyVddkMigrationvalidating simultaneous XCOPY and VDDK migrationsExtract concurrent migration validation logic into reusable
wait_for_concurrent_migration_executionutility functionRefactor
TestSimultaneousCopyoffloadMigrationsto use new shared utility, eliminating code duplicationAdd validation for
offloadPluginpresence in XCOPY StorageMaps and absence in VDDK StorageMapsDiagram Walkthrough
File Walkthrough
test_copyoffload_migration.py
Add concurrent XCOPY/VDDK test class and refactor validation logictests/test_copyoffload_migration.py
TestConcurrentXcopyVddkMigrationwith 8 testmethods for concurrent XCOPY and VDDK migration validation
TestSimultaneousCopyoffloadMigrations.test_migrate_vms_simultaneouslywait_for_concurrent_migration_executionutility functionwait_for_concurrent_migration_executionfromutilities
EARLY_COMPLETION_MSGerror message template constantconfig.py
Add test configuration for concurrent XCOPY/VDDK migrationtests/tests_config/config.py
test_concurrent_xcopy_vddk_migrationwithtwo VM definitions
test setup
mtv_migration.py
Add concurrent migration execution validation utility functionutilities/mtv_migration.py
wait_for_concurrent_migration_executionfunction to handlesimultaneous plan execution validation
(default 120 seconds)
before any completes
completion is detected
_check_plan_statusto determine plan statusfrom conditions
Summary by CodeRabbit
Tests
Chores