Skip to content

Conversation

@vsibirsk
Copy link
Collaborator

@vsibirsk vsibirsk commented Nov 30, 2025

Short description:
  • Root cause fix is in python-wrapper (full details in jira ticket)
  • Refactor pause/unpause function names
  • drop optional migraion (never used)
  • remove admin_client dependency
More details:

Actual fix is in python-wrapper: RedHatQE/openshift-python-wrapper#2596

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

https://issues.redhat.com/browse/CNV-72168

Summary by CodeRabbit

  • Refactor

    • Simplified VM pause/unpause utilities by removing optional migration paths and renaming helper functions for clearer, more consistent behavior.
  • Tests

    • Updated tests to use the streamlined utilities across OS and GPU scenarios; removed expected-failure markers so previously quarantined pause/unpause tests now run as active tests.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Nov 30, 2025

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Multiple pause/unpause helpers were renamed to remove "optional_migrate" and migration parameters were removed; tests and utilities were updated to call the new functions and RHEL test imports/xfail decorators were adjusted.

Changes

Cohort / File(s) Summary
Core utilities & exports
utilities/virt.py, tests/virt/utils.py
Renamed pause_optional_migrate_unpause_and_check_connectivitypause_unpause_vm_and_check_connectivity. Renamed validate_pause_optional_migrate_unpause_linux_vmvalidate_pause_unpause_linux_vm and validate_pause_optional_migrate_unpause_windows_vmvalidate_pause_unpause_windows_vm. Removed migrate parameter and simplified connectivity checks (now use SSH wait).
Linux OS support tests
tests/infrastructure/instance_types/supported_os/test_rhel_os.py, tests/virt/cluster/common_templates/.../centos/test_centos_os_support.py, tests/virt/cluster/common_templates/.../fedora/test_fedora_os_support.py, tests/virt/cluster/common_templates/.../rhel/test_rhel_os_support.py
Replaced imports/call sites from validate_pause_optional_migrate_unpause_linux_vm to validate_pause_unpause_linux_vm. In RHEL test removed QUARANTINED import and removed @xfail from pause/unpause tests.
Windows OS support tests
tests/virt/cluster/common_templates/windows/test_windows_os_support.py, tests/virt/node/gpu/.../test_windows_vm_with_gpu_pci_passthrough.py, tests/virt/node/gpu/vgpu/test_windows_vm_with_vgpu.py
Replaced validate_pause_optional_migrate_unpause_windows_vm with validate_pause_unpause_windows_vm in imports and call sites (including pre_pause_pid usage).
GPU / vGPU tests
tests/virt/node/gpu/gpu_pci_passthrough/test_rhel_vm_with_gpu_pci_passthrough.py, tests/virt/node/gpu/vgpu/test_rhel_vm_with_vgpu.py
Replaced pause_optional_migrate_unpause_and_check_connectivity calls/imports with pause_unpause_vm_and_check_connectivity.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Verify consistent renames across utilities and all test call sites.
  • Confirm removal of migrate parameter and changed connectivity checks do not break callers that expected migration behavior.
  • Check RHEL test changes (removed QUARANTINED import and xfail) to ensure tests are stable and intended to run.

Possibly related PRs

Suggested labels

verified, can-be-merged

Suggested reviewers

  • RoniKishner
  • kbidarkar
  • rnetser
  • dshchedr
  • jerry7z
  • akri3i

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 36.36% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description check ❓ Inconclusive The description includes most required sections: short description with key points, reference to related python-wrapper PR, and jira ticket link. However, 'What this PR does / why we need it', 'Which issue(s) this PR fixes', and 'Special notes for reviewer' sections are empty, leaving context gaps. Complete the empty template sections, particularly 'What this PR does / why we need it' and 'Which issue(s) this PR fixes' to provide comprehensive context for reviewers.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title 'De-quarantine: test_pause_unpause_vm' clearly summarizes the main objective: removing expected failure markers from pause/unpause VM 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-2
Copy link
Contributor

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
  • Pre-commit Checks: pre-commit runs automatically if .pre-commit-config.yaml exists
  • Branch Labeling: Branch-specific labels are applied to track the target branch
  • Auto-verification: Auto-verified users have their PRs automatically marked as verified

📋 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)

Review & Approval

  • /lgtm - Approve changes (looks good to me)
  • /approve - Approve PR (approvers only)
  • /automerge - Enable automatic merging when all requirements are met (maintainers and 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 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, or conflict labels
  5. Verified: PR must be marked as verified (if verification is enabled)

📊 Review Process

Approvers and Reviewers

Approvers:

  • dshchedr
  • myakove
  • rnetser
  • vsibirsk

Reviewers:

  • RoniKishner
  • SamAlber
  • SiboWang1997
  • akri3i
  • dshchedr
  • geetikakay
  • jerry7z
  • kbidarkar
  • rnetser
  • vsibirsk
Available Labels
  • hold
  • verified
  • wip
  • lgtm
  • approve
  • automerge

💡 Tips

  • WIP Status: Use /wip when your PR is not ready for review
  • Verification: The verified label is automatically removed on each new commit
  • 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.

@codecov
Copy link

codecov bot commented Nov 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.52%. Comparing base (3bc5556) to head (e884e9a).
⚠️ Report is 75 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2926      +/-   ##
==========================================
+ Coverage   92.81%   96.52%   +3.71%     
==========================================
  Files          18       22       +4     
  Lines        1447     1613     +166     
==========================================
+ Hits         1343     1557     +214     
+ Misses        104       56      -48     
Flag Coverage Δ
utilities 96.52% <ø> (+3.71%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

 - Root cause fix is in python-wrapper
 - Refactor pause/unpause function names
 - drop optional migaraion (never used)
@openshift-virtualization-qe-bot-3
Copy link
Contributor

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

@dshchedr
Copy link
Collaborator

dshchedr commented Dec 1, 2025

/approve

@vsibirsk
Copy link
Collaborator Author

vsibirsk commented Dec 2, 2025

/verified

run pause/unpause tests on repeat --count=10 --repeat-scope=session:
tests/virt/cluster/common_templates/rhel/test_rhel_os_support.py
tests/virt/cluster/common_templates/fedora/test_fedora_os_support.py

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

@coderabbitai

Test execution plan request details

CRITICAL: You MUST respond with a review comment on the Files Changed tab, NOT as a regular PR comment.
If it cannot be on the 1st line of the 1st file, add it to any other changed file.

As an expert software testing engineer, analyze all modified files in this PR and create a targeted test execution plan.
You will create a change request comment on the 1st line of the 1st file in the pr with the test execution plan.
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, and fixture inheritance
  5. Detect new tests introduced in the PR

Your deliverable:
Your change request comment will be based on the following requirements:

Test Execution Plan

  • 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 specific marker(s) can be used to cover multiple cases.

Guidelines:

  • Include only tests directly affected by the changes
  • Use a full file path only if ALL tests in that file require verification
  • Use file path + test name if only specific tests are needed
  • If a test marker can cover multiple files/tests, provide the marker
  • Balance coverage vs over-testing - Keep descriptions minimal
  • Do not add a follow-up comment in the PR, only the change request one

@coderabbitai
Copy link

coderabbitai bot commented Dec 2, 2025

Tip

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

@openshift-virtualization-qe-bot-3

Test Execution Plan

Core pause/unpause tests (all OS variants)

  • tests/infrastructure/instance_types/supported_os/test_rhel_os.py::TestRhelInstanceType::test_pause_unpause_vm
  • tests/infrastructure/instance_types/supported_os/test_rhel_os.py::TestRhelInstanceType::test_pause_unpause_after_migrate
  • tests/virt/cluster/common_templates/centos/test_centos_os_support.py::TestCentOSCommonTemplates::test_pause_unpause_vm
  • tests/virt/cluster/common_templates/centos/test_centos_os_support.py::TestCentOSCommonTemplates::test_pause_unpause_after_migrate
  • tests/virt/cluster/common_templates/fedora/test_fedora_os_support.py::TestFedoraCommonTemplates::test_pause_unpause_vm
  • tests/virt/cluster/common_templates/fedora/test_fedora_os_support.py::TestFedoraCommonTemplates::test_pause_unpause_after_migrate
  • tests/virt/cluster/common_templates/rhel/test_rhel_os_support.py::TestRhelCommonTemplates::test_pause_unpause_vm
  • tests/virt/cluster/common_templates/rhel/test_rhel_os_support.py::TestRhelCommonTemplates::test_pause_unpause_after_migrate
  • tests/virt/cluster/common_templates/windows/test_windows_os_support.py::TestWindowsCommonTemplates::test_pause_unpause_vm
  • tests/virt/cluster/common_templates/windows/test_windows_os_support.py::TestWindowsCommonTemplates::test_pause_unpause_after_migrate

GPU-related pause/unpause tests

  • tests/virt/node/gpu/gpu_pci_passthrough/test_rhel_vm_with_gpu_pci_passthrough.py::TestGpuPciPassthroughRhelVm::test_pause_unpause_vm
  • tests/virt/node/gpu/gpu_pci_passthrough/test_rhel_vm_with_gpu_pci_passthrough.py::TestGpuPciPassthroughRhelVm::test_pause_unpause_after_migrate_vm
  • tests/virt/node/gpu/gpu_pci_passthrough/test_windows_vm_with_gpu_pci_passthrough.py::TestGpuPciPassthroughWindowsVm::test_pause_unpause_vm
  • tests/virt/node/gpu/gpu_pci_passthrough/test_windows_vm_with_gpu_pci_passthrough.py::TestGpuPciPassthroughWindowsVm::test_pause_unpause_after_migrate_vm
  • tests/virt/node/gpu/vgpu/test_rhel_vm_with_vgpu.py::TestVGPURhelVM::test_pause_unpause_vm
  • tests/virt/node/gpu/vgpu/test_windows_vm_with_vgpu.py::TestVGPUWindowsVM::test_pause_unpause_vm

Rationale

  • All tests call the refactored pause/unpause utility functions
  • RHEL tests were de-quarantined (previously xfailed, now active)
  • Migration parameter removed from all pause/unpause flows
  • GPU tests verify pause/unpause works with passthrough/vGPU configurations

🧠 Learnings used
Learnt from: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 2469
File: utilities/sanity.py:139-142
Timestamp: 2025-11-08T07:36:57.616Z
Learning: In the openshift-virtualization-tests repository, user rnetser prefers to keep refactoring PRs (like PR #2469) strictly focused on moving/organizing code into more granular modules without adding new functionality, error handling, or behavioral changes. Such improvements should be handled in separate PRs.

Learnt from: vamsikrishna-siddu
Repo: RedHatQE/openshift-virtualization-tests PR: 2199
File: tests/storage/test_online_resize.py:108-113
Timestamp: 2025-09-28T14:43:07.181Z
Learning: In the openshift-virtualization-tests repo, PR #2199 depends on PR #2139 which adds architecture-specific OS_FLAVOR attributes to the Images.Cirros class (OS_FLAVOR_CIRROS for x86_64/ARM64, OS_FLAVOR_FEDORA for s390x), enabling conditional logic based on the underlying OS flavor in tests.

Learnt from: servolkov
Repo: RedHatQE/openshift-virtualization-tests PR: 2838
File: .github/workflows/net-utils-builder-staging.yml:37-37
Timestamp: 2025-11-25T01:56:54.902Z
Learning: In the openshift-virtualization-tests repository, when renaming container images that are built and used by GitHub Actions workflows, the changes must be done sequentially: first merge the workflow files (.github/workflows/) that update the image name in the CI/CD pipelines, then update the code references (like constants.py and manifest files) in a follow-up PR. This prevents the old workflow from running with mismatched image names during the transition.

Learnt from: vamsikrishna-siddu
Repo: RedHatQE/openshift-virtualization-tests PR: 2199
File: tests/storage/test_online_resize.py:108-113
Timestamp: 2025-09-28T14:43:07.181Z
Learning: In the openshift-virtualization-tests repo, PR #2199 depends on PR #2139 which adds the OS_FLAVOR attribute to the Images.Cirros class, making Images.Cirros.OS_FLAVOR available for conditional logic in tests.

Learnt from: dshchedr
Repo: RedHatQE/openshift-virtualization-tests PR: 1716
File: tests/virt/conftest.py:289-297
Timestamp: 2025-08-09T01:52:26.683Z
Learning: When user dshchedr moves working code from one location to another in the openshift-virtualization-tests repository, they prefer not to modify it unless there's a real issue, maintaining the original implementation to avoid introducing unnecessary changes.

Learnt from: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 0
File: :0-0
Timestamp: 2025-09-29T19:05:24.987Z
Learning: The test execution plan for PR #1904 focuses on cluster-type conditional logic where nmstate functionality is bypassed on cloud clusters (Azure/AWS) but fully functional on bare-metal/PSI clusters, requiring different test strategies for each environment type.

Learnt from: vsibirsk
Repo: RedHatQE/openshift-virtualization-tests PR: 2045
File: tests/virt/cluster/vm_lifecycle/conftest.py:46-47
Timestamp: 2025-09-15T06:49:53.478Z
Learning: In the openshift-virtualization-tests repo, large fixture refactoring efforts like the golden image data source migration are handled incrementally by directory/team ownership. The virt/cluster directory is handled separately from virt/node, tests/infra, tests/storage, etc., with each area managed by relevant teams in follow-up PRs.

Learnt from: SiboWang1997
Repo: RedHatQE/openshift-virtualization-tests PR: 1566
File: tests/global_config_x86_64.py:29-29
Timestamp: 2025-07-25T01:59:02.180Z
Learning: In the openshift-virtualization-tests repo, the s390x architecture still relies on Fedora 41 images, while only x86_64 is updated to Fedora 42 in PR #1566.

Learnt from: chandramerla
Repo: RedHatQE/openshift-virtualization-tests PR: 2577
File: tests/virt/node/hotplug/test_cpu_memory_hotplug.py:161-162
Timestamp: 2025-11-19T17:00:58.250Z
Learning: In the openshift-virtualization-tests repository, the s390x test execution strategy uses positive filtering: only tests explicitly marked with pytest.mark.s390x are executed on s390x clusters. Tests without the s390x marker are automatically excluded from s390x runs, so explicit skipif decorators are not needed to prevent execution on s390x.

Learnt from: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 1236
File: conftest.py:539-557
Timestamp: 2025-06-18T13:26:04.504Z
Learning: In the openshift-virtualization-tests repository, PR #1236 intentionally limits error extraction to the setup phase only in the pytest_runtest_makereport hook. The scope is deliberately restricted to setup failures, not all test phases.

Learnt from: servolkov
Repo: RedHatQE/openshift-virtualization-tests PR: 1776
File: libs/net/node_network.py:25-31
Timestamp: 2025-08-20T23:43:28.117Z
Learning: In the RedHatQE/openshift-virtualization-tests project, servolkov's team always uses bare metal (BM) clusters with IPv4 setup in their testing environment, making defensive checks for IPv4 data presence potentially redundant in their networking code.

Learnt from: jpeimer
Repo: RedHatQE/openshift-virtualization-tests PR: 1160
File: tests/storage/storage_migration/test_mtc_storage_class_migration.py:165-176
Timestamp: 2025-06-17T07:45:37.776Z
Learning: In the openshift-virtualization-tests repository, user jpeimer prefers explicit fixture parameters over composite fixtures in test methods, even when there are many parameters, as they find this approach more readable and maintainable for understanding test dependencies.

Learnt from: akri3i
Repo: RedHatQE/openshift-virtualization-tests PR: 1210
File: tests/virt/cluster/general/mass_machine_type_transition_tests/conftest.py:24-64
Timestamp: 2025-06-23T19:28:20.281Z
Learning: In OpenShift Virtualization mass machine type transition tests, the machine type glob pattern "pc-q35-rhel8.*.*" is intentionally hard-coded in the kubevirt_api_lifecycle_automation_job as it's used only once for this specific test case, with plans to update it in the future if the job needs to support other machine types.

Learnt from: RoniKishner
Repo: RedHatQE/openshift-virtualization-tests PR: 1411
File: utilities/os_utils.py:246-279
Timestamp: 2025-07-22T17:13:59.166Z
Learning: In the RedHatQE/openshift-virtualization-tests repository, CentOS preferences follow the format "centos-stream<version>" (e.g., "centos-stream9", "centos-stream10"). The generate_instance_type_centos_os_matrix function correctly uses regex to extract numeric versions and constructs the latest version string in the same format as the input preferences for proper comparison.

Learnt from: akri3i
Repo: RedHatQE/openshift-virtualization-tests PR: 1210
File: tests/virt/cluster/general/mass_machine_type_transition_tests/conftest.py:83-97
Timestamp: 2025-06-23T19:19:31.961Z
Learning: In OpenShift Virtualization mass machine type transition tests, the kubevirt_api_lifecycle_automation_job requires cluster-admin privileges to function properly, as confirmed by the test maintainer akri3i.

Learnt from: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 2701
File: .github/scripts/coderabbit_workflow.py:45-46
Timestamp: 2025-11-27T11:45:54.224Z
Learning: In the openshift-virtualization-tests repository, when using the PyGithub library or similar API clients, rnetser prefers to rely on API-level validation rather than adding redundant client-side input validation, since the API will handle validation and raise appropriate errors.

@rnetser
Copy link
Collaborator

rnetser commented Dec 2, 2025

/approve
/lgtm

@rnetser rnetser merged commit c6f0da0 into RedHatQE:main Dec 2, 2025
22 checks passed
@openshift-virtualization-qe-bot-2
Copy link
Contributor

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

@vsibirsk vsibirsk deleted the vk-refactor-pause-unpause-tests branch December 2, 2025 11:04
@openshift-virtualization-qe-bot-2
Copy link
Contributor

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

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.

8 participants