Skip to content

Move and type OADP related functions from tests directory to the upper level utilities directory and add unit tests#3301

Merged
vsibirsk merged 1 commit intoRedHatQE:mainfrom
qwang1:qwang-oadp-move
Jan 29, 2026
Merged

Move and type OADP related functions from tests directory to the upper level utilities directory and add unit tests#3301
vsibirsk merged 1 commit intoRedHatQE:mainfrom
qwang1:qwang-oadp-move

Conversation

@qwang1
Copy link
Copy Markdown
Contributor

@qwang1 qwang1 commented Dec 30, 2025

Short description:

For the upcoming oadp-chaos test cases, because Import from tests is not allowed.

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

    • VM file verification, storage-class volume-mode checks, and a dedicated restore helper added to data-protection tooling.
    • Improved Velero teardown and deletion handling with clearer failure reporting.
  • Tests

    • Expanded unit and integration tests covering backups/restores, VM file checks, storage-class logic, teardown paths, and deletion error handling.
  • Chores

    • Consolidated data-protection helpers into shared utilities for easier reuse.

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 30, 2025

📝 Walkthrough

Walkthrough

Relocates OADP test utilities into production utilities/oadp.py, adding VeleroRestore, check_file_in_running_vm, and is_storage_class_support_volume_mode; updates VeleroBackup signature to require a client; removes duplicates from tests/data_protection/oadp/utils.py; updates tests and conftest to import and call the new APIs.

Changes

Cohort / File(s) Summary
OADP Utilities Implementation
utilities/oadp.py
Adds VeleroRestore (context manager), delete_velero_resource, _velero_teardown; requires client: DynamicClient in VeleroBackup.__init__; adds check_file_in_running_vm and is_storage_class_support_volume_mode; adds logging, error/teardown flows and console/escaping helpers.
Test Utility Removal
tests/data_protection/oadp/utils.py
Removes migrated items: VeleroRestore, check_file_in_vm, and is_storage_class_support_volume_mode (moved to utilities/oadp.py).
Fixture & Import Updates
tests/data_protection/oadp/conftest.py
Imports VeleroRestore and is_storage_class_support_volume_mode from utilities.oadp; rhel_vm_with_data_volume_template now calls is_storage_class_support_volume_mode with admin_client=.
Test Callsite Adjustments
tests/data_protection/oadp/test_velero.py
Replaces check_file_in_vm with check_file_in_running_vm and updates calls to use file_name/file_content params; adds/changes @pytest.mark.usefixtures for restoration flows; imports constants from utilities.constants.
Unit Test Additions
utilities/unittests/test_oadp.py
Adds extensive unit tests covering delete_velero_resource, _velero_teardown, VeleroRestore, check_file_in_running_vm, is_storage_class_support_volume_mode, and adjusted VeleroBackup behavior and error paths.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested labels

commented-coderabbitai[bot]

Suggested reviewers

  • duyanyan
  • kgoldbla
  • geetikakay
  • rnetser
  • dshchedr
  • dalia-frank
  • josemacassan
  • jpeimer
  • RoniKishner
  • Ahmad-Hafe
🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description check ⚠️ Warning Description is incomplete; only the short description is filled. Required sections like 'More details', 'What this PR does', 'Which issue(s)', 'Special notes', and 'jira-ticket' are empty or minimal. Complete all required template sections with details about the refactor scope, motivation beyond the short statement, affected tests, and migration instructions for consumers of moved APIs.
Docstring Coverage ⚠️ Warning Docstring coverage is 27.03% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed Title accurately summarizes the main changes: moving OADP functions to utilities with type hints and adding unit tests.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
  • 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
  • jpeimer
  • myakove
  • rnetser
  • vsibirsk

Reviewers:

  • Ahmad-Hafe
  • RoniKishner
  • dalia-frank
  • dshchedr
  • duyanyan
  • geetikakay
  • josemacassan
  • jpeimer
  • kgoldbla
  • kshvaika
  • rnetser
  • stesrn
  • 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
Copy Markdown

codecov Bot commented Dec 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.42%. Comparing base (db03ed9) to head (5f84f04).
⚠️ Report is 119 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3301      +/-   ##
==========================================
+ Coverage   98.38%   98.42%   +0.04%     
==========================================
  Files          25       25              
  Lines        2166     2222      +56     
==========================================
+ Hits         2131     2187      +56     
  Misses         35       35              
Flag Coverage Δ
utilities 98.42% <100.00%> (+0.04%) ⬆️

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.

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.

Actionable comments posted: 1

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 63e39da and f300be1.

📒 Files selected for processing (4)
  • tests/data_protection/oadp/conftest.py
  • tests/data_protection/oadp/test_velero.py
  • tests/data_protection/oadp/utils.py
  • utilities/oadp.py
💤 Files with no reviewable changes (1)
  • tests/data_protection/oadp/utils.py
🧰 Additional context used
🧠 Learnings (10)
📓 Common learnings
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: 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: EdDev
Repo: RedHatQE/openshift-virtualization-tests PR: 2920
File: utilities/network.py:31-31
Timestamp: 2025-12-07T13:52:56.070Z
Learning: In the openshift-virtualization-tests repository, the utilities/ package is not intended to be used as a valid, structured module with clear focus and ownership. The team prefers using specialized library locations like tests/network/libs/ for network-related helper code rather than placing everything in utilities/.
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: qwang1
Repo: RedHatQE/openshift-virtualization-tests PR: 1678
File: utilities/oadp.py:5-5
Timestamp: 2025-08-26T14:51:22.273Z
Learning: qwang1 contributed the Backup resource to openshift-python-wrapper and the PR was merged. They use uv for dependency management in openshift-virtualization-tests.
Learnt from: EdDev
Repo: RedHatQE/openshift-virtualization-tests PR: 2920
File: utilities/network.py:31-31
Timestamp: 2025-12-07T13:52:56.070Z
Learning: In the openshift-virtualization-tests repository, it is acceptable for utilities/ modules to import from tests/network/libs/ (e.g., utilities/network.py importing from tests/network/libs/sriovnetworknode). The libs modules under tests/network/libs/ are library/tool modules, not test code, and this import direction does not violate architectural principles in this codebase.
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: qwang1
Repo: RedHatQE/openshift-virtualization-tests PR: 1678
File: utilities/oadp.py:1-5
Timestamp: 2025-09-07T13:16:32.011Z
Learning: In the openshift-virtualization-tests project utilities/oadp.py, DynamicClient instances are passed as parameters rather than created internally, so kubernetes.config import is not needed for client creation fallback patterns.
Learnt from: jpeimer
Repo: RedHatQE/openshift-virtualization-tests PR: 0
File: :0-0
Timestamp: 2025-12-22T15:56:00.157Z
Learning: In the openshift-virtualization-tests repository, when responding to test execution plan requests from openshift-virtualization-qe-bot-3, do NOT use "REQUEST_CHANGES" review type if the PR author has already marked the PR as verified (e.g., with `/verified` command). Test execution plans are informational guides, not blocking requirements. Use COMMENT event for informational test plans, or only REQUEST_CHANGES if there are actual code issues that need to be addressed before merging.
Learnt from: jpeimer
Repo: RedHatQE/openshift-virtualization-tests PR: 2014
File: tests/storage/cdi_clone/test_clone.py:0-0
Timestamp: 2025-09-10T13:25:59.799Z
Learning: In the openshift-virtualization-tests repository, when creating DataVolume objects using ocp_resources, use `api_name="storage"` rather than the default `api_name="pvc"`.
Learnt from: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 1723
File: conftest.py:496-502
Timestamp: 2025-08-27T12:38:26.496Z
Learning: In PR #1723, the user rnetser clarified that updating downstream string comparisons to handle DataVolume enums from StorageClassConfig is not part of the current PR scope, which focuses only on adding conformance storage class support.
Learnt from: dalia-frank
Repo: RedHatQE/openshift-virtualization-tests PR: 1845
File: tests/storage/cdi_import/test_import_http.py:280-282
Timestamp: 2025-08-27T08:34:49.132Z
Learning: The create_pod_for_pvc helper function is still used in other tests beyond the current PR scope and may need to be addressed in a separate PR to avoid breaking existing functionality.
📚 Learning: 2025-08-28T11:29:15.768Z
Learnt from: qwang1
Repo: RedHatQE/openshift-virtualization-tests PR: 1678
File: utilities/oadp.py:5-5
Timestamp: 2025-08-28T11:29:15.768Z
Learning: In the openshift-virtualization-tests project, DynamicClient is imported from kubernetes.dynamic, not openshift.dynamic. The standard import pattern is `from kubernetes.dynamic import DynamicClient`.

Applied to files:

  • utilities/oadp.py
📚 Learning: 2025-09-07T13:16:32.011Z
Learnt from: qwang1
Repo: RedHatQE/openshift-virtualization-tests PR: 1678
File: utilities/oadp.py:1-5
Timestamp: 2025-09-07T13:16:32.011Z
Learning: In the openshift-virtualization-tests project utilities/oadp.py, DynamicClient instances are passed as parameters rather than created internally, so kubernetes.config import is not needed for client creation fallback patterns.

Applied to files:

  • utilities/oadp.py
  • tests/data_protection/oadp/conftest.py
  • tests/data_protection/oadp/test_velero.py
📚 Learning: 2025-12-07T13:52:56.070Z
Learnt from: EdDev
Repo: RedHatQE/openshift-virtualization-tests PR: 2920
File: utilities/network.py:31-31
Timestamp: 2025-12-07T13:52:56.070Z
Learning: In the openshift-virtualization-tests repository, it is acceptable for utilities/ modules to import from tests/network/libs/ (e.g., utilities/network.py importing from tests/network/libs/sriovnetworknode). The libs modules under tests/network/libs/ are library/tool modules, not test code, and this import direction does not violate architectural principles in this codebase.

Applied to files:

  • tests/data_protection/oadp/conftest.py
  • tests/data_protection/oadp/test_velero.py
📚 Learning: 2025-09-10T13:25:59.799Z
Learnt from: jpeimer
Repo: RedHatQE/openshift-virtualization-tests PR: 2014
File: tests/storage/cdi_clone/test_clone.py:0-0
Timestamp: 2025-09-10T13:25:59.799Z
Learning: In the openshift-virtualization-tests repository, when creating DataVolume objects using ocp_resources, use `api_name="storage"` rather than the default `api_name="pvc"`.

Applied to files:

  • tests/data_protection/oadp/conftest.py
  • tests/data_protection/oadp/test_velero.py
📚 Learning: 2025-10-16T12:47:04.521Z
Learnt from: rlobillo
Repo: RedHatQE/openshift-virtualization-tests PR: 2249
File: tests/install_upgrade_operators/must_gather/test_must_gather.py:428-441
Timestamp: 2025-10-16T12:47:04.521Z
Learning: In openshift-virtualization-tests repository, DataVolumes in the openshift-virtualization-os-images namespace are volatile resources managed by DataImportCron. They can be created/destroyed between must-gather collection listing and file retrieval, requiring FileNotFoundError exception handling in test_crd_resources to skip these volatile resources gracefully while still validating DataVolumes in other namespaces. There is no pytest_generate_tests hook that filters out datavolumes from test parametrization.

Applied to files:

  • tests/data_protection/oadp/conftest.py
  • tests/data_protection/oadp/test_velero.py
📚 Learning: 2025-12-15T12:33:06.686Z
Learnt from: azhivovk
Repo: RedHatQE/openshift-virtualization-tests PR: 3024
File: tests/network/connectivity/utils.py:17-17
Timestamp: 2025-12-15T12:33:06.686Z
Learning: In the test suite, ensure the ipv6_network_data fixture returns a factory function (Callable) and that all call sites invoke it to obtain the actual data dict, i.e., use ipv6_network_data() at call sites. This enables future extensibility for configuring secondary interfaces' IP addresses without changing call sites. Apply this pattern to all Python test files under tests.

Applied to files:

  • tests/data_protection/oadp/conftest.py
  • tests/data_protection/oadp/test_velero.py
📚 Learning: 2025-12-22T16:27:40.244Z
Learnt from: yossisegev
Repo: RedHatQE/openshift-virtualization-tests PR: 3196
File: tests/network/upgrade/test_upgrade_network.py:4-4
Timestamp: 2025-12-22T16:27:40.244Z
Learning: For PRs that remove tests, rely on pytest --collect-only to verify the test discovery results (which tests are selected/deselected) and ensure the removal is clean and the test module remains functional. Full test execution is not required for test deletion PRs. This guideline applies to test files anywhere under the tests/ directory (e.g., tests/network/upgrade/test_upgrade_network.py) and should be used for similar test-deletion scenarios across the repository.

Applied to files:

  • tests/data_protection/oadp/conftest.py
  • tests/data_protection/oadp/test_velero.py
📚 Learning: 2025-08-09T01:52:26.683Z
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.

Applied to files:

  • tests/data_protection/oadp/test_velero.py
📚 Learning: 2025-05-21T09:41:46.532Z
Learnt from: jpeimer
Repo: RedHatQE/openshift-virtualization-tests PR: 954
File: tests/storage/storage_migration/conftest.py:156-176
Timestamp: 2025-05-21T09:41:46.532Z
Learning: In the RedHatQE/openshift-virtualization-tests codebase, the pattern of calling to_dict() on a DataVolume object and then accessing dv.res to populate data_volume_template is the preferred approach rather than building the template dict explicitly.

Applied to files:

  • tests/data_protection/oadp/test_velero.py
🧬 Code graph analysis (1)
tests/data_protection/oadp/conftest.py (1)
utilities/oadp.py (3)
  • VeleroRestore (149-186)
  • create_rhel_vm (97-146)
  • is_storage_class_support_volume_mode (197-201)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: can-be-merged
  • GitHub Check: can-be-merged
  • GitHub Check: can-be-merged
  • GitHub Check: can-be-merged
  • GitHub Check: can-be-merged
  • GitHub Check: can-be-merged
  • GitHub Check: can-be-merged
  • GitHub Check: can-be-merged
🔇 Additional comments (6)
tests/data_protection/oadp/conftest.py (1)

15-20: Import updates look correct.

The import sources for VeleroRestore and is_storage_class_support_volume_mode have been properly updated to reference utilities.oadp instead of the tests directory. This aligns with the PR objective to move OADP utilities out of tests.

tests/data_protection/oadp/test_velero.py (1)

4-6: Import updates are correct.

The import source for check_file_in_vm has been properly updated to utilities.oadp. The wait_for_restored_dv function remains in the tests directory, indicating a selective migration of utilities.

utilities/oadp.py (4)

8-9: New imports support the moved functionality correctly.

The imports for Restore, StorageProfile, and console are appropriate for the newly added VeleroRestore class and helper functions.

Also applies to: 12-12


21-26: Constants imported for the moved utilities.

The additional constants (FILE_NAME_FOR_BACKUP, LS_COMMAND, TEXT_TO_TEST, TIMEOUT_20SEC) are correctly imported to support the check_file_in_vm function.


189-194: Helper function implementation is straightforward.

The check_file_in_vm function appropriately validates file existence and content in a VM via console interaction.


197-201: Storage class volume mode check is correctly implemented.

The is_storage_class_support_volume_mode function properly queries the StorageProfile to determine volume mode support.

Comment thread utilities/oadp.py Outdated
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.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@utilities/unittests/test_oadp.py`:
- Around line 642-643: Replace the identity comparison "assert
restore.wait_complete is True" with a truthy assertion on the property and add a
failure message, e.g. assert restore.wait_complete, "restore.wait_complete
expected truthy but was falsy"; likewise add an assertion message to the timeout
check using restore.timeout (e.g. assert restore.timeout == 600,
"restore.timeout expected 600 but got {restore.timeout}") so both
restore.wait_complete and restore.timeout have clear, non-identity assertions
and helpful failure messages.
- Around line 45-46: The helper function assert_extra is dead code (unused) in
the test file; remove the entire assert_extra function definition to clean up
the test module and reduce maintenance overhead, ensuring no tests reference
assert_extra (if any do, replace those usages with direct assertions or
reintroduce a meaningful helper with tests updated accordingly) and run the test
suite to confirm no breakage.

Comment thread utilities/unittests/test_oadp.py Outdated
Comment thread utilities/unittests/test_oadp.py Outdated
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.

Actionable comments posted: 1

Caution

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

⚠️ Outside diff range comments (1)
utilities/unittests/test_oadp.py (1)

240-245: MEDIUM: Add failure messages to new assertions.
Failure messages make CI triage faster and are required by repo test guidelines.

✅ Example improvement
-        assert result == backup
+        assert result == backup, "VeleroBackup.__enter__ should return the backup instance"

Please apply similar messages to other new assert statements in this file.
As per coding guidelines, test assertions must include failure messages.

🤖 Fix all issues with AI agents
In `@utilities/oadp.py`:
- Around line 134-138: The super().__exit__ calls in VeleroBackup.__exit__ and
VeleroRestore.__exit__ pass positional args; change them to use named arguments
to avoid ordering bugs by calling
super().__exit__(exception_type=exception_type, exception_value=exception_value,
traceback=traceback) in both methods and ensure the _velero_teardown invocation
remains unchanged.

Comment thread utilities/oadp.py
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.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@utilities/unittests/test_oadp.py`:
- Around line 638-639: Add descriptive failure messages to the VeleroRestore
assertions so test failures are easier to triage: update assertions checking
restore.wait_complete and restore.timeout (and the other VeleroRestore-related
asserts around the 653-657 block) to include clear messages like "'wait_complete
should default to True'" and "'timeout should default to 600'" (and similar
descriptive messages for the other assertions) so each assert reads assert
<condition>, '<descriptive message>'.
- Around line 771-784: Add descriptive failure messages to the assertions in the
volume-mode unit tests so failures are actionable: update the assert in
test_volume_mode_not_supported (which calls
is_storage_class_support_volume_mode) to include a message like "'expected
storage class to NOT support Block volume mode but it did'"; likewise add a
message to the corresponding positive test (the one asserting True) e.g.,
"'expected storage class to support Block volume mode but it did not'". Ensure
messages reference the storage_class_name and requested_volume_mode variables to
aid debugging.

Comment thread utilities/unittests/test_oadp.py Outdated
Comment thread utilities/unittests/test_oadp.py Outdated
…r level utilities directory

For upcoming oadp-chaos test cases.

And add unit tests for oadp utilities.

Signed-off-by: Qixuan Wang <qwang@redhat.com>
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.

Actionable comments posted: 1

Caution

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

⚠️ Outside diff range comments (1)
tests/data_protection/oadp/test_velero.py (1)

108-121: MEDIUM: Consider @pytest.mark.usefixtures for consistency.

Tests test_restore_cloned_dv (line 108) and test_restore_uploaded_dv (line 115) pass velero_restore_second_namespace_with_datamover as a parameter but don't use its return value — they only need its side effects.

WHY this matters: Consistency within the same file improves readability. The tests at lines 92 and 101 already use the @pytest.mark.usefixtures pattern.

However, this is a refactoring PR focused on moving utilities, so this change is out of scope per repository learnings about keeping refactoring PRs focused.

♻️ Example for a follow-up PR
 `@pytest.mark.s390x`
 `@pytest.mark.polarion`("CNV-10590")
+@pytest.mark.usefixtures("velero_restore_second_namespace_with_datamover")
 def test_restore_cloned_dv(
     cloned_rhel_dv,
-    velero_restore_second_namespace_with_datamover,
 ):
     wait_for_restored_dv(dv=cloned_rhel_dv)

Based on learnings: "In the openshift-virtualization-tests repository, user rnetser prefers to keep refactoring PRs strictly focused on moving/organizing code into more granular modules without adding new functionality, error handling, or behavioral changes."

🤖 Fix all issues with AI agents
In `@utilities/oadp.py`:
- Around line 74-91: The helper function _velero_teardown is missing a return
type annotation and has two unused parameters; update its signature to add an
explicit return type (e.g., -> None) and rename the unused parameters to
_exception_value and _traceback to indicate intentional non-use, keeping the
rest of the logic intact; ensure references to ResourceTeardownError, LOGGER,
delete_velero_resource, and resource.client/name/kind remain unchanged.

Comment thread utilities/oadp.py
coderabbitai[bot]
coderabbitai Bot previously requested changes Jan 28, 2026
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.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@utilities/oadp.py`:
- Around line 195-211: The VeleroRestore class __init__ docstring is missing
Args entries; update the class-level docstring for VeleroRestore to include a
Google-style "Args:" section documenting each constructor parameter (name,
namespace, teardown, wait_complete, timeout, and **kwargs), describing types,
defaults, and the side effects (e.g., resource creation/teardown and optional
wait for completion) and any important behavior (timeouts and namespace default
ADP_NAMESPACE); ensure the docstring follows the existing Google format and
explicitly notes that this is a context manager with side effects.

In `@utilities/unittests/test_oadp.py`:
- Around line 48-54: Replace positional arguments to pytest.mark.parametrize
with explicit keyword arguments: change calls like
pytest.mark.parametrize(("kind", "name"), [("Backup","test-backup"), ...]) to
use argnames=("kind","name") and argvalues=[("Backup","test-backup"), ...].
Apply this change for every pytest.mark.parametrize occurrence in this file
(including the groups around the tuples at lines shown) so the calls use
argnames=... and argvalues=... to improve readability and comply with the
guideline.

Comment thread utilities/oadp.py
Comment thread utilities/unittests/test_oadp.py
@qwang1
Copy link
Copy Markdown
Contributor Author

qwang1 commented Jan 28, 2026

/build-and-push-container

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

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

@qwang1
Copy link
Copy Markdown
Contributor Author

qwang1 commented Jan 28, 2026

/verified
DNO-STC cluster/dev-test-chaos-cnv-4.21-qwang/17

@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 Test Execution Plan with the smoke tests recommendation.
Do NOT submit a formal review - just post the inline comment directly.

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, and fixture inheritance
  5. Detect new tests introduced in the PR
  6. Smoke Test Impact Analysis: Determine if any changes could affect smoke tests by checking:
    • Changes to files/functions used by tests marked with @pytest.mark.smoke
    • Changes to fixtures or utilities imported by smoke tests
    • Changes to conftest.py files that may affect smoke test execution
    • Changes to core infrastructure code (utilities/, libs/) that smoke tests depend on

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

Test Execution Plan

  • Run smoke tests: True / False (Based on your smoke test impact analysis - True if any changes may affect smoke tests)
  • 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

CRITICAL WORKFLOW COMPLETION RULES:

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

  1. YOUR ONLY DELIVERABLE: Post an inline review 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 submitting the review fails 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: Before setting "Run smoke tests: True", you MUST use shell scripts to:
- Trace the actual fixture dependency chain from smoke tests to changed fixtures
- Verify that smoke tests actually import/use changed utilities or functions
- Confirm the dependency path exists; do NOT assume based on scope or semantics
- Be conservative: Session-scoped fixtures or infrastructure-sounding names do NOT
automatically mean smoke test impact. Only flag smoke test impact when you can
demonstrate a concrete dependency path.
WRONG: "This session-scoped storage fixture might affect smoke tests"
RIGHT: "Smoke test X uses fixture Y, which depends on the changed fixture Z"

Comment thread tests/data_protection/oadp/conftest.py
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 28, 2026

Tip

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash

echo "=== Identifying first changed file and line ==="
gh pr diff 3301 --repo RedHatQE/openshift-virtualization-tests > /tmp/pr_diff.txt

# Extract first changed file
FIRST_FILE=$(grep "^diff --git" /tmp/pr_diff.txt | head -1 | sed 's/diff --git a\///' | sed 's/ b\/.*//')
echo "First changed file: $FIRST_FILE"

# Get first hunk for that file
HUNK=$(grep -A 200 "^diff --git a/${FIRST_FILE}" /tmp/pr_diff.txt | grep "^@@" | head -1)
echo "First hunk: $HUNK"

# Extract line number from +X,Y format
LINE_NUM=$(echo "$HUNK" | sed -n 's/.*+\([0-9]*\),.*/\1/p')
echo "First changed line number: $LINE_NUM"

echo -e "\n=== Verifying smoke test impact ==="
# Find all smoke tests
rg "pytest\.mark\.smoke" --type=py -l > /tmp/smoke_tests.txt 2>/dev/null || touch /tmp/smoke_tests.txt
SMOKE_COUNT=$(wc -l < /tmp/smoke_tests.txt 2>/dev/null || echo 0)
echo "Total smoke test files: $SMOKE_COUNT"

# Check if any smoke tests import utilities.oadp or moved functions
SMOKE_IMPACT=0
if [ -s /tmp/smoke_tests.txt ]; then
    while read -r smoke_file; do
        if [ -f "$smoke_file" ]; then
            if rg "from utilities\.oadp import|from utilities import.*oadp|check_file_in_vm|VeleroRestore|is_storage_class_support_volume_mode" "$smoke_file" -q 2>/dev/null; then
                echo "FOUND: $smoke_file uses OADP utilities"
                SMOKE_IMPACT=1
                break
            fi
        fi
    done < /tmp/smoke_tests.txt
fi

if [ $SMOKE_IMPACT -eq 0 ]; then
    echo "CONFIRMED: No smoke tests depend on OADP utilities"
fi

echo -e "\n=== Creating and posting test execution plan ==="
cat > /tmp/test_plan.md <<'EOF'
## Test Execution Plan

**Run smoke tests: False**

### Tests to Execute

- `tests/data_protection/oadp/test_velero.py` - All tests use the moved OADP utilities (VeleroRestore, check_file_in_vm, is_storage_class_support_volume_mode)
- `tests/storage/storage_migration/test_mtc_storage_class_migration.py` - Uses check_file_in_vm imported via tests/storage/storage_migration/utils.py

**Rationale**: This PR moves OADP utility functions from `tests/data_protection/oadp/utils.py` to `utilities/oadp.py` with type hints and adds unit tests. The affected tests import and use these functions. Smoke test impact verified: no smoke tests depend on OADP utilities.
EOF

echo "Target: $FIRST_FILE:$LINE_NUM"
echo "Smoke impact: $SMOKE_IMPACT"

# Post inline review comment using GitHub API
gh api \
  --method POST \
  -H "Accept: application/vnd.github+json" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  /repos/RedHatQE/openshift-virtualization-tests/pulls/3301/reviews \
  -f event='COMMENT' \
  -F comments[][path]="$FIRST_FILE" \
  -F comments[][line]="$LINE_NUM" \
  -F comments[][side]='RIGHT' \
  -f comments[][body]=@/tmp/test_plan.md

echo "Exit code: $?"

Length of output: 2141



🧠 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: 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: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 3062
File: conftest.py:333-333
Timestamp: 2025-12-16T20:11:03.645Z
Learning: In the openshift-virtualization-tests repository, when determining smoke test impact for changes affecting py_config["os_login_param"], follow this verification methodology: (1) Find all smoke tests: `rg "pytest.mark.smoke" --type=py -B2 | grep "def test_"`, (2) For each smoke test file, search for VM creation patterns: `rg "VirtualMachineForTests|running_vm|VirtualMachineForTestsFromTemplate|wait_for_ssh|check_ssh_connectivity"`, (3) Trace the dependency chain: smoke test → VirtualMachineForTests/running_vm() → wait_for_ssh_connectivity() (default enabled) → vm.login_params property → py_config["os_login_param"][vm.os_flavor], (4) Check utilities/virt.py for login_params usage: `rg "os_login_param|login_params" utilities/virt.py -C3`. Any smoke test creating VMs with default SSH connectivity checks (running_vm with check_ssh_connectivity=True) depends on os_login_param, even if the test doesn't directly reference it.

Learnt from: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 0
File: :0-0
Timestamp: 2025-12-16T10:28:54.212Z
Learning: In the openshift-virtualization-tests repository, when determining smoke test impact for test execution plans, only set "Run smoke tests: True" if there is a verified, traceable dependency path from smoke tests to the changed code. Session-scoped fixtures or infrastructure-sounding changes do NOT automatically imply smoke test impact - the dependency chain must be explicitly verified using shell scripts before recommending smoke test execution.

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: jpeimer
Repo: RedHatQE/openshift-virtualization-tests PR: 3571
File: tests/storage/storage_migration/utils.py:158-167
Timestamp: 2026-01-25T13:18:26.819Z
Learning: In the openshift-virtualization-tests repository, user jpeimer prefers to avoid nitpicky style changes (e.g., removing `.keys()` from dict membership checks) because verifying every change is expensive. Be cautious about suggesting low-impact stylistic improvements that require verification overhead.

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: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 3062
File: conftest.py:333-333
Timestamp: 2025-12-16T15:09:49.597Z
Learning: In the openshift-virtualization-tests repository, when conftest.py or utilities/bitwarden.py changes affect py_config["os_login_param"], smoke test impact must be determined by: (1) finding all smoke tests using `rg "pytest.mark.smoke"`, (2) checking each for VM creation patterns (VirtualMachineForTests, running_vm, VirtualMachineForTestsFromTemplate), (3) tracing whether running_vm is called with default check_ssh_connectivity=True, which accesses vm.login_params property that reads py_config["os_login_param"][vm.os_flavor]. The dependency chain is: smoke test → VM creation → running_vm → wait_for_ssh_connectivity → vm.login_params → os_login_param. Any smoke test creating VMs with SSH connectivity (the default) depends on os_login_param.

Learnt from: EdDev
Repo: RedHatQE/openshift-virtualization-tests PR: 2920
File: utilities/network.py:31-31
Timestamp: 2025-12-07T13:52:56.070Z
Learning: In the openshift-virtualization-tests repository, it is acceptable for utilities/ modules to import from tests/network/libs/ (e.g., utilities/network.py importing from tests/network/libs/sriovnetworknode). The libs modules under tests/network/libs/ are library/tool modules, not test code, and this import direction does not violate architectural principles in this codebase.

Learnt from: azhivovk
Repo: RedHatQE/openshift-virtualization-tests PR: 2119
File: tests/network/localnet/conftest.py:352-366
Timestamp: 2025-10-31T13:05:24.570Z
Learning: In the RedHatQE/openshift-virtualization-tests repository, tests run sequentially by default on the same cluster (with module-scoped fixtures properly cleaned up between modules), and parallel test runs use different machines/clusters. This means cluster-scoped resources (like ClusterUserDefinedNetwork or NodeNetworkConfigurationPolicy) can safely use the same names across different test modules without risk of collision.

Learnt from: jpeimer
Repo: RedHatQE/openshift-virtualization-tests PR: 0
File: :0-0
Timestamp: 2025-12-22T15:56:00.157Z
Learning: In the openshift-virtualization-tests repository, when responding to test execution plan requests from openshift-virtualization-qe-bot-3, do NOT use "REQUEST_CHANGES" review type if the PR author has already marked the PR as verified (e.g., with `/verified` command). Test execution plans are informational guides, not blocking requirements. Use COMMENT event for informational test plans, or only REQUEST_CHANGES if there are actual code issues that need to be addressed before merging.

Learnt from: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 0
File: :0-0
Timestamp: 2025-12-16T14:00:59.076Z
Learning: In the openshift-virtualization-tests repository, when responding to test execution plan requests from openshift-virtualization-qe-bot-3, CodeRabbit must post ONLY an inline review comment on the Files Changed tab and then stop immediately without generating any follow-up comments in the PR discussion thread. No acknowledgment messages, no confirmation of posting, no explanation - silence after posting the inline review equals success. Additional comments create empty/meaningless reviews that clutter the PR.

Learnt from: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 0
File: :0-0
Timestamp: 2025-12-16T14:06:22.391Z
Learning: In the openshift-virtualization-tests repository, when posting test execution plan inline review comments using GitHub API, the full test execution plan content must go in the `comments[].body` field (which appears on Files Changed tab), NOT in the top-level `body` field (which appears in PR discussion thread). The top-level `body` field should be omitted or left empty to avoid posting redundant comments in the PR discussion thread.

Learnt from: qwang1
Repo: RedHatQE/openshift-virtualization-tests PR: 3301
File: utilities/unittests/test_oadp.py:5-5
Timestamp: 2026-01-07T11:52:04.988Z
Learning: In utilities/unittests/test_oadp.py (and similar test files in openshift-virtualization-tests), the `# flake8: noqa: E402` directive is required by pre-commit hooks, even when Ruff reports it as unused. This is needed because mock setup must precede imports to prevent circular dependencies, triggering E402 warnings that must be suppressed.

Learnt from: qwang1
Repo: RedHatQE/openshift-virtualization-tests PR: 1702
File: tests/chaos/oadp/conftest.py:23-45
Timestamp: 2025-09-17T14:56:18.111Z
Learning: In tests/chaos/oadp/conftest.py for the openshift-virtualization-tests repository, user qwang1 confirmed that py_config["latest_rhel_os_dict"]["data_source"] can be accessed directly without defensive .get() calls because the test configuration setup guarantees these keys will always be present in their test execution environment.

Learnt from: yossisegev
Repo: RedHatQE/openshift-virtualization-tests PR: 3358
File: tests/network/sriov/test_sriov.py:21-21
Timestamp: 2026-01-07T09:52:22.771Z
Learning: For PRs that only remove or modify pytest markers (like removing pytest.mark.post_upgrade) without changing test logic in openshift-virtualization-tests, collection verification using `pytest --collect-only` is sufficient. Full test execution is not required to verify marker-only changes.

Learnt from: yossisegev
Repo: RedHatQE/openshift-virtualization-tests PR: 3196
File: tests/network/upgrade/test_upgrade_network.py:4-4
Timestamp: 2025-12-22T16:27:44.327Z
Learning: For PRs that remove test cases (especially redundant test cleanup PRs in openshift-virtualization-tests), test collection verification (pytest --collect-only showing selected/deselected counts) is sufficient to confirm the removal was clean and the test module remains functional. Full test execution is not required for test deletion PRs.

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: qwang1
Repo: RedHatQE/openshift-virtualization-tests PR: 3301
File: utilities/unittests/test_oadp.py:48-57
Timestamp: 2026-01-19T07:54:03.630Z
Learning: The pytest marker requirement ("all new tests MUST have markers") applies only to integration/functional tests in the `tests/` directory (e.g., `tests/virt/`, `tests/storage/`, `tests/network/`), not to unit tests in `utilities/unittests/`. Unit test files in `utilities/unittests/` (such as test_oadp.py, test_sanity.py, test_operator.py, etc.) do not use pytest markers and this is the established repository convention.
</learning>

Learnt from: EdDev
Repo: RedHatQE/openshift-virtualization-tests PR: 3612
File: tests/network/user_defined_network/ip_specification/test_ip_specification.py:10-10
Timestamp: 2026-01-26T20:29:54.623Z
Learning: In the RedHatQE/openshift-virtualization-tests repository, when introducing STD (Standard Test Definition) PRs that define test case structure without implementation, it's acceptable and intentional to use `__test__ = False` to block pytest collection until the tests are fully implemented in a follow-up PR. The STD workflow involves: (1) defining test structure, markers, and documentation first, (2) implementing the actual test logic and removing the collection blocker in a subsequent PR.

Learnt from: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 3371
File: scripts/tests_analyzer/compare_coderabbit_decisions.py:199-289
Timestamp: 2026-01-13T10:06:14.822Z
Learning: In the openshift-virtualization-tests repository, user rnetser prefers to keep pagination loops inline rather than extracting them into generic helper functions when the loops have different URL patterns and unique post-processing logic, as the inline approach improves readability and makes each endpoint's behavior more explicit.

Learnt from: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 3228
File: .coderabbit.yaml:30-41
Timestamp: 2026-01-05T10:33:55.037Z
Learning: In the openshift-virtualization-tests repository, user rnetser prefers minimal pre-merge checks in CodeRabbit configuration: only docstrings enforcement (80% threshold) is needed, not title or description checks.

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: yossisegev
Repo: RedHatQE/openshift-virtualization-tests PR: 0
File: :0-0
Timestamp: 2025-12-07T14:51:53.484Z
Learning: In the openshift-virtualization-tests repository, the team has decided to avoid using predefined time constants (like TIMEOUT_2MIN, TIMEOUT_5SEC) and prefers using explicit numeric values for timeout parameters.

Learnt from: qwang1
Repo: RedHatQE/openshift-virtualization-tests PR: 1678
File: utilities/oadp.py:5-5
Timestamp: 2025-08-26T14:51:22.273Z
Learning: qwang1 contributed the Backup resource to openshift-python-wrapper and the PR was merged. They use uv for dependency management in openshift-virtualization-tests.

@duyanyan
Copy link
Copy Markdown
Contributor

/lgtm

@rnetser
Copy link
Copy Markdown
Collaborator

rnetser commented Jan 29, 2026

/approve
/lgtm

@dalia-frank
Copy link
Copy Markdown
Contributor

/lgtm

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

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

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

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.