Skip to content

[CCLM] Add cross-storage cross-cluster migration tests#4650

Open
jpeimer wants to merge 3 commits into
RedHatQE:mainfrom
jpeimer:cclm_cross_storage
Open

[CCLM] Add cross-storage cross-cluster migration tests#4650
jpeimer wants to merge 3 commits into
RedHatQE:mainfrom
jpeimer:cclm_cross_storage

Conversation

@jpeimer
Copy link
Copy Markdown
Contributor

@jpeimer jpeimer commented Apr 29, 2026

Short description:
  • Make source and target storage classes configurable for CCLM
  • Add a CCLM test where the source storage class and the target storage class are different.

Jira: https://redhat.atlassian.net/browse/CNV-60016
split to: https://redhat.atlassian.net/browse/CNV-79287

More details:
What this PR does / why we need it:
Which issue(s) this PR fixes:
Special notes for reviewer:
jira-ticket:

Summary by CodeRabbit

  • New Features

    • Added a focused cross-cluster live-migration test suite for migrations from storage class A to B with end-to-end verification.
    • Tests now pick source/target storage classes dynamically from available cluster storage classes.
  • Tests

    • Centralized storage-class identifiers and a shared validation helper to standardize behavior and error messaging.
    • Expanded parametrization and fixtures to support flexible storage-class scenarios across migration tests.

Assisted-by: Claude noreply@anthropic.com

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 29, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: dd85b4fa-40d0-40dd-9c8d-1683fa10e9d7

📥 Commits

Reviewing files that changed from the base of the PR and between efa19a8 and 4165c05.

📒 Files selected for processing (8)
  • tests/storage/constants.py
  • tests/storage/cross_cluster_live_migration/conftest.py
  • tests/storage/cross_cluster_live_migration/test_cclm.py
  • tests/storage/storage_migration/conftest.py
  • tests/storage/storage_migration/constants.py
  • tests/storage/storage_migration/test_storage_class_migration.py
  • tests/storage/storage_migration/utils.py
  • tests/storage/utils.py
💤 Files with no reviewable changes (2)
  • tests/storage/storage_migration/constants.py
  • tests/storage/storage_migration/utils.py

📝 Walkthrough

Walkthrough

Centralizes storage-class constants and the migration validation helper into shared tests/storage modules; removes the duplicate helper; updates imports; adds fixtures and parametrized tests for cross-cluster A→B storage-class selection and a new CCLM test suite.

Changes

Shared utils consolidation

Layer / File(s) Summary
Add shared storage constants
tests/storage/constants.py
Adds STORAGE_CLASS_A, STORAGE_CLASS_B, and NO_STORAGE_CLASS_FAILURE_MESSAGE for standardized storage-class identifiers and failure text.
Add shared validation helper
tests/storage/utils.py
Adds pytest import, imports NO_STORAGE_CLASS_FAILURE_MESSAGE, and implements get_storage_class_for_storage_migration(storage_class, cluster_storage_classes_names) which calls pytest.fail() when the requested class is absent.
Remove duplicate helper
tests/storage/storage_migration/utils.py
Removes the locally defined get_storage_class_for_storage_migration and its related imports; other utilities remain.
Redirect imports to shared modules
tests/storage/storage_migration/conftest.py, tests/storage/storage_migration/test_storage_class_migration.py
Update import sources so tests and conftests use the shared helper and constants from tests.storage.utils / tests.storage.constants.
CCLM: dynamic storage-class fixtures and tests
tests/storage/cross_cluster_live_migration/conftest.py, tests/storage/cross_cluster_live_migration/test_cclm.py
Add remote/local storage-class discovery fixtures, resolve source/target classes via shared helper, propagate into StorageMap and VM/DataVolume fixtures, and add TestCCLMFromStorageAtoB plus updated parametrizations to exercise A→B migrations.
Remove old constants
tests/storage/storage_migration/constants.py
Delete STORAGE_CLASS_A, STORAGE_CLASS_B, and NO_STORAGE_CLASS_FAILURE_MESSAGE from the storage_migration-specific constants module.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related issues

Suggested labels

new-tests

Suggested reviewers

  • kgoldbla
  • josemacassan
  • kshvaika
  • dalia-frank
  • Ahmad-Hafe
  • acinko-rh
  • servolkov

Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error, 1 inconclusive)

Check name Status Explanation Resolution
Stp Link Required ❌ Error New test class TestCCLMFromStorageAtoB with 7 test methods added to test_cclm.py lacks required STP/RFE/Jira documentation in docstrings; @pytest.mark.polarion decorator does not satisfy requirement. Add docstrings with STP/RFE/Jira links to TestCCLMFromStorageAtoB class and/or its test methods, e.g., class docstring with 'Jira: https://...' or per-method docstrings.
Description check ❓ Inconclusive The PR description includes essential information (what it does, Jira link) but leaves several required template sections empty (issue fixes, special notes, complete jira-ticket field). Complete the empty template sections: fill 'Which issue(s) this PR fixes' with CNV-79287, expand 'What this PR does / why we need it', and ensure the 'jira-ticket' field contains the full URL.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding cross-storage cross-cluster migration tests to CCLM functionality.
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.
✨ 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-virtualization-qe-bot-5
Copy link
Copy Markdown

Report bugs in Issues

Welcome! 🎉

This pull request will be automatically processed with the following features:

🔄 Automatic Actions

  • Reviewer Assignment: Reviewers are automatically assigned based on the OWNERS file in the repository root
  • Size Labeling: PR size labels (XS, S, M, L, XL, XXL) are automatically applied based on changes
  • Issue Creation: A tracking issue is created for this PR and will be closed when the PR is merged or closed
  • Branch Labeling: Branch-specific labels are applied to track the target branch
  • Auto-verification: Auto-verified users have their PRs automatically marked as verified
  • Labels: Enabled categories: branch, can-be-merged, cherry-pick, has-conflicts, hold, needs-rebase, size, verified, wip

📋 Available Commands

PR Status Management

  • /wip - Mark PR as work in progress (adds WIP: prefix to title)
  • /wip cancel - Remove work in progress status
  • /hold - Block PR merging (approvers only)
  • /hold cancel - Unblock PR merging
  • /verified - Mark PR as verified
  • /verified cancel - Remove verification status
  • /reprocess - Trigger complete PR workflow reprocessing (useful if webhook failed or configuration changed)
  • /regenerate-welcome - Regenerate this welcome message

Review & Approval

  • /lgtm - Approve changes (looks good to me)
  • /approve - Approve PR (approvers only)
  • /assign-reviewers - Assign reviewers based on OWNERS file
  • /assign-reviewer @username - Assign specific reviewer
  • /check-can-merge - Check if PR meets merge requirements

Testing & Validation

  • /retest tox - Run Python test suite with tox
  • /retest build-container - Rebuild and test container image
  • /retest verify-bugs-are-open - verify-bugs-are-open
  • /retest all - Run all available tests

Container Operations

  • /build-and-push-container - Build and push container image (tagged with PR number)
    • Supports additional build arguments: /build-and-push-container --build-arg KEY=value

Cherry-pick Operations

  • /cherry-pick <branch> - Schedule cherry-pick to target branch when PR is merged
    • Multiple branches: /cherry-pick branch1 branch2 branch3

Label Management

  • /<label-name> - Add a label to the PR
  • /<label-name> cancel - Remove a label from the PR

✅ Merge Requirements

This PR will be automatically approved when the following conditions are met:

  1. Approval: /approve from at least one approver
  2. LGTM Count: Minimum 2 /lgtm from reviewers
  3. Status Checks: All required status checks must pass
  4. No Blockers: No wip, hold, has-conflicts labels and PR must be mergeable (no conflicts)
  5. Verified: PR must be marked as verified

📊 Review Process

Approvers and Reviewers

Approvers:

  • jpeimer

Reviewers:

  • Ahmad-Hafe
  • acinko-rh
  • dalia-frank
  • ema-aka-young
  • josemacassan
  • jpeimer
  • kgoldbla
  • kshvaika
Available Labels
  • hold
  • verified
  • wip
  • lgtm
  • approve
AI Features
  • Cherry-Pick Conflict Resolution: Enabled (claude/claude-opus-4-6[1m])

💡 Tips

  • WIP Status: Use /wip when your PR is not ready for review
  • Verification: The verified label is removed on new commits unless the push is detected as a clean rebase
  • Cherry-picking: Cherry-pick labels are processed when the PR is merged
  • Container Builds: Container images are automatically tagged with the PR number
  • Permission Levels: Some commands require approver permissions
  • Auto-verified Users: Certain users have automatic verification and merge privileges

For more information, please refer to the project documentation or contact the maintainers.

Copy link
Copy Markdown
Contributor

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tests/storage/cross_cluster_live_migration/test_cclm.py (1)

1-17: ⚠️ Potential issue | 🟠 Major

HIGH: Add module-level traceability for the new CCLM suite.

This file adds a new feature test suite, but there is no module docstring with an STP link or Jira/RFE fallback. The repo requires that traceability for new feature tests so coverage can be tracked. As per coding guidelines, new feature tests MUST include an STP link in the module docstring; if no STP exists, include the Jira/RFE link instead.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/storage/cross_cluster_live_migration/test_cclm.py` around lines 1 - 17,
The module lacks the required traceability docstring; add a module-level
docstring at the top of the file (above imports) that includes the STP link for
this CCLM test suite (or a Jira/RFE link if no STP exists) so the new feature
tests (e.g., TESTS_CLASS_NAME_SEVERAL_VMS, TESTS_CLASS_NAME_WINDOWS_VM,
TESTS_CLASS_NAME_STORAGE_A_TO_B) are traceable; ensure the docstring is succinct
and clearly labeled as the STP/Jira reference for this test module.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@tests/storage/cross_cluster_live_migration/test_cclm.py`:
- Around line 1-17: The module lacks the required traceability docstring; add a
module-level docstring at the top of the file (above imports) that includes the
STP link for this CCLM test suite (or a Jira/RFE link if no STP exists) so the
new feature tests (e.g., TESTS_CLASS_NAME_SEVERAL_VMS,
TESTS_CLASS_NAME_WINDOWS_VM, TESTS_CLASS_NAME_STORAGE_A_TO_B) are traceable;
ensure the docstring is succinct and clearly labeled as the STP/Jira reference
for this test module.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: f86f8ea7-076e-4166-bebd-0c5d30ab449c

📥 Commits

Reviewing files that changed from the base of the PR and between 9e23371 and 320d12a.

📒 Files selected for processing (8)
  • tests/storage/constants.py
  • tests/storage/cross_cluster_live_migration/conftest.py
  • tests/storage/cross_cluster_live_migration/test_cclm.py
  • tests/storage/storage_migration/conftest.py
  • tests/storage/storage_migration/constants.py
  • tests/storage/storage_migration/test_storage_class_migration.py
  • tests/storage/storage_migration/utils.py
  • tests/storage/utils.py
💤 Files with no reviewable changes (2)
  • tests/storage/storage_migration/constants.py
  • tests/storage/storage_migration/utils.py

@jpeimer
Copy link
Copy Markdown
Contributor Author

jpeimer commented Apr 29, 2026

/build-and-push-container

@openshift-virtualization-qe-bot-2
Copy link
Copy Markdown
Contributor

New container for quay.io/openshift-cnv/openshift-virtualization-tests:pr-4650 published

Comment thread tests/storage/cross_cluster_live_migration/test_cclm.py
Comment thread tests/storage/cross_cluster_live_migration/conftest.py
Comment thread tests/storage/cross_cluster_live_migration/conftest.py
Comment thread tests/storage/cross_cluster_live_migration/conftest.py
@josemacassan
Copy link
Copy Markdown
Contributor

/lgtm

@jpeimer
Copy link
Copy Markdown
Contributor Author

jpeimer commented Apr 29, 2026

/verified

openshift-virtualization-tests-runner/5084/
-m cclm

@openshift-virtualization-qe-bot
Copy link
Copy Markdown

D/S test tox -e verify-tc-requirement-polarion failed: cnv-tests-tox-executor/28713

jpeimer added 2 commits June 1, 2026 13:33
Signed-off-by: Jenia Peimer <jpeimer@redhat.com>
- Add type hints to remote_cluster_storage_classes_names fixture
- Add type hints to remote_cluster_source_storage_class fixture
- Add type hints to local_cluster_target_storage_class fixture
- Add docstring to get_storage_class_for_storage_migration()
- Add docstrings to all three new fixtures
- Fix line length in local_cluster_target_storage_class
- Remove unused constant TESTS_CLASS_NAME_STORAGE_B_TO_A

Assisted-by: Claude <noreply@anthropic.com>
Signed-off-by: Jenia Peimer <jpeimer@redhat.com>
@jpeimer jpeimer force-pushed the cclm_cross_storage branch from efa19a8 to 4165c05 Compare June 1, 2026 10:34
@openshift-virtualization-qe-bot-4
Copy link
Copy Markdown

Clean rebase detected — no code changes compared to previous head (efa19a8).

@openshift-virtualization-qe-bot
Copy link
Copy Markdown

D/S test tox -e verify-tc-requirement-polarion failed: cnv-tests-tox-executor/28716

@openshift-virtualization-qe-bot
Copy link
Copy Markdown

D/S test tox -e verify-tc-requirement-polarion failed: cnv-tests-tox-executor/28718

@openshift-virtualization-qe-bot
Copy link
Copy Markdown

D/S test tox -e verify-tc-requirement-polarion failed: cnv-tests-tox-executor/28721

@jpeimer
Copy link
Copy Markdown
Contributor Author

jpeimer commented Jun 4, 2026

Polarion was down, now when it's up, I re-triggered the check manually, it passed:
cnv-tests-tox-executor/28778

@openshift-virtualization-qe-bot-6
Copy link
Copy Markdown

Clean rebase detected — no code changes compared to previous head (4165c05).
The following labels were preserved: commented-jpeimer.

@openshift-virtualization-qe-bot-3
Copy link
Copy Markdown
Contributor

/retest all

Auto-triggered: Files in this PR were modified by merged PR #5099.

Overlapping files

tests/storage/utils.py

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.