Skip to content

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

Merged
rnetser merged 7 commits into
RedHatQE:mainfrom
jpeimer:cclm_cross_storage
Jun 16, 2026
Merged

[CCLM] Add cross-storage cross-cluster migration tests#4650
rnetser merged 7 commits into
RedHatQE:mainfrom
jpeimer:cclm_cross_storage

Conversation

@jpeimer

@jpeimer jpeimer commented Apr 29, 2026

Copy link
Copy Markdown
Contributor
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 cross-cluster live-migration test suite that migrates workloads from storage class A to storage class B and performs end-to-end verification.
  • Tests

    • Storage classes for migration tests are now selected dynamically based on the storage classes available in the participating clusters.
    • Centralized storage-class identifiers and standardized failure messaging when an invalid or unavailable storage class is requested.
    • Expanded parametrization and fixtures to cover remote source and local target storage-class combinations.

Assisted-by: Claude noreply@anthropic.com

@coderabbitai

coderabbitai Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@jpeimer, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 42 minutes and 34 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 87ba7152-2cf2-4451-8a0a-e0661d8e603f

📥 Commits

Reviewing files that changed from the base of the PR and between 5eba0a8 and c8d0058.

📒 Files selected for processing (1)
  • tests/storage/cross_cluster_live_migration/test_cclm.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 and CCLM updates

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 with pytest override instructions.
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() with a formatted message 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 unchanged.
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 and tests.storage.constants.
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.
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 imports for DynamicClient and StorageClass; introduce remote_cluster_storage_classes_names, remote_cluster_source_storage_class, and local_cluster_target_storage_class fixtures that resolve storage classes using the shared validation helper; update local_cluster_mtv_storage_map to use resolved classes and generate unique names; propagate remote_cluster_source_storage_class into VM/DataVolume fixtures; update test parametrizations for TestCCLMSeveralVMs and TestCCLMWindowsWithVTPM; add TestCCLMFromStorageAtoB test suite with ordered pytest dependencies covering migration, boot verification, file persistence, VM stopping, and cleanup.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Suggested labels

new-tests

Suggested reviewers

  • kgoldbla
  • ema-aka-young
  • dalia-frank
  • Ahmad-Hafe
  • acinko-rh
  • rnetser

Caution

Pre-merge checks failed

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

  • Ignore

❌ Failed checks (2 errors)

Check name Status Explanation Resolution
Description check ❌ Error The description has a short summary and Jira references but leaves critical template sections unfilled (What this PR does / why we need it, Special notes for reviewer, jira-ticket field). Complete all required template sections, particularly 'What this PR does / why we need it' (WHY is this needed?), 'Special notes for reviewer', and the 'jira-ticket' field with the full URL in the designated field.
Stp Link Required ❌ Error Module docstring in test_cclm.py has "Jira epic:" but check requires "Jira:" format. New TestCCLMFromStorageAtoB class and its test functions lack valid STP/RFE/Jira link. Change module docstring line 4 from "Jira epic:" to "Jira:" to match the required format for STP link validation.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding cross-storage cross-cluster migration tests with configurable storage classes for CCLM.
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

Warning

Review ran into problems

🔥 Problems

Linked repositories: Your configuration references 1 linked repositories, but your current plan allows 0. Analyzed ``, skipped RedHatQE/openshift-virtualization-tests-design-docs.


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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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

coderabbitai[bot]
coderabbitai Bot previously approved these changes Apr 29, 2026
@jpeimer

jpeimer commented Apr 29, 2026

Copy link
Copy Markdown
Contributor Author

/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

jpeimer commented Apr 29, 2026

Copy link
Copy Markdown
Contributor Author

/verified

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

@jpeimer

jpeimer commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

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

@openshift-virtualization-qe-bot-3

Copy link
Copy Markdown
Contributor

/retest all

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

Overlapping files

tests/storage/utils.py

Comment thread tests/storage/cross_cluster_live_migration/test_cclm.py
@openshift-virtualization-qe-bot-3

Copy link
Copy Markdown
Contributor

/retest all

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

Overlapping files

tests/storage/utils.py

jpeimer added 2 commits June 14, 2026 11:38
Assisted-by: Claude <noreply@anthropic.com>
Signed-off-by: Jenia Peimer <jpeimer@redhat.com>
@rnetser

rnetser commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator

Review Change Stack

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: d4003228-ffbb-455f-beaf-e87ab3cb2a89

📥 Commits
Reviewing files that changed from the base of the PR and between 4165c05 and 5eba0a8.

📒 Files selected for processing (2)

  • tests/storage/cross_cluster_live_migration/test_cclm.py
  • tests/storage/utils.py
 __________________________________________________________________________________________________________________________
< Unix was not designed to stop its users from doing stupid things, as that would also stop them from doing clever things. >
 --------------------------------------------------------------------------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ

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

Tip

CodeRabbit can use your project's pylint configuration to improve the quality of Python code reviews.

@coderabbitai
why you do no tupdate the checks after each commit?

@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

@rnetser — CodeRabbit's pre-merge checks are re-evaluated on every full review run. The reason they appear stale here is:

  1. Clean rebase detection skips the review. Several commits in this PR were detected as clean rebases (e.g., the bot posted "Clean rebase detected — no code changes compared to previous head"). When that happens, CodeRabbit intentionally skips re-running the review (and thus the checks) to avoid redundant noise, since no code actually changed.

  2. Rate limiting / incremental reviews. For non-rebase pushes, CodeRabbit only reviews the delta since the last reviewed commit. If the files that contain the failing checks (e.g., test_cclm.py for the STP link issue) weren't modified in a given push, the checks for those files won't be re-evaluated in that incremental run.

To force an immediate re-evaluation of all checks against the current HEAD, you can request a full review:

`@coderabbitai` full review

Or I can trigger it right now — just say the word.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

coderabbitai[bot]
coderabbitai Bot previously requested changes Jun 14, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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 `@tests/storage/cross_cluster_live_migration/test_cclm.py`:
- Around line 1-5: The module docstring in test_cclm.py currently references the
Jira epic as CNV-50823, but the PR description and commit message indicate the
correct epic is CNV-60016. Update the Jira epic URL in the module docstring at
the beginning of the file to reference CNV-60016 instead of CNV-50823 to ensure
consistency across the PR documentation and commit history.
🪄 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: d4003228-ffbb-455f-beaf-e87ab3cb2a89

📥 Commits

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

📒 Files selected for processing (2)
  • tests/storage/cross_cluster_live_migration/test_cclm.py
  • tests/storage/utils.py

Comment thread tests/storage/cross_cluster_live_migration/test_cclm.py
The Jira link is an epic tracker, not a bug — skip the
verify-bugs-are-open check so it is not flagged as unresolved.

Assisted-by: Claude <noreply@anthropic.com>
Signed-off-by: Jenia Peimer <jpeimer@redhat.com>
@openshift-virtualization-qe-bot

Copy link
Copy Markdown

/build-and-push-container

@openshift-virtualization-qe-bot

Copy link
Copy Markdown

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

@openshift-virtualization-qe-bot

Copy link
Copy Markdown

/verified

All tests passed for PR #4650.
Job: openshift-virtualization-tests-runner #5664

Execution details
pytest -s -o log_cli=true -m cclm
Image: openshift-virtualization-tests:pr-4650

@openshift-virtualization-qe-bot-3

Copy link
Copy Markdown
Contributor

@coderabbitai

Test execution plan request details

CRITICAL: You MUST post an inline review comment on the first changed line of the first file.
The inline comment should contain the full Test Execution Plan (smoke decision, gating decision, and specific affected tests).
Do NOT submit a blocking review event (REQUEST_CHANGES/APPROVE).
Post a single inline PR comment on Files Changed (non-blocking COMMENT flow).

As an expert software testing engineer, analyze all modified files in this PR and create a targeted test execution plan.
You will post an inline review comment with the test execution plan on the first changed file.
If you fail to run or post a comment, retry.

Analysis Requirements:

  1. Examine code changes in each modified file

  2. Identify affected code paths, functions, and classes

  3. Analyze pytest-specific elements: fixtures (scope, dependencies), parametrization, markers, conftest changes

  4. Trace test dependencies through imports, shared utilities, fixture inheritance, fixture teardown, and yield from cleanup in conftest

  5. Detect new tests introduced in the PR

  6. Utilities and libs impact (when utilities/ or libs/ changes):
    You MUST use shell scripts (rg, git diff) to trace the full impact.
    Follow these sub-steps in order:

    6a. Identify modified symbols: For each changed file under utilities/ or libs/,
    list every modified function or method.
    Example: git diff HEAD~1 --unified=0 -- utilities/hco.py | grep '^[+-]def '

    6b. Find direct callers: Search tests and conftest for each symbol from 6a.
    Example: rg -l 'get_hco_version' tests/

    6c. Trace fixture teardown and cleanup: Find fixtures that reach
    the modified symbol through yield from or context-manager wrappers.
    Example: rg -l 'yield from.*enable_common_boot|def.*enable_common_boot' tests/

    6d. Trace same-file callers: In each changed file, find other functions
    whose body calls a modified symbol (including code after yield
    in @contextmanager helpers).
    Example: rg 'get_hco_version|enable_common_boot' utilities/hco.py

    6e. Expand transitively: If function A calls modified B, then
    tests/fixtures that call A are affected — even when the test body
    never imports B directly.

    Do NOT limit impact to tests that import the modified symbol only.

  7. Smoke test impact: Intersect the affected set from step 6 with smoke-marked tests.
    Run: rg -l '@pytest.mark.smoke' tests/
    VERIFY the above command returned actual file paths before concluding False.
    Set True if either condition is met:

    • a smoke-marked file appears in the affected set from 6b-6e, OR
    • any conftest.py in the smoke test's parent-directory hierarchy (up to repo root)
      imports or calls a modified utilities/libs symbol — including autouse fixtures
      that depend on modified functions. ALL tests in that directory and below are affected.
      Example check: for each smoke_file, scan dirname(smoke_file)/conftest.py,
      dirname(dirname(smoke_file))/conftest.py, etc. for modified symbol imports
      and autouse fixtures that depend on modified symbols.
  8. Gating test impact: Intersect the affected set from step 6 with gating-marked tests.
    Run: rg -l '@pytest.mark.gating' tests/
    Set True if a gating-marked file also appears in the affected set from 6b-6e.
    Utilities/libs changes often affect gating tests without affecting smoke tests.
    Do NOT stop analysis after concluding Run smoke tests: False.

Output rules:
Do NOT include analysis step numbers (1-8) in your visible output.

Your deliverable:
Your inline informational comment will be based on the following requirements:

Test Execution Plan

  • Run smoke tests: True / False — If True, state the dependency path (test → fixture → changed symbol). True ONLY with a verified path.
  • Run gating tests: True / False — If True, state the dependency path. True if any gating-marked test is in the affected set.
  • Affected tests to run (required when utilities/, libs/, or shared conftest changes — list concrete paths even when smoke is False)

Use these formats:

  • path/to/test_file.py - When the entire test file needs verification
  • path/to/test_file.py::TestClass::test_method - When specific test(s) needed
  • path/to/test_file.py::test_function - When specific test(s) needed
  • -m marker - When a marker covers multiple affected tests (e.g. -m gating only if ALL gating tests in scope need run)
  • Tag each listed test or group with its marker when not obvious, e.g. (gating) or (smoke)

Real test commands (MANDATORY when changes affect session/runtime code):

When the affected code runs at session/collection time (conftest fixtures, pytest plugins,
config hooks, session-scoped setup) or modifies runtime behavior that unit tests mock away,
you MUST include concrete pytest commands the PR author must run on a real cluster
to verify the change works end-to-end. Include:

  • A command for the error/fix path (the scenario the PR fixes)
  • A command for the happy path (regression: the normal case still works)
  • Use lightweight tests (e.g., --collect-only for startup failures,
    a single small test for runtime behavior)
    If the PR only changes test logic (not utilities/libs/conftest), the affected test
    paths themselves serve as the real test commands — no separate section needed.

Example output for a session-startup fix:

**Real tests (cluster required)**
Error path (the fix):
`pytest tests/storage/.../test_foo.py --storage-class-matrix=nonexistent-sc --collect-only`
Expected: ValueError with clear message, not IndexError

Happy path (regression):
`pytest tests/storage/.../test_foo.py --storage-class-matrix=<valid-sc> -k test_bar`
Expected: session starts normally

Guidelines:

  • Include tests affected directly OR via fixture setup/teardown, yield from cleanup, or transitive utility call chains (caller calls modified helper)
  • Use a full file path only if ALL tests in that file require verification
  • Use file path + test name when only specific tests use an affected fixture or utility wrapper (preferred for partial file impact)
  • If a test marker can cover multiple files/tests, provide the marker
  • Balance coverage vs over-testing - Keep descriptions minimal
  • Example: if leaf helper foo() changes, include tests whose fixture teardown calls wrapper bar() where bar() calls foo(), even when the test body only imports an unrelated symbol from the same utilities module

Hardware-Related Checks (SR-IOV, GPU, DPDK):

When PR modifies fixtures for hardware-specific resources:

  • Collection Safety: Fixtures MUST have existence checks (return None when hardware unavailable)
  • Test Plan: MUST verify both WITH and WITHOUT hardware:
    • Run affected tests on cluster WITH hardware
    • Verify collection succeeds on cluster WITHOUT hardware

CRITICAL WORKFLOW COMPLETION RULES:

When responding to this test execution plan request, you MUST follow these rules EXACTLY:

  1. YOUR ONLY DELIVERABLE: Post one non-blocking inline comment containing the test execution plan on the first changed line
  2. THEN STOP IMMEDIATELY - Do NOT generate any additional response
  3. FALLBACK ONLY: If inline comment API calls fail after retrying, post as a regular PR comment
  4. SILENCE = SUCCESS: After successfully submitting the review, your task is complete. No confirmation needed.

ABSOLUTE PROHIBITIONS (violating these creates empty/meaningless reviews):

  • ❌ Do NOT post acknowledgment messages like "Test execution plan posted", "Review posted successfully", "I've successfully posted"
  • ❌ Do NOT mention review IDs, URLs, or confirmation of posting in the PR thread
  • ❌ Do NOT add any follow-up comments after submitting the review
  • ❌ Do NOT reply to confirm task completion
  • ❌ Do NOT explain what you did - just do it and stop

Remember: The pull request review is visible to users. Additional comments are redundant noise.

CRITICAL — Verification rules for smoke and gating decisions:
- For each True decision, you must have traced a concrete path: test file → fixture → utility function → modified symbol.
- Do NOT assume impact based on scope, file proximity, or infrastructure-sounding names.
Only set True when you trace a concrete path through steps 6a-6e, then 7 or 8.
WRONG: "utilities/hco.py changed → run smoke" (no traced dependency path)
WRONG: "Run smoke tests: False" with no affected-test list when gating tests use the changed utility
RIGHT: "Run smoke tests: False, Run gating tests: True" plus tests/.../test_foo.py::TestBar::test_baz (gating)
RIGHT: "Smoke test X uses fixture Y → wrapper Z → changed function W in utilities/hco.py"

Comment thread tests/storage/constants.py
@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Get HEAD commit SHA
git rev-parse HEAD

# Get first changed line of tests/storage/constants.py
git diff origin/main --unified=0 -- tests/storage/constants.py | head -20

# Check smoke tests
echo "=== Smoke test files ==="
rg -l '`@pytest.mark.smoke`' tests/

# Check gating tests
echo "=== Gating test files ==="
rg -l '`@pytest.mark.gating`' tests/

# Find callers of get_storage_class_for_storage_migration
echo "=== Callers of get_storage_class_for_storage_migration ==="
rg -n 'get_storage_class_for_storage_migration' tests/ --type=py -B2 -A2

# Check if any smoke/gating tests import from tests.storage.utils or tests.storage.constants
echo "=== Smoke/gating files importing from tests.storage.utils ==="
rg -l 'from tests.storage.utils|from tests\.storage import utils' tests/ --type=py

# Check storage_migration conftest callers
echo "=== storage_migration/conftest.py content for source/target storage class ==="
cat tests/storage/storage_migration/conftest.py | grep -A5 "storage_class"

# Check CCLM conftest for fixture names used by new tests
echo "=== CCLM conftest fixtures ==="
cat tests/storage/cross_cluster_live_migration/conftest.py

Length of output: 42417


🏁 Script executed:

#!/bin/bash
gh api \
  --method POST \
  /repos/RedHatQE/openshift-virtualization-tests/pulls/4650/reviews \
  --field commit_id="c8d00583cbf6b3a09a725b66fb118f951e1d0e8c" \
  --field event="COMMENT" \
  --field "comments[][path]=tests/storage/constants.py" \
  --field "comments[][line]=25" \
  --field "comments[][side]=RIGHT" \
  --field "comments[][body]=**Test Execution Plan**

- **Run smoke tests: False**
  Smoke tests (test_clone.py, test_upload_virtctl.py) import from \`tests.storage.utils\` but do not call \`get_storage_class_for_storage_migration\`. No traced dependency path from any smoke test to the modified/added symbols.

- **Run gating tests: False**
  Gating tests (test_hotplug.py, test_clone.py, test_upload_virtctl.py, test_import_http.py) import from \`tests.storage.utils\` but do not call \`get_storage_class_for_storage_migration\`. No traced dependency path.

- **Affected tests to run:**
  - \`-m cclm\` — covers \`TestCCLMFromStorageAtoB\` (new class), updated \`TestCCLMSeveralVMs\` and \`TestCCLMWindowsWithVTPM\` parametrizations in \`tests/storage/cross_cluster_live_migration/test_cclm.py\`; exercises new \`remote_cluster_source_storage_class\` / \`local_cluster_target_storage_class\` fixtures and updated \`local_cluster_mtv_storage_map\`
  - \`tests/storage/storage_migration/test_storage_class_migration.py\` — import path for \`STORAGE_CLASS_A\`/\`STORAGE_CLASS_B\` moved from \`tests.storage.storage_migration.constants\`\`tests.storage.constants\`"

Length of output: 3282



@josemacassan

Copy link
Copy Markdown
Contributor

/lgtm

@rnetser rnetser left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

/approve
/lgtm

@jpeimer

jpeimer commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

/check-can-merge

@jpeimer

jpeimer commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

/retest all

1 similar comment
@rnetser

rnetser commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

/retest all

@rnetser

rnetser commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

/security-override

@openshift-virtualization-qe-bot-2

Copy link
Copy Markdown
Contributor

Security checks overridden by @rnetser. Security check runs set to pass.

@openshift-virtualization-qe-bot-5

Copy link
Copy Markdown

Successfully removed PR tag: quay.io/openshift-cnv/openshift-virtualization-tests:pr-4650.

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.