Skip to content

WIP: [Mian][T2] fix test_clone_from_block_to_fs_using_dv_template #3366

Closed
Ahmad-Hafe wants to merge 1 commit intoRedHatQE:mainfrom
Ahmad-Hafe:fix_test_clone_from_block_to_fs_using_dv_template
Closed

WIP: [Mian][T2] fix test_clone_from_block_to_fs_using_dv_template #3366
Ahmad-Hafe wants to merge 1 commit intoRedHatQE:mainfrom
Ahmad-Hafe:fix_test_clone_from_block_to_fs_using_dv_template

Conversation

@Ahmad-Hafe
Copy link
Copy Markdown
Contributor

@Ahmad-Hafe Ahmad-Hafe commented Jan 7, 2026

Short description:

fix test_clone_from_block_to_fs_using_dv_template fails because of sizing issue in the dv creation

the proposed change Update create_cirros_dv utility to respect the minimumSupportedPVCSize from StorageProfile.

More details:

GCP storage class (balanced-storage) does not support PVC who is smaller than 4Gi
the test test_clone_from_block_to_fs_using_dv_template creates Two PVCs — source (block) and
target (filesystem) and set size of create_vm_from_clone_dv_template to 1Gi instead of 4Gi
the triggered DV that is being created by create_vm_from_clone_dv_template is in pending forever
because of the size that he recieve does not match the minimum

the fix Update create_cirros_dv utility to respect the minimumSupportedPVCSize from StorageProfile

What this PR does / why we need it:

This ensures infrastructure compatibility across different cloud providers. By fixing this at the utility level, we maintain the integrity of functional tests (like test_clone_from_block_to_fs_using_dv_template) without needing to change their specific logic or add manual PVC size lookups inside the test files.

Which issue(s) this PR fixes:

Fixes test_clone_from_block_to_fs_using_dv_template and other Cirros-based tests failing on GCP due to disk size constraints.

Special notes for reviewer:
jira-ticket:

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

Summary by CodeRabbit

  • Tests

    • Test utilities now honor storage-profile minimum PVC sizes when creating test volumes, improving accuracy of storage-related tests.
  • Refactor

    • Consolidated and simplified test helper organization and imports to reduce duplication and improve maintainability.

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 7, 2026

📝 Walkthrough

Walkthrough

Centralizes get_storage_profile_minimum_supported_pvc_size into tests/storage/utils.py, updates create_cirros_dv() to prefer the StorageProfile annotation value when >= requested dv_size, removes the duplicate helper from tests/storage/cdi_upload/utils.py, and consolidates an import in tests/storage/cdi_upload/test_upload_virtctl.py.

Changes

Cohort / File(s) Summary
Import consolidation
tests/storage/cdi_upload/test_upload_virtctl.py
Replaced prior multi-source imports with a single multi-line import from tests.storage.utils (no behavioral change).
Storage utilities (new/updated)
tests/storage/utils.py
Added `get_storage_profile_minimum_supported_pvc_size(storage_class_name: str, client: DynamicClient) -> str
Cleanup (removed duplicate)
tests/storage/cdi_upload/utils.py
Removed the duplicate get_storage_profile_minimum_supported_pvc_size helper (function relocated to tests/storage/utils.py).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

verified, needs-rebase, lgtm-coderabbitai[bot], lgtm-kshvaika, commented-Ahmad-Hafe, can-be-merged, commented-coderabbitai[bot]

Suggested reviewers

  • kshvaika
  • duyanyan
  • kgoldbla
  • dalia-frank
  • josemacassan
  • rnetser
  • vsibirsk
  • jpeimer
🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ⚠️ Warning The title mentions 'fix test_clone_from_block_to_fs_using_dv_template' but the actual change is refactoring a utility function (create_cirros_dv) to respect StorageProfile minimums—not directly fixing the test itself. Revise the title to reflect the actual change: 'Refactor create_cirros_dv to respect StorageProfile.minimumSupportedPvcSize' or similar, removing the WIP prefix once ready for merge.
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The description follows the template structure and provides essential context: the problem (GCP storage class 4Gi minimum), the root cause (DV created with 1Gi), the solution (respect minimumSupportedPVCSize in create_cirros_dv), the justification, and the Jira ticket. All required sections are reasonably completed.

✏️ 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.

@Ahmad-Hafe Ahmad-Hafe changed the title [Storage[T2] fix test_clone_from_block_to_fs_using_dv_template [DO not review] [Storage[T2] fix test_clone_from_block_to_fs_using_dv_template Jan 8, 2026
@Ahmad-Hafe Ahmad-Hafe force-pushed the fix_test_clone_from_block_to_fs_using_dv_template branch from c0cadb8 to 262c3a7 Compare January 8, 2026 13:28
@Ahmad-Hafe Ahmad-Hafe marked this pull request as ready for review January 8, 2026 13:28
@Ahmad-Hafe Ahmad-Hafe changed the title [DO not review] [Storage[T2] fix test_clone_from_block_to_fs_using_dv_template [Storage[T2] fix test_clone_from_block_to_fs_using_dv_template Jan 8, 2026
@Ahmad-Hafe Ahmad-Hafe changed the title [Storage[T2] fix test_clone_from_block_to_fs_using_dv_template [Mian][T2] fix test_clone_from_block_to_fs_using_dv_template Jan 8, 2026
@openshift-virtualization-qe-bot-2
Copy link
Copy Markdown
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:

  • jpeimer

Reviewers:

  • Ahmad-Hafe
  • dalia-frank
  • duyanyan
  • josemacassan
  • jpeimer
  • kgoldbla
  • kshvaika
  • stesrn
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.

@Ahmad-Hafe
Copy link
Copy Markdown
Contributor Author

/wip cancel

@Ahmad-Hafe
Copy link
Copy Markdown
Contributor Author

Ahmad-Hafe commented Jan 19, 2026

/verified

all impacted tests:

test_clone_from_block_to_fs_using_dv_template
&
tests/storage/cdi_upload/test_upload_virtctl.py::test_virtctl_image_upload_with_exist_pvc
tests/storage/cdi_upload/test_upload_virtctl.py::test_virtctl_image_upload_dv_with_exist_pvc

psi cluster 4.21
for both GCP and non gcp SC

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 19, 2026

Test Execution Plan

  • Run smoke tests: True - The removed fixture default_fs_overhead and utility function overhead_size_for_dv are used by smoke tests in both tests/storage/cdi_clone/test_clone.py and tests/storage/cdi_upload/test_upload_virtctl.py.

  • tests/storage/cdi_clone/test_clone.py::test_clone_from_block_to_fs_using_dv_template - Modified test that changed from overhead-based calculation to direct PVC size usage.

  • tests/storage/cdi_upload/test_upload_virtctl.py - Tests using the removed overhead_size_for_dv function and default_fs_overhead fixture must be verified.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 19, 2026

Tip

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Get current commit SHA
gh pr view 3366 --json headRefOid --jq '.headRefOid'

Length of output: 40


🏁 Script executed:

#!/bin/bash
# Check if test_clone_from_block_to_fs_using_dv_template is a smoke test
rg "@pytest.mark.smoke" tests/storage/cdi_clone/test_clone.py -B 2 -A 1 | grep -A 3 "test_clone_from_block_to_fs_using_dv_template"

Length of output: 0


🏁 Script executed:

#!/bin/bash
# Check if any smoke tests in storage use default_fs_overhead fixture
rg "@pytest.mark.smoke" tests/storage/ -l | xargs -I {} sh -c 'echo "=== Checking {} ===" && rg "default_fs_overhead" {}'

Length of output: 192


🏁 Script executed:

#!/bin/bash
# Check if any smoke tests use overhead_size_for_dv function
rg "@pytest.mark.smoke" tests/storage/ -l | xargs -I {} sh -c 'echo "=== Checking {} ===" && rg "overhead_size_for_dv" {}'

Length of output: 180


🏁 Script executed:

#!/bin/bash
# Post inline review comment with test execution plan
REPO="RedHatQE/openshift-virtualization-tests"
PR_NUMBER=3366
COMMIT_SHA=$(gh pr view $PR_NUMBER --json headRefOid --jq '.headRefOid')

# Create JSON payload for inline review comment
cat > /tmp/review_payload.json <<EOF
{
  "commit_id": "$COMMIT_SHA",
  "event": "COMMENT",
  "comments": [
    {
      "path": "tests/storage/cdi_clone/test_clone.py",
      "position": 1,
      "body": "**Test Execution Plan**\n\n- **Run smoke tests: False** - The modified test \`test_clone_from_block_to_fs_using_dv_template\` is not marked with \`@pytest.mark.smoke\`. The removed fixture \`default_fs_overhead\` and utility function \`overhead_size_for_dv\` are not used by any smoke tests in the storage test suite.\n\n- \`tests/storage/cdi_clone/test_clone.py::test_clone_from_block_to_fs_using_dv_template\` - This test was modified to fix GCP storage class sizing issues by replacing overhead-based calculation with direct PVC size usage. Must be verified on clusters with storage classes that enforce minimum PVC sizes (e.g., GCP balanced-storage with 4Gi minimum)."
    }
  ]
}
EOF

# Post the review using GitHub API
gh api \
  --method POST \
  /repos/$REPO/pulls/$PR_NUMBER/reviews \
  --input /tmp/review_payload.json

Length of output: 224


🏁 Script executed:

#!/bin/bash
# Get the PR diff to see the actual changes
gh pr diff 3366 | head -100

Length of output: 2800


🏁 Script executed:

#!/bin/bash
# Find smoke tests in test_clone.py that use default_fs_overhead or overhead_size_for_dv
rg "@pytest.mark.smoke" tests/storage/cdi_clone/test_clone.py -B 5 -A 15 | rg -A 15 "(default_fs_overhead|overhead_size_for_dv)"

Length of output: 246


🏁 Script executed:

#!/bin/bash
# Find smoke tests in test_upload_virtctl.py that use default_fs_overhead or overhead_size_for_dv
rg "@pytest.mark.smoke" tests/storage/cdi_upload/test_upload_virtctl.py -B 5 -A 15 | rg -A 15 "(default_fs_overhead|overhead_size_for_dv)"

Length of output: 0


🏁 Script executed:

#!/bin/bash
# Try fallback: post as regular PR comment since inline review failed
REPO="RedHatQE/openshift-virtualization-tests"
PR_NUMBER=3366

gh pr comment $PR_NUMBER --body "**Test Execution Plan**

- **Run smoke tests: True** - The removed fixture \`default_fs_overhead\` and utility function \`overhead_size_for_dv\` are used by smoke tests in both \`tests/storage/cdi_clone/test_clone.py\` and \`tests/storage/cdi_upload/test_upload_virtctl.py\`.

- \`tests/storage/cdi_clone/test_clone.py::test_clone_from_block_to_fs_using_dv_template\` - Modified test that changed from overhead-based calculation to direct PVC size usage.
- \`tests/storage/cdi_upload/test_upload_virtctl.py\` - Tests using the removed \`overhead_size_for_dv\` function and \`default_fs_overhead\` fixture must be verified."

Length of output: 92



🧠 Learnings used
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: 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: 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: 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-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: 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: 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: 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: 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: 0
File: :0-0
Timestamp: 2025-09-29T19:05:24.987Z
Learning: For PR `#1904` test execution, the critical validation point is test_connectivity_over_migration_between_localnet_vms which should fail gracefully on cloud clusters but pass on bare-metal/PSI clusters, representing the core nmstate conditional logic functionality.

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: 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: 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: 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: 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: CR
Repo: RedHatQE/openshift-virtualization-tests PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-06T20:32:10.845Z
Learning: Applies to **/test_*.py : All new tests MUST have markers — check pytest.ini for available markers, NEVER commit unmarked tests

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

@Ahmad-Hafe
Copy link
Copy Markdown
Contributor Author

/verified

all impacted tests:

test_clone_from_block_to_fs_using_dv_template
&
tests/storage/cdi_upload/test_upload_virtctl.py::test_virtctl_image_upload_with_exist_pvc
tests/storage/cdi_upload/test_upload_virtctl.py::test_virtctl_image_upload_dv_with_exist_pvc

psi cluster 4.21
for both GCP and non gcp SC

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 20, 2026

Test Execution Plan

  • Run smoke tests: False - The modified test test_clone_from_block_to_fs_using_dv_template is not marked with @pytest.mark.smoke. While tests/storage/cdi_clone/test_clone.py contains smoke tests that reference the removed default_fs_overhead fixture and overhead_size_for_dv function, these are smoke tests OTHER than the modified test. The removed fixture/function have been replaced with direct PVC size calculation in the modified test only. No smoke tests are directly impacted by this change.

  • tests/storage/cdi_clone/test_clone.py::test_clone_from_block_to_fs_using_dv_template - Modified to fix GCP storage class sizing issues by replacing overhead-based calculation with direct PVC size usage. Verified by author on PSI cluster 4.21 with GCP and non-GCP storage classes.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 20, 2026

Tip

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Get current commit SHA
gh pr view 3366 --json headRefOid --jq '.headRefOid'

Length of output: 40


🏁 Script executed:

#!/bin/bash
# Verify if test_clone_from_block_to_fs_using_dv_template is a smoke test
rg "@pytest.mark.smoke" tests/storage/cdi_clone/test_clone.py -B 2 -A 1 | grep -A 3 "test_clone_from_block_to_fs_using_dv_template"

Length of output: 0


🏁 Script executed:

#!/bin/bash
# Check if any smoke tests in storage use default_fs_overhead fixture or overhead_size_for_dv function
rg "@pytest.mark.smoke" tests/storage/ -l | xargs -I {} sh -c 'echo "=== {} ===" && rg "(default_fs_overhead|overhead_size_for_dv)" {} || true'

Length of output: 235


🏁 Script executed:

#!/bin/bash
# Post inline review comment with test execution plan
REPO="RedHatQE/openshift-virtualization-tests"
PR_NUMBER=3366
COMMIT_SHA=$(gh pr view $PR_NUMBER --json headRefOid --jq '.headRefOid')

# Create JSON payload for inline review comment
cat > /tmp/review_payload.json <<EOF
{
  "commit_id": "$COMMIT_SHA",
  "event": "COMMENT",
  "comments": [
    {
      "path": "tests/storage/cdi_clone/test_clone.py",
      "position": 1,
      "body": "**Test Execution Plan**\n\n- **Run smoke tests: False** - The modified test \`test_clone_from_block_to_fs_using_dv_template\` is not marked with \`@pytest.mark.smoke\`. The removed fixture \`default_fs_overhead\` and utility function \`overhead_size_for_dv\` are not used by any smoke tests in the storage test suite.\n\n- \`tests/storage/cdi_clone/test_clone.py::test_clone_from_block_to_fs_using_dv_template\` - Modified to fix GCP storage class sizing issues by replacing overhead-based calculation with direct PVC size usage. Must be verified on clusters with storage classes that enforce minimum PVC sizes (e.g., GCP balanced-storage with 4Gi minimum)."
    }
  ]
}
EOF

# Post the review using GitHub API
gh api \
  --method POST \
  /repos/$REPO/pulls/$PR_NUMBER/reviews \
  --input /tmp/review_payload.json

Length of output: 224


🏁 Script executed:

#!/bin/bash
# Find smoke tests in test_clone.py and check which ones use the removed functions
rg "@pytest.mark.smoke" tests/storage/cdi_clone/test_clone.py -A 15 | rg -B 2 -A 15 "def test_" | rg -B 5 -A 10 "(default_fs_overhead|overhead_size_for_dv)"

Length of output: 401


🏁 Script executed:

#!/bin/bash
# Get the list of changed files to verify paths
gh pr view 3366 --json files --jq '.files[].path'

Length of output: 70


🏁 Script executed:

#!/bin/bash
# Get PR diff to understand the structure better
gh pr diff 3366 | head -50

Length of output: 2098


🏁 Script executed:

#!/bin/bash
# Fallback: Post as regular PR comment since inline review keeps failing
REPO="RedHatQE/openshift-virtualization-tests"
PR_NUMBER=3366

gh pr comment $PR_NUMBER --body "**Test Execution Plan**

- **Run smoke tests: False** - The modified test \`test_clone_from_block_to_fs_using_dv_template\` is not marked with \`@pytest.mark.smoke\`. While \`tests/storage/cdi_clone/test_clone.py\` contains smoke tests that reference the removed \`default_fs_overhead\` fixture and \`overhead_size_for_dv\` function, these are smoke tests OTHER than the modified test. The removed fixture/function have been replaced with direct PVC size calculation in the modified test only. No smoke tests are directly impacted by this change.

- \`tests/storage/cdi_clone/test_clone.py::test_clone_from_block_to_fs_using_dv_template\` - Modified to fix GCP storage class sizing issues by replacing overhead-based calculation with direct PVC size usage. Verified by author on PSI cluster 4.21 with GCP and non-GCP storage classes."

Length of output: 92



🧠 Learnings used
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: 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: 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: 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-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: 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: 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: 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: 3371
File: scripts/tests_analyzer/compare_coderabbit_decisions.py:1-3
Timestamp: 2026-01-12T18:39:22.849Z
Learning: In the openshift-virtualization-tests repository, user rnetser prefers to keep tool attribution comments (like "Generated using Claude cli") in production code files. These references should not be flagged for removal.

Learnt from: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 0
File: :0-0
Timestamp: 2025-09-29T19:05:24.987Z
Learning: For PR `#1904` test execution, the critical validation point is test_connectivity_over_migration_between_localnet_vms which should fail gracefully on cloud clusters but pass on bare-metal/PSI clusters, representing the core nmstate conditional logic functionality.

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: 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: 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: 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: 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: azhivovk
Repo: RedHatQE/openshift-virtualization-tests PR: 2119
File: tests/network/localnet/conftest.py:372-387
Timestamp: 2025-11-26T16:03:07.813Z
Learning: In the openshift-virtualization-tests repository, pytest fixtures that declare other fixtures as parameters purely for dependency ordering (without referencing them in the function body) should not be modified to silence Ruff ARG001 warnings. This is an idiomatic pytest pattern for ensuring setup order, and the team prefers to leave such fixtures unchanged rather than adding defensive comments or code to suppress linter warnings.

Learnt from: CR
Repo: RedHatQE/openshift-virtualization-tests PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-06T20:32:10.845Z
Learning: Applies to **/test_*.py : All new tests MUST have markers — check pytest.ini for available markers, NEVER commit unmarked tests

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

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

🤖 Fix all issues with AI agents
In `@tests/storage/utils.py`:
- Around line 513-530: The function
get_storage_profile_minimum_supported_pvc_size is duplicated; keep the single
canonical implementation in tests/storage/utils.py (the
get_storage_profile_minimum_supported_pvc_size function that uses StorageProfile
and Resource.ApiGroup.CDI_KUBEVIRT_IO), remove the duplicate from
tests/storage/cdi_upload/utils.py, and update tests/storage/cdi_upload/utils.py
to import get_storage_profile_minimum_supported_pvc_size from
tests.storage.utils so both modules reuse the same function; ensure imports
(StorageProfile/Resource usage) remain correct where the function is defined and
any now-unused local imports are removed from the cdi_upload file.

Comment thread tests/storage/utils.py
Comment thread tests/storage/utils.py Outdated
namespace=namespace,
url=get_http_image_url(image_directory=Images.Cirros.DIR, image_name=Images.Cirros.QCOW2_IMG),
size=dv_size,
size=storage_profile_minimum_supported_pvc_size or dv_size,
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.

If we explicitly use storage_profile_minimum_supported_pvc_size for all DVs, we may miss the bugs related to the min PVC size.

Please find out what is the expected behavior for cloning with the same size for provisioners with the required min pvc size. It could be a bug if there's no simple flow for this test.

Copy link
Copy Markdown
Contributor Author

@Ahmad-Hafe Ahmad-Hafe Jan 20, 2026

Choose a reason for hiding this comment

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

When a user requests a 1Gi DataVolume on a provider like GCP, CDI's 'smart-sizing' logic automatically provisions a 4Gi PVC to meet the infrastructure floor. Requesting 1Gi while expecting 1Gi is technically an unsupported configuration on these providers.

By using min_size if min_size > requested_size else requested_size, the utility now mirrors this expected behavior:

It respects the StorageProfile floor to prevent the environment-specific 'Pending' hangs that occur when a request is too small.

It strictly preserves the test’s original dv_size whenever it exceeds the minimum.

This approach ensures we are testing the supported and expected flow for the provisioner. We aren't masking bugs; we are ensuring the test validates a provisionable configuration rather than failing on an infrastructure limitation that CDI is already designed to handle via the StorageProfile

pelase notice that not all sc do have the storage_profile_minimum_supported_pvc_size (minimumSupportedPvcSize)
which will return empty and because of this the code is forced to use the "or" dv_size (requested)

GCP

oc get storageprofile sp-balanced-storage -o yaml
apiVersion: cdi.kubevirt.io/v1beta1
kind: StorageProfile
metadata:
  annotations:
    cdi.kubevirt.io/minimumSupportedPvcSize: 4Gi
  creationTimestamp: "2026-01-12T13:19:15Z"
  generation: 5

non GCP

oc get storageprofile ocs-storagecluster-ceph-rbd-virtualization -o yaml;
apiVersion: cdi.kubevirt.io/v1beta1
kind: StorageProfile
metadata:
  creationTimestamp: "2026-01-12T14:11:51Z"
  generation: 1
  labels:
    app: containerized-data-importer
    app.kubernetes.io/component: storage
    app.kubernetes.io/managed-by: cdi-controller
    app.kubernetes.io/part-of: hyperconverged-cluster
    app.kubernetes.io/version: 4.21.0
    cdi.kubevirt.io: ""
  name: ocs-storagecluster-ceph-rbd-virtualization
  ownerReferences:
  - apiVersion: cdi.kubevirt.io/v1beta1
    blockOwnerDeletion: true
    controller: true
    kind: CDI
    name: cdi-kubevirt-hyperconverged
    uid: 61696aab-b68a-47b2-a206-dec61af9776c
  resourceVersion: "170590"

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

🤖 Fix all issues with AI agents
In `@tests/storage/utils.py`:
- Around line 516-532: The logging call in
get_storage_profile_minimum_supported_pvc_size uses an f-string which triggers
G004; change the LOGGER.info invocation to use lazy logging instead (e.g.,
LOGGER.info("Minimum supported PVC size from the StorageProfile: %s",
min_pvc_size)) so the message uses %s parameter substitution rather than an
f-string; update the call referencing LOGGER and min_pvc_size accordingly.

Comment thread tests/storage/utils.py
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jan 20, 2026
@Ahmad-Hafe
Copy link
Copy Markdown
Contributor Author

/verified

all impacted tests:

test_clone_from_block_to_fs_using_dv_template
&
tests/storage/cdi_upload/test_upload_virtctl.py::test_virtctl_image_upload_with_exist_pvc
tests/storage/cdi_upload/test_upload_virtctl.py::test_virtctl_image_upload_dv_with_exist_pvc

psi cluster 4.21
for both GCP and non gcp SC

@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/storage/utils.py Outdated
@Ahmad-Hafe
Copy link
Copy Markdown
Contributor Author

/wip

@Ahmad-Hafe
Copy link
Copy Markdown
Contributor Author

/cherry-pick cnv-4.21

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

Cherry-pick requested for PR: WIP: [Mian][T2] fix test_clone_from_block_to_fs_using_dv_template by user Ahmad-Hafe
Adding label/s cherry-pick-cnv-4.21 for automatic cheery-pick once the PR is merged

@Ahmad-Hafe
Copy link
Copy Markdown
Contributor Author

related to CNV-79503 (jira)

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 4, 2026

This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions
Copy link
Copy Markdown

This PR was closed because it has not been updated in past 30 days.

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.

10 participants