Repository navigation
refactor: extract virt fixtures from tests/conftest.py - #5682
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: RedHatQE/openshift-virtualization-tests/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (3)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews: Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📜 Recent review details🧰 Additional context used📓 Path-based instructions (2)When an `STP:` link is present and linked-repo analysis finds missing or misaligned scenarios, you MUST post an INLINE review comment on the `STP:` line (or the module docstring when the STP line is unchanged) containing: **STP coverage: X/...⚙️ CodeRabbit configuration file Files:
You may approve the PR when ALL of the following are true: All your review comments have been addressed with either: a code/doc change that fixes the issue, or a substantive author response that justifies no code change.⚙️ CodeRabbit configuration file Files:
🧠 Learnings (1)📓 Common learnings🔀 Multi-repo context RedHatQE/openshift-virtualization-tests-design-docsLinked repositories findings
🔇 Additional comments (3)
📝 WalkthroughWalkthroughVirtualization pytest fixtures move from ChangesVirtualization fixture modularization
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Refactor Merge Risk: ⚪ Minimal · up to This change moves virtualization test fixtures into dedicated modules and registers them as plugins. No concrete merge-blocking risk was identified from the supplied context. Normal CI and the reported smoke runs should cover fixture discovery. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change broadens where virtualization test fixtures can be discovered, but the examined VM, migration, and SSH-key fixtures retain their existing clients and lifecycle behavior. No introduced security issue was established; the effect on tests outside the former fixture scope remains uncertain. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
Report bugs in Issues Welcome! 🎉This pull request will be automatically processed with the following features: 🔄 Automatic Actions
📋 Available CommandsPR Status Management
Review & Approval
Testing & Validation
Container Operations
Cherry-pick Operations
Branch Management
Label Management
✅ Merge RequirementsThis PR will be automatically approved when the following conditions are met:
📊 Review ProcessApprovers and ReviewersApprovers:
Reviewers:
Available Labels
AI Features
Security Checks
💡 Tips
📌 Additional InformationCustom Commands:
For more information, please refer to the project documentation or contact the maintainers. |
|
/verified smoke |
Test execution plan request detailsCRITICAL: You MUST post an inline review comment on the first changed line of the first file. As an expert software testing engineer, analyze all modified files in this PR and create a targeted test execution plan. Analysis Requirements:
Output rules: Your deliverable: Test Execution Plan
Use these formats:
Real test commands (MANDATORY when changes affect session/runtime code): When the affected code runs at session/collection time (conftest fixtures, pytest plugins,
Example output for a session-startup fix: Guidelines:
Hardware-Related Checks (SR-IOV, GPU, DPDK): When PR modifies fixtures for hardware-specific resources:
CRITICAL WORKFLOW COMPLETION RULES: When responding to this test execution plan request, you MUST follow these rules EXACTLY:
ABSOLUTE PROHIBITIONS (violating these creates empty/meaningless reviews):
Remember: The pull request review is visible to users. Additional comments are redundant noise. CRITICAL — Verification rules for smoke and gating decisions: |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '=== PR metadata and changed files ==='
gh pr view 5682 --json baseRefName,headRefName,files --jq '{baseRefName,headRefName,files:[.files[].path]}'
echo '=== Diff name/status and first changed hunk ==='
git diff --name-status "origin/$(gh pr view 5682 --json baseRefName --jq .baseRefName)...HEAD"
first_file="$(git diff --name-only "origin/$(gh pr view 5682 --json baseRefName --jq .baseRefName)...HEAD" | head -n1)"
printf 'FIRST_FILE=%s\n' "$first_file"
git diff --unified=0 "origin/$(gh pr view 5682 --json baseRefName --jq .baseRefName)...HEAD" -- "$first_file" | sed -n '1,100p'
echo '=== Changed-file outlines ==='
git diff --name-only "origin/$(gh pr view 5682 --json baseRefName --jq .baseRefName)...HEAD" \
| while IFS= read -r file; do
echo "--- $file"
ast-grep outline "$file" --items all 2>/dev/null || true
doneLength of output: 1753 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '=== PR files and patches from GitHub ==='
gh api --paginate "repos/RedHatQE/openshift-virtualization-tests/pulls/5682/files?per_page=100" \
--jq '.[] | "FILE: \(.filename)\nSTATUS: \(.status)\nPATCH:\n\(.patch // "(no textual patch)")\n---"' \
> /tmp/pr5682-files.txt
sed -n '1,2400p' /tmp/pr5682-files.txt
echo '=== First changed file and first added/changed line from patch ==='
python3 - <<'PY'
import json, subprocess
files = json.loads(subprocess.check_output([
"gh", "api", "--paginate",
"repos/RedHatQE/openshift-virtualization-tests/pulls/5682/files?per_page=100"
]))
first = files[0]
line = None
new_line = 0
for row in (first.get("patch") or "").splitlines():
if row.startswith("@@"):
rhs = row.split("+", 1)[1].split(" ", 1)[0]
new_line = int(rhs.split(",", 1)[0])
elif row.startswith("+") and not row.startswith("+++"):
line = new_line
break
elif not row.startswith("-"):
new_line += 1
print(f'{first["filename"]}:{line}')
PY
echo '=== Current changed-module fixture definitions ==='
for f in conftest.py tests/conftest.py tests/fixtures/virt/*.py; do
if [ -f "$f" ]; then
echo "--- $f"
rg -n -C2 '^`@pytest`\.fixture|^def |^pytest_plugins' "$f" || true
fi
done
echo '=== Fixture reference candidates across tests (excluding changed modules) ==='
rg -n --glob '*.py' \
'\b(instance_type|vm_preference|migration_policy|migrated_vm_multiple_times|osinfo|ssh_key|base_templates|rhel_latest_os_params|vm_for_migration_test|vm_actions)\b' \
tests -g '!tests/conftest.py' -g '!tests/fixtures/virt/**' || true
echo '=== Smoke and gating marked files ==='
printf '%s\n' '[smoke]'
rg -l '`@pytest`\.mark\.smoke' tests/ || true
printf '%s\n' '[gating]'
rg -l '`@pytest`\.mark\.gating' tests/ || trueLength of output: 100837 🏁 Script executed: #!/bin/bash
set -euo pipefail
fixtures=(
common_instance_type_param_dict instance_type_for_test_scope_class
common_vm_preference_param_dict vm_preference_for_test
migration_policy_with_bandwidth migration_policy_with_bandwidth_scope_class migrated_vm_multiple_times
osinfo_repo latest_osinfo_db_file_name downloaded_latest_libosinfo_db
ssh_key_tmpdir_scope_session generated_ssh_key_for_vm_access
base_templates rhel_latest_os_params vm_for_migration_test vm_for_test running_metric_vm
vm_from_template_with_existing_dv started_windows_vm rhel_vm_with_instance_type_and_preference
rhel_vm_with_cluster_instance_type_and_preference ping_process_in_rhel_os
)
echo '=== Exact moved-fixture consumers (tests only, changed fixture modules excluded) ==='
for fixture in "${fixtures[@]}"; do
echo "--- FIXTURE: $fixture"
rg -n -P "(?<![A-Za-z0-9_])${fixture}(?![A-Za-z0-9_])" tests \
-g '*.py' -g '!tests/conftest.py' -g '!tests/fixtures/virt/**' || true
done
echo '=== Signatures, fixture parametrization, and markers in direct consumer files ==='
consumer_files=(
tests/infrastructure/instance_types/test_vm_with_instance_and_pref.py
tests/infrastructure/golden_images/update_boot_source/test_ssp_common_templates_boot_sources.py
tests/infrastructure/golden_images/update_boot_source/test_ssp_data_sources.py
tests/virt/cluster/common_templates/custom_namespace/conftest.py
tests/virt/cluster/common_templates/custom_namespace/test_custom_namespace.py
tests/virt/cluster/common_templates/general/test_base_template.py
tests/virt/cluster/migration_and_maintenance/test_evictionstrategy.py
tests/observability/metrics/test_ssp_metrics.py
tests/virt/upgrade/conftest.py
tests/virt/upgrade/test_upgrade_virt.py
tests/storage/storage_migration/conftest.py
tests/install_upgrade_operators/must_gather/conftest.py
tests/install_upgrade_operators/must_gather/test_must_gather_vms.py
)
for file in "${consumer_files[@]}"; do
if [ -f "$file" ]; then
echo "--- $file"
rg -n -C2 '`@pytest`\.mark|`@pytest`\.fixture|def (test_|[A-Za-z_]+)\(' "$file" || true
fi
done
echo '=== Smoke/gating files: direct fixture uses and local conftest chains ==='
for file in $(rg -l '`@pytest`\.mark\.(smoke|gating)' tests/); do
hits=$(rg -n -P '(?<![A-Za-z0-9_])(common_instance_type_param_dict|instance_type_for_test_scope_class|common_vm_preference_param_dict|vm_preference_for_test|migration_policy_with_bandwidth|migration_policy_with_bandwidth_scope_class|migrated_vm_multiple_times|osinfo_repo|latest_osinfo_db_file_name|downloaded_latest_libosinfo_db|ssh_key_tmpdir_scope_session|generated_ssh_key_for_vm_access|base_templates|rhel_latest_os_params|vm_for_migration_test|vm_for_test|running_metric_vm|vm_from_template_with_existing_dv|started_windows_vm|rhel_vm_with_instance_type_and_preference|rhel_vm_with_cluster_instance_type_and_preference|ping_process_in_rhel_os)(?![A-Za-z0-9_])' "$file" || true)
if [ -n "$hits" ]; then echo "--- $file"; echo "$hits"; fi
doneLength of output: 98234 🏁 Script executed: #!/bin/bash
set -euo pipefail
head_sha="$(gh pr view 5682 --json headRefOid --jq .headRefOid)"
body="$(cat <<'EOF'
## Test Execution Plan
**Run smoke tests: True** — verified paths:
- `tests/infrastructure/instance_types/supported_os/test_rhel_os.py::TestVM...::test_pause_unpause_after_migrate` *(smoke, gating)* → `ping_process_in_rhel_os` → relocated `tests/fixtures/virt/vm_actions.py`.
- `tests/virt/cluster/common_templates/rhel/test_rhel_os_support.py::TestVM...::test_pause_unpause_after_migrate` *(smoke)* → `ping_process_in_rhel_os` → relocated `tests/fixtures/virt/vm_actions.py`.
**Run gating tests: True** — verified paths:
- `tests/virt/cluster/common_templates/general/test_base_template.py::test_base_templates_annotations` *(gating)* → `base_templates` → relocated `tests/fixtures/virt/templates.py`.
- `tests/virt/cluster/common_templates/general/test_base_template.py::test_validate_rhel_min_max_memory` *(gating file)* → `downloaded_latest_libosinfo_db` → `latest_osinfo_db_file_name` / `osinfo_repo` → relocated `tests/fixtures/virt/osinfo.py`.
- `tests/infrastructure/instance_types/supported_os/test_rhel_os.py::TestVM...::test_pause_unpause_after_migrate` *(gating)* → `ping_process_in_rhel_os` → relocated `tests/fixtures/virt/vm_actions.py`.
**Affected tests to run**
- `tests/infrastructure/instance_types/supported_os/test_rhel_os.py` *(smoke, gating)*
- `tests/virt/cluster/common_templates/rhel/test_rhel_os_support.py` *(smoke)*
- `tests/virt/cluster/common_templates/general/test_base_template.py` *(gating; templates, libosinfo download, existing-DV VM fixture)*
- `tests/infrastructure/instance_types/test_vm_with_instance_and_pref.py` *(instance-type/preference fixtures)*
- `tests/install_upgrade_operators/must_gather/test_must_gather_vms.py::TestNoMultipleFilesCollected::test_no_multiple_empty_files_collected_from_must_gather_migrated_vm` *(migration VM setup and cleanup)*
- `tests/storage/cdi_import/test_import_http.py::Test...` Windows-import case using `started_windows_vm` *(Windows VM fixture)*
- `tests/virt/upgrade/test_upgrade_virt.py::Test...::test_golden_image_pvc_names_after_upgrade` *(gating file; `base_templates` and `rhel_latest_os_params` chain)*
**Real tests (cluster required)**
Error/fix path — validate plugin registration and fixture discovery after removing the fixtures from `tests/conftest.py`:
```bash
uv run pytest --tc-file=tests/global_config.py --tc-format=python --collect-only \
tests/infrastructure/instance_types/supported_os/test_rhel_os.py \
tests/virt/cluster/common_templates/general/test_base_template.pyExpected: collection succeeds with no Happy path — run direct smoke consumers: uv run pytest --tc-file=tests/global_config.py --tc-format=python \
--cluster-sanity-skip-check --storage-class-matrix=<valid-storage-class> \
tests/infrastructure/instance_types/supported_os/test_rhel_os.py \
tests/virt/cluster/common_templates/rhel/test_rhel_os_support.py -m smokeExpected: VM lifecycle/migration tests complete and Also run the gating fixture paths: uv run pytest --tc-file=tests/global_config.py --tc-format=python \
--cluster-sanity-skip-check \
tests/virt/cluster/common_templates/general/test_base_template.py -m gatingExpected: base-template enumeration and libosinfo download fixtures resolve from their relocated plugins. gh api --method POST "repos/RedHatQE/openshift-virtualization-tests/pulls/5682/comments" |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/conftest.py`:
- Around line 2388-2391: Update skip_if_no_cpumanager_workers to pass the
label-checking generator directly to any instead of materializing it with a list
comprehension, preserving the existing skip behavior and short-circuit
evaluation.
In `@tests/fixtures/virt/migration.py`:
- Around line 34-49: Wrap the setup loop and yield in migrated_vm_multiple_times
with a try/finally so cleanup always executes when deploy or wait_for_status
fails. Keep tracking each successfully created migration in vmim, and run
mig_obj.clean_up() for all tracked migrations from the finally block.
In `@tests/fixtures/virt/osinfo.py`:
- Around line 21-24: The requests.get call in the BeautifulSoup setup must use
an explicit timeout and pass the repository URL via the named url= argument.
Update the call while preserving its existing headers, certificate verification,
and response text handling.
In `@tests/fixtures/virt/virtual_machines.py`:
- Around line 109-129: Update the rhel_vm_with_instance_type_and_preference
fixture to combine the instance type, VM preference, and VirtualMachineForTests
context managers into a single parenthesized with statement, preserving their
existing aliases, arguments, and yield behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 643c8d7a-2f37-4909-abaf-a2b660c9a177
📒 Files selected for processing (10)
conftest.pytests/conftest.pytests/fixtures/virt/__init__.pytests/fixtures/virt/instance_types.pytests/fixtures/virt/migration.pytests/fixtures/virt/osinfo.pytests/fixtures/virt/ssh.pytests/fixtures/virt/templates.pytests/fixtures/virt/virtual_machines.pytests/fixtures/virt/vm_actions.py
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
RedHatQE/openshift-virtualization-tests-design-docs(manual)
869c902
e65e5ea to
869c902
Compare
|
/verified |
Test execution plan request detailsCRITICAL: You MUST post an inline review comment on the first changed line of the first file. As an expert software testing engineer, analyze all modified files in this PR and create a targeted test execution plan. Analysis Requirements:
Output rules: Your deliverable: Test Execution Plan
Use these formats:
Real test commands (MANDATORY when changes affect session/runtime code): When the affected code runs at session/collection time (conftest fixtures, pytest plugins,
Example output for a session-startup fix: Guidelines:
Hardware-Related Checks (SR-IOV, GPU, DPDK): When PR modifies fixtures for hardware-specific resources:
CRITICAL WORKFLOW COMPLETION RULES: When responding to this test execution plan request, you MUST follow these rules EXACTLY:
ABSOLUTE PROHIBITIONS (violating these creates empty/meaningless reviews):
Remember: The pull request review is visible to users. Additional comments are redundant noise. CRITICAL — Verification rules for smoke and gating decisions: |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
repo="RedHatQE/openshift-virtualization-tests"
pr="5682"
base="$(gh pr view "$pr" --json baseRefName --jq '.baseRefName')"
range="origin/${base}...HEAD"
echo "HEAD=$(gh pr view "$pr" --json headRefOid --jq '.headRefOid')"
echo '=== changed files ==='
git diff --name-status "$range"
echo '=== first changed location ==='
first_file="$(git diff --name-only "$range" | head -n 1)"
echo "FILE=$first_file"
git diff --unified=0 "$range" -- "$first_file" | sed -n '1,100p'
echo '=== plugin registrations ==='
rg -n 'tests\.fixtures\.virt\.(instance_types|migration|osinfo|ssh|templates|virtual_machines|vm_actions)' conftest.py || true
echo '=== relocated fixture consumers ==='
fixtures='common_instance_type_param_dict|instance_type_for_test_scope_class|common_vm_preference_param_dict|vm_preference_for_test|migration_policy_with_bandwidth|migration_policy_with_bandwidth_scope_class|migrated_vm_multiple_times|osinfo_repo|latest_osinfo_db_file_name|downloaded_latest_libosinfo_db|ssh_key_tmpdir_scope_session|generated_ssh_key_for_vm_access|base_templates|rhel_latest_os_params|vm_for_migration_test|vm_for_test|running_metric_vm|vm_from_template_with_existing_dv|started_windows_vm|rhel_vm_with_instance_type_and_preference|rhel_vm_with_cluster_instance_type_and_preference|ping_process_in_rhel_os'
rg -n -P "(?<![A-Za-z0-9_])(${fixtures})(?![A-Za-z0-9_])" tests \
-g '*.py' -g '!tests/conftest.py' -g '!tests/fixtures/virt/**' || true
echo '=== smoke marker files ==='
rg -l '`@pytest`\.mark\.smoke' tests || true
echo '=== gating marker files ==='
rg -l '`@pytest`\.mark\.gating' tests || true
echo '=== marker and test context in known direct consumers ==='
rg -n -C3 '`@pytest`\.mark\.(smoke|gating)|^class Test|^\s*def test_' \
tests/infrastructure/instance_types/supported_os/test_rhel_os.py \
tests/virt/cluster/common_templates/rhel/test_rhel_os_support.py \
tests/virt/cluster/common_templates/general/test_base_template.py \
tests/infrastructure/instance_types/test_vm_with_instance_and_pref.py \
tests/install_upgrade_operators/must_gather/test_must_gather_vms.py \
tests/storage/cdi_import/test_import_http.py \
tests/virt/upgrade/test_upgrade_virt.py 2>/dev/null || trueLength of output: 2701 🏁 Script executed: #!/bin/bash
set -euo pipefail
repo="RedHatQE/openshift-virtualization-tests"
pr="5682"
gh api "repos/${repo}/pulls/${pr}" --jq '{head: .head.sha, base: .base.ref}'
gh api --paginate "repos/${repo}/pulls/${pr}/files?per_page=100" > /tmp/pr5682-files.json
echo '=== changed files and first inline location ==='
python3 - <<'PY'
import json
files = json.load(open("/tmp/pr5682-files.json"))
for item in files:
print(f'{item["status"]}\t{item["filename"]}')
first = files[0]
line = None
new_line = 0
for row in (first.get("patch") or "").splitlines():
if row.startswith("@@"):
new_line = int(row.split("+", 1)[1].split(" ", 1)[0].split(",", 1)[0])
elif row.startswith("+") and not row.startswith("+++"):
line = new_line
break
elif not row.startswith("-"):
new_line += 1
print(f'INLINE={first["filename"]}:{line}')
PY
echo '=== plugin registrations ==='
rg -n 'tests\.fixtures\.virt\.(instance_types|migration|osinfo|ssh|templates|virtual_machines|vm_actions)' conftest.py || true
echo '=== direct relocated-fixture consumers ==='
fixtures='common_instance_type_param_dict|instance_type_for_test_scope_class|common_vm_preference_param_dict|vm_preference_for_test|migration_policy_with_bandwidth|migration_policy_with_bandwidth_scope_class|migrated_vm_multiple_times|osinfo_repo|latest_osinfo_db_file_name|downloaded_latest_libosinfo_db|ssh_key_tmpdir_scope_session|generated_ssh_key_for_vm_access|base_templates|rhel_latest_os_params|vm_for_migration_test|vm_for_test|running_metric_vm|vm_from_template_with_existing_dv|started_windows_vm|rhel_vm_with_instance_type_and_preference|rhel_vm_with_cluster_instance_type_and_preference|ping_process_in_rhel_os'
rg -n -P "(?<![A-Za-z0-9_])(${fixtures})(?![A-Za-z0-9_])" tests \
-g '*.py' -g '!tests/conftest.py' -g '!tests/fixtures/virt/**' || true
echo '=== marker evidence ==='
rg -n '`@pytest`\.mark\.(smoke|gating)' \
tests/infrastructure/instance_types/supported_os/test_rhel_os.py \
tests/virt/cluster/common_templates/rhel/test_rhel_os_support.py \
tests/virt/cluster/common_templates/general/test_base_template.py \
tests/virt/upgrade/test_upgrade_virt.py 2>/dev/null || trueLength of output: 28238 🏁 Script executed: #!/bin/bash
set -euo pipefail
repo="RedHatQE/openshift-virtualization-tests"
pr="5682"
head_sha="$(gh api "repos/${repo}/pulls/${pr}" --jq '.head.sha')"
body="$(cat <<'EOF'
## Test Execution Plan
**Run smoke tests: True.**
- `tests/infrastructure/instance_types/supported_os/test_rhel_os.py::TestVMMigrationAndState::test_pause_unpause_after_migrate` *(smoke, gating)* → `ping_process_in_rhel_os` → `tests.fixtures.virt.vm_actions`.
- `tests/virt/cluster/common_templates/rhel/test_rhel_os_support.py::TestCommonTemplatesRhel::test_pause_unpause_after_migrate` *(smoke)* → `ping_process_in_rhel_os` → `tests.fixtures.virt.vm_actions`.
**Run gating tests: True.**
- `tests/virt/cluster/common_templates/general/test_base_template.py::test_base_templates_annotations` *(gating)* → `base_templates` → `tests.fixtures.virt.templates`.
- `tests/virt/cluster/common_templates/general/test_base_template.py::test_validate_rhel_min_max_memory` and `::test_validate_windows_min_max_memory` *(gating)* → `downloaded_latest_libosinfo_db` → `tests.fixtures.virt.osinfo`.
- `tests/virt/upgrade/test_upgrade_virt.py::TestUpgradeVirt::test_golden_image_pvc_names_after_upgrade` *(gating)* → `base_templates` → `tests.fixtures.virt.templates`.
**Affected tests to run**
- `tests/infrastructure/instance_types/supported_os/test_rhel_os.py` *(smoke, gating)*
- `tests/virt/cluster/common_templates/rhel/test_rhel_os_support.py` *(smoke)*
- `tests/virt/cluster/common_templates/general/test_base_template.py` *(gating; template, osinfo, and existing-DV VM fixtures)*
- `tests/infrastructure/instance_types/test_vm_with_instance_and_pref.py` *(instance type and preference fixtures)*
- `tests/install_upgrade_operators/must_gather/test_must_gather_vms.py::TestNoMultipleFilesCollected::test_no_multiple_empty_files_collected_from_must_gather_migrated_vm` *(migration fixture setup and cleanup)*
- `tests/storage/cdi_import/test_import_http.py` *(Windows VM fixture)*
- `tests/observability/metrics/test_vms_metrics.py` *(VM and metric VM fixtures)*
- `tests/virt/upgrade/test_upgrade_virt.py::TestUpgradeVirt::test_golden_image_pvc_names_after_upgrade` *(gating)*
**Real tests (cluster required)**
Error path — verify fixture plugin registration and discovery:
```bash
uv run pytest --tc-file=tests/global_config.py --tc-format=python --collect-only \
tests/infrastructure/instance_types/supported_os/test_rhel_os.py \
tests/virt/cluster/common_templates/general/test_base_template.py
```
Expected: collection completes with no plugin import error and no `fixture ... not found` error.
Happy path — verify relocated smoke fixtures:
```bash
uv run pytest --tc-file=tests/global_config.py --tc-format=python \
--cluster-sanity-skip-check --storage-class-matrix=<valid-storage-class> \
tests/infrastructure/instance_types/supported_os/test_rhel_os.py \
tests/virt/cluster/common_templates/rhel/test_rhel_os_support.py -m smoke
```
Expected: VM lifecycle and migration tests pass. `ping_process_in_rhel_os` resolves from `tests.fixtures.virt.vm_actions`.
Gating regression:
```bash
uv run pytest --tc-file=tests/global_config.py --tc-format=python \
--cluster-sanity-skip-check \
tests/virt/cluster/common_templates/general/test_base_template.py -m gating
```
Expected: `base_templates` and `downloaded_latest_libosinfo_db` resolve from their relocated fixture modules.
EOF
)"
for attempt in 1 2; do
if gh api --method POST "repos/${repo}/pulls/${pr}/comments" \
-f body="$body" \
-f commit_id="$head_sha" \
-f path="conftest.py" \
-F line=108 \
-f side="RIGHT" >/dev/null; then
exit 0
fi
[ "$attempt" -eq 1 ] || exit 1
sleep 2
doneLength of output: 3805
You are interacting with an AI system. |
|
/retest all Auto-triggered: Files in this PR were modified by merged PR #5232. Overlapping filesconftest.py |
|
/lgtm |
|
/retest all Auto-triggered: Files in this PR were modified by merged PR #4666. Overlapping filestests/conftest.py |
CNV-80951 — move virt fixtures into domain modules under tests/fixtures/virt/, rebased onto main (prior conftest extractions already merged). Modules: - instance_types.py — instance type and VM preference param fixtures - migration.py — migration policy, migrated_vm_multiple_times, is_postcopy_migration_bug_open - osinfo.py — libosinfo DB download fixtures - ssh.py — SSH key generation fixtures - templates.py — base_templates - virtual_machines.py — all VM creation fixtures and rhel_latest_os_params - vm_actions.py — ping_process_in_rhel_os (per review feedback) Register all seven modules in pytest_plugins in root conftest.py. Assisted-by: Cursor Agent (Composer 2.5) Signed-off-by: vsibirsk <[email protected]>
|
/verified |
Test execution plan request detailsCRITICAL: You MUST post an inline review comment on the first changed line of the first file. As an expert software testing engineer, analyze all modified files in this PR and create a targeted test execution plan. Analysis Requirements:
Output rules: Your deliverable: Test Execution Plan
Use these formats:
Real test commands (MANDATORY when changes affect session/runtime code): When the affected code runs at session/collection time (conftest fixtures, pytest plugins,
Example output for a session-startup fix: Guidelines:
Hardware-Related Checks (SR-IOV, GPU, DPDK): When PR modifies fixtures for hardware-specific resources:
CRITICAL WORKFLOW COMPLETION RULES: When responding to this test execution plan request, you MUST follow these rules EXACTLY:
ABSOLUTE PROHIBITIONS (violating these creates empty/meaningless reviews):
Remember: The pull request review is visible to users. Additional comments are redundant noise. CRITICAL — Verification rules for smoke and gating decisions: |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
gh api repos/RedHatQE/openshift-virtualization-tests/pulls/5682 --jq '{head:.head.sha,base:.base.sha}'
gh api --paginate 'repos/RedHatQE/openshift-virtualization-tests/pulls/5682/files?per_page=100' > /tmp/pr5682-files.json
python - <<'PY'
import json
for f in json.load(open('/tmp/pr5682-files.json')):
print('\nFILE:',f['filename'],'\n',f.get('patch','NO PATCH'))
PY
git rev-parse HEAD
for f in conftest.py tests/conftest.py tests/fixtures/virt/*.py; do
[ ! -f "$f" ] || ast-grep outline "$f" --items all
done
echo SMOKE
rg -l '@pytest.mark.smoke' tests/ || true
echo GATING
rg -l '@pytest.mark.gating' tests/ || trueLength of output: 43651 🏁 Script executed: #!/bin/bash
set -euo pipefail
sed -n '55,105p' tests/conftest.py
sed -n '350,378p' tests/conftest.py
python - <<'PY'
import ast,json,pathlib
changed=json.load(open('/tmp/pr5682-files.json'))
roots=set()
for f in changed:
p=pathlib.Path(f['filename'])
if '/virt/' in str(p) and p.suffix=='.py':
t=ast.parse(p.read_text())
roots.update(n.name for n in t.body if isinstance(n,ast.FunctionDef))
roots.add('junitxml_plugin')
records=[]
for p in pathlib.Path('tests').rglob('*.py'):
try: t=ast.parse(p.read_text())
except SyntaxError: continue
def walk(nodes,cls='',marks=()):
for n in nodes:
if isinstance(n,ast.ClassDef):
walk(n.body,n.name,marks+tuple(ast.unparse(d) for d in n.decorator_list))
elif isinstance(n,(ast.FunctionDef,ast.AsyncFunctionDef)):
dec=marks+tuple(ast.unparse(d) for d in n.decorator_list)
refs={a.arg for a in n.args.args}
refs.update(x.id for x in ast.walk(n) if isinstance(x,ast.Name))
refs.update(x.value for x in ast.walk(n) if isinstance(x,ast.Constant) and isinstance(x.value,str))
records.append((str(p),cls,n.name,n.lineno,refs,dec))
walk(t.body,marks=tuple(ast.unparse(n.value) for n in t.body if isinstance(n,ast.Assign) and any(isinstance(x,ast.Name) and x.id=='pytestmark' for x in n.targets)))
affected=set(roots)
for _ in range(20):
new=affected|{r[2] for r in records if r[4]&affected and not r[2].startswith('test_')}
if new==affected:break
affected=new
print('ROOTS:',sorted(roots))
print('AFFECTED FIXTURES / WRAPPERS:')
for p,c,n,l,refs,d in records:
if not n.startswith('test_') and refs&affected and '/fixtures/virt/' not in p:
print(f'{p}:{l} {n} <- {sorted(refs&affected)} '+ ('AUTOUSE' if any('autouse=True' in s for s in d) else ''))
print('AFFECTED TESTS:')
for p,c,n,l,refs,d in records:
if n.startswith('test_') and refs&affected:
markers=[x for x in ('smoke','gating') if any('mark.'+x in s for s in d)]
print(p+'::'+(c+'::' if c else '')+n, 'markers='+','.join(markers),'via='+','.join(sorted(refs&affected)))
print('HARDWARE PARAM CONSUMERS:')
for p,c,n,l,refs,d in records:
if refs&{'common_instance_type_param_dict','instance_type_for_test_scope_class','rhel_vm_with_instance_type_and_preference'} and any('gpus_list' in x or 'host_devices_list' in x for x in d):
print(p,c,n)
PY
for f in tests/infrastructure/instance_types/supported_os/test_rhel_os.py tests/virt/cluster/common_templates/rhel/test_rhel_os_support.py tests/virt/cluster/common_templates/general/test_base_template.py tests/infrastructure/instance_types/test_vm_with_instance_and_pref.py; do
ast-grep outline "$f" --items all
done
rg -n -C3 '\b(ping_process_in_rhel_os|generated_ssh_key_for_vm_access|junitxml_plugin|migration_policy_with_bandwidth_scope_class|migration_policy_with_bandwidth|migrated_vm_multiple_times|gpus_list|host_devices_list)\b' tests -g '*.py' -g '!tests/fixtures/virt/**'
fd -i '^global_config.*\.py$' testsLength of output: 44134 🏁 Script executed: #!/bin/bash
set -euo pipefail
rg -n -C2 '^def (vm_for_test|running_metric_vm|instance_type_for_test_scope_class|base_templates|junitxml_plugin|generated_ssh_key_for_vm_access)\(' tests -g '*.py'
sed -n '40,90p' tests/infrastructure/instance_types/supported_os/test_rhel_os.py
sed -n '135,185p' tests/infrastructure/instance_types/supported_os/test_rhel_os.py
sed -n '185,212p' tests/virt/cluster/common_templates/rhel/test_rhel_os_support.py
sed -n '190,205p' tests/virt/cluster/common_templates/general/test_base_template.py
sed -n '235,270p' tests/virt/cluster/common_templates/general/test_base_template.py
sed -n '320,350p' tests/virt/cluster/common_templates/general/test_base_template.py
sed -n '1,145p' tests/infrastructure/instance_types/test_vm_with_instance_and_pref.py
for f in tests/fixtures/cluster/sanity.py tests/observability/metrics/conftest.py tests/storage/storage_migration/conftest.py tests/virt/node/general/test_vmi_reset.py tests/virt/cluster/vm_lifecycle/test_vm_run_strategy.py tests/virt/upgrade/test_upgrade_virt.py tests/virt/cluster/sysprep/test_sysprep.py; do
ast-grep outline "$f" --items all
done
sed -n '1,65p' tests/fixtures/cluster/sanity.py
sed -n '135,195p' tests/storage/storage_migration/conftest.py
rg -n -C2 '\b(vm_for_storage_class_migration_from_template_with_dv|created_multiple_failed_vms)\b' tests -g '*.py'
sed -n '1,70p' tests/virt/node/general/test_container_disk_vm.py
sed -n '440,465p' conftest.py
sed -n '620,650p' conftest.py
git diff --stat 7d850a8ca3ca377c840b8209fde03c8e525521a5...HEADLength of output: 43623 🏁 Script executed: #!/bin/bash
set -euo pipefail
for f in tests/storage/storage_migration/test_storage_class_migration.py tests/observability/metrics/test_ssp_metrics.py tests/observability/metrics/test_migration_metrics.py tests/observability/metrics/test_vms_metrics.py tests/install_upgrade_operators/must_gather/test_must_gather_vm_preferences.py tests/install_upgrade_operators/must_gather/test_must_gather_vms.py; do
ast-grep outline "$f" --items all
done
sed -n '1,115p' tests/storage/storage_migration/test_storage_class_migration.py
sed -n '210,236p' tests/storage/storage_migration/conftest.py
sed -n '110,155p' tests/observability/metrics/test_ssp_metrics.py
sed -n '60,83p' tests/virt/upgrade/test_upgrade_virt.py
sed -n '135,162p' tests/virt/cluster/sysprep/test_sysprep.py
rg -n -C2 'gpus_list|host_devices_list|def .*gpu|def .*sriov' tests/infrastructure/instance_types tests/virt/cluster/sysprep
gh api repos/RedHatQE/openshift-virtualization-tests/pulls/5682 --jq .head.shaLength of output: 17968 🏁 Script executed: #!/bin/bash
set -euo pipefail
python - <<'PY'
import json,re,subprocess,time
repo='RedHatQE/openshift-virtualization-tests'
pr=5682
def api(endpoint):
return json.loads(subprocess.check_output(['gh','api',endpoint],text=True))
meta=api(f'repos/{repo}/pulls/{pr}')
if meta['head']['sha']!='e5491433a452beb97ded367fd02cadddf11aeaa7':
raise SystemExit('PR head changed. Reinspect before posting.')
files=api(f'repos/{repo}/pulls/{pr}/files?per_page=100')
first=files[0]
old=new=0
location=None
for row in first.get('patch','').splitlines():
if row.startswith('@@'):
m=re.match(r'@@ -(\d+)(?:,\d+)? \+(\d+)',row)
old,new=map(int,m.groups())
elif row.startswith('+'):
location=(new,'RIGHT');break
elif row.startswith('-'):
location=(old,'LEFT');break
elif row.startswith(' '):
old+=1;new+=1
if not location: raise SystemExit('No first changed line found.')
body=r"""@openshift-virtualization-qe-bot-3
## Test Execution Plan
**Run smoke tests: True.** Verified path:
`tests/virt/node/general/test_container_disk_vm.py::test_container_disk_vm` (smoke) → `tests/conftest.py::autouse_fixtures` → relocated `generated_ssh_key_for_vm_access` → `ssh_key_tmpdir_scope_session` in `tests/fixtures/virt/ssh.py`.
The same autouse fixture requests `cluster_sanity_scope_session` and `cluster_sanity_scope_module` → changed `junitxml_plugin` (`hasplugin`). This affects session setup even when a test does not request a moved fixture directly.
**Run gating tests: True.** Verified paths:
- `tests/virt/cluster/common_templates/general/test_base_template.py::test_base_templates_annotations` (gating) → relocated `base_templates` → `get_base_templates_list`.
- `tests/infrastructure/instance_types/test_vm_with_instance_and_pref.py::TestVmWithInstanceTypeAndPref::test_start_vm_with_instance_type_and_preference` (gating) → relocated `rhel_vm_with_instance_type_and_preference` → `instance_type_for_test_scope_class` / `vm_preference_for_test` → parameter-dictionary fixtures.
- Gating tests also reach the SSH-key and `junitxml_plugin` paths through `autouse_fixtures`.
**Scope**
Seven plugins replace fixtures removed from `tests/conftest.py`. Fixture scopes remain unchanged: session for SSH keys/RHEL parameters; module for templates/osinfo; class for instance types, preferences, VM actions, and most VMs; function for the existing-DV VM and one migration policy. No tests were added. No `utilities/` or `libs/` files changed.
**Affected tests to run**
All tests under `tests/` use the shared autouse setup. Run `tests/ -m smoke` and `tests/ -m gating` for that shared path. Use these targeted consumers for the moved fixture bodies:
- `tests/virt/node/general/test_container_disk_vm.py::test_container_disk_vm` (smoke; session setup and SSH).
- `tests/infrastructure/instance_types/test_vm_with_instance_and_pref.py` (gating; all tests use moved instance-type/preference fixtures, including negative creation and resource-edit cleanup).
- `tests/virt/cluster/common_templates/general/test_base_template.py` (all tests use moved template, osinfo, or existing-DV VM fixtures; only `test_base_templates_annotations` is gating-marked).
- `tests/infrastructure/instance_types/supported_os/test_rhel_os.py::TestVMMigrationAndState::test_pause_unpause_after_migrate` (ping fixture; not smoke/gating).
- `tests/virt/cluster/common_templates/rhel/test_rhel_os_support.py::TestCommonTemplatesRhel::test_pause_unpause_after_migrate` (ping fixture; gating inherited from the class).
Run these pause tests with their create/start/SSH/migration prerequisites, not as isolated node IDs.
- `tests/install_upgrade_operators/must_gather/test_must_gather_vms.py::TestNoMultipleFilesCollected::test_no_multiple_empty_files_collected_from_must_gather_migrated_vm` (migration VM; repeated migration and post-yield `clean_up()`).
- `tests/install_upgrade_operators/must_gather/test_must_gather_vms.py::TestControllerRevisionCollected::test_controller_revision_collected` (cluster instance type/preference VM).
- `tests/install_upgrade_operators/must_gather/test_must_gather_vm_preferences.py::TestInstanceTypesAndPreferencesCollected::test_instancestypes_collected` (transitive resource fixtures).
- `tests/observability/metrics/test_migration_metrics.py::TestKubevirtVmiMigrationMetrics::test_kubevirt_vmi_migration_metrics` (class-scoped migration policy).
- `tests/virt/node/log_verbosity/test_log_virt_launcher.py::TestProgressOfMigrationInVirtLauncher::test_progress_of_vm_migration_in_virt_launcher_pod` (function-scoped migration policy through `migrated_vm_with_policy`).
- `tests/observability/metrics/test_vms_metrics.py::TestVmConsolesAndVmCreateDateTimestampMetrics::test_kubevirt_console_active_connections` (`vm_for_test`; console context cleanup).
- `tests/observability/metrics/test_vms_metrics.py::TestVmVnicInfo::test_metric_kubevirt_vm_vnic_info_linux` (`running_metric_vm`; cloud-init).
- `tests/observability/metrics/test_vms_metrics.py::TestVmiPhaseTransitionFromDeletion::test_kubevirt_vmi_phase_transition_from_deletion_seconds_linux` (`deleted_vmi` → `running_metric_vm`; deletion cleanup).
- `tests/observability/metrics/test_network_metrics.py::TestVmiNetworkMetricsLinux::test_kubevirt_vmi_network_traffic_bytes_total` (traffic fixtures → `vm_for_test`).
- `tests/observability/metrics/test_ssp_metrics.py::TestSSPTemplate::test_metric_kubevirt_ssp_common_templates_restored_increase` (template edit/revert).
- `tests/observability/metrics/test_ssp_metrics.py::TestSSPTemplateValidatorRejected::test_metric_kubevirt_ssp_template_validator_rejected_increase` (class-level `usefixtures` → instance-type fixture).
- `tests/virt/node/general/test_vmi_reset.py::TestVMIReset::test_reset_success` (reset fixtures → `vm_for_test`).
- `tests/virt/cluster/sysprep/test_sysprep.py` (all tests use `sysprep_vm` → instance-type fixture).
- `tests/virt/cluster/common_templates/custom_namespace/test_custom_namespace.py` (all tests reach template enumeration/edit/delete fixtures).
- `tests/infrastructure/golden_images/test_common_templates_data_volumes.py::test_vm_with_existing_dv` (existing-DV VM).
- `tests/infrastructure/golden_images/update_boot_source/test_ssp_common_templates_boot_sources.py::test_common_templates_boot_source_reference` (templates).
- `tests/infrastructure/golden_images/update_boot_source/test_ssp_data_sources.py::test_opt_out_data_source_reconciles_after_update` (data-source fixture chain → templates).
- `tests/virt/cluster/migration_and_maintenance/test_evictionstrategy.py::test_evictionstrategy_not_in_templates` (templates).
- `tests/storage/storage_migration/test_storage_class_migration.py::TestStorageClassMigrationAtoB::test_vm_storage_class_migration_a_to_b_running_vms` and `::TestStorageClassMigrationAtoB::test_migrate_vms_after_storage_migration` (dynamic `request.getfixturevalue` → template/imported-DV VM → `rhel_latest_os_params`; run both in order).
- `tests/virt/upgrade/test_upgrade_virt.py::TestUpgradeVirt::test_is_vm_running_before_upgrade` (gating; upgrade VM/data-source/DV chain → RHEL parameters).
- `tests/virt/upgrade/test_upgrade_virt.py::TestUpgradeVirt::test_golden_image_pvc_names_after_upgrade` (templates; not gating-marked).
Run upgrade consumers in the configured upgrade lane with their prerequisite tests.
**Real tests (cluster required)**
Use the PR checkout and an authenticated, supported cluster. Set `SC` to an existing supported storage class. Use the matching architecture configuration; the example uses AMD64.
```bash
export SC=ocs-storagecluster-ceph-rbd-virtualization
```
**Refactor/discovery path**
```bash
uv run pytest tests/ --collect-only \
--tc-file=tests/global_config_amd64.py --tc-format=python \
--storage-class-matrix="$SC"
```
Expected: all seven plugins import and collection completes. Collection alone does **not** prove fixture setup or teardown.
**Session error/fix path: JUnit output enabled**
```bash
uv run pytest tests/virt/node/general/test_container_disk_vm.py::test_container_disk_vm \
--tc-file=tests/global_config_amd64.py --tc-format=python \
--storage-class-matrix="$SC" --junitxml=/tmp/virt-fixtures-junit.xml
```
Expected: no plugin-manager `AttributeError`; cluster sanity receives the JUnit callback; XML output is written; VM startup succeeds.
**Happy path: no JUnit output requested**
```bash
uv run pytest tests/virt/node/general/test_container_disk_vm.py::test_container_disk_vm \
--tc-file=tests/global_config_amd64.py --tc-format=python \
--storage-class-matrix="$SC"
```
Expected: `junitxml_plugin` returns `None`; session setup still succeeds. SSH-key generation and VM startup work. At teardown, the generated key file and `CNV_VM_SSH_KEY_PATH` are removed.
**Moved-fixture runtime regression**
```bash
uv run pytest \
tests/infrastructure/instance_types/test_vm_with_instance_and_pref.py \
tests/virt/cluster/common_templates/general/test_base_template.py \
tests/install_upgrade_operators/must_gather/test_must_gather_vms.py::TestNoMultipleFilesCollected::test_no_multiple_empty_files_collected_from_must_gather_migrated_vm \
--tc-file=tests/global_config_amd64.py --tc-format=python \
--storage-class-matrix="$SC"
```
Expected: indirect parameters resolve; osinfo downloads/extracts; VMs, preferences, instance types, and migration resources clean up after fixture scope ends. Do not add `-m gating` to this command: that would omit osinfo and repeated-migration coverage.
**Shared-path regression**
```bash
uv run pytest tests/ -m smoke \
--tc-file=tests/global_config_amd64.py --tc-format=python \
--storage-class-matrix="$SC"
uv run pytest tests/ -m gating \
--tc-file=tests/global_config_amd64.py --tc-format=python \
--storage-class-matrix="$SC"
```
**Hardware collection safety**
The moved dictionary fixture retains optional `gpus_list` and `host_devices_list` handling. Inspected consumers do not pass those fields. Repeat collection and the instance-type/preference runtime command on clusters with and without device hardware. Collection must not require GPUs or SR-IOV devices. If a downstream hardware-specific fixture supplies these fields, verify its availability guard returns `None` when hardware is absent, and run its allocation tests on a hardware-equipped cluster.
The reported 22-pass smoke runs are prior evidence. They do not establish current-head gating, osinfo, migration-cleanup, or XML-enabled runtime results. The commands above are proposed verification; they were not run in the inspection sandbox.
"""
payload={'body':body,'commit_id':meta['head']['sha'],'path':first['filename'],'line':location[0],'side':location[1]}
for attempt in range(2):
result=subprocess.run(['gh','api','--method','POST',f'repos/{repo}/pulls/{pr}/comments','--input','-'],input=json.dumps(payload),text=True,capture_output=True)
if result.returncode==0:
print('Inline comment submitted.')
raise SystemExit(0)
print(result.stderr)
if attempt==0: time.sleep(2)
fallback=subprocess.run(['gh','api','--method','POST',f'repos/{repo}/issues/{pr}/comments','--input','-'],input=json.dumps({'body':body}),text=True,capture_output=True)
if fallback.returncode:
print(fallback.stderr)
raise SystemExit(fallback.returncode)
print('Fallback PR comment submitted.')
PYLength of output: 11415
Test Execution Plan
Targeted coverageRun these fixture consumers in addition to smoke and gating tests:
Check resource cleanup after each fixture scope ends. Run pause-after-migration tests with their prerequisite tests. Real-cluster verificationSet # Plugin imports and collection
uv run pytest tests/ --collect-only \
--tc-file=tests/global_config_amd64.py --tc-format=python \
--storage-class-matrix="$SC"
# Session setup with JUnit output
uv run pytest tests/virt/node/general/test_container_disk_vm.py::test_container_disk_vm \
--tc-file=tests/global_config_amd64.py --tc-format=python \
--storage-class-matrix="$SC" --junitxml=/tmp/virt-fixtures-junit.xmlRepeat the runtime command without You are interacting with an AI system. |
|
/lgtm |
|
New container for quay.io/openshift-cnv/openshift-virtualization-tests:latest published |
What this PR does / why we need it:
Move virt-domain fixtures from the monolithic
tests/conftest.pyinto domain-scoped modules undertests/fixtures/virt/:instance_types.py— instance type and VM preference fixturesmigration.py— migration policy andmigrated_vm_multiple_timesfixturesosinfo.py— libosinfo DB download fixturesssh.py— SSH key generation fixturestemplates.py—base_templatesfixturevirtual_machines.py— VM creation fixtures,rhel_latest_os_params,vm_for_migration_testRegister new modules in
pytest_pluginsin rootconftest.py.Which issue(s) this PR fixes:
Special notes for reviewer:
Part of series of
tests/conftest.pyrefactor.jira-ticket:
https://redhat.atlassian.net/browse/CNV-80951
Summary by CodeRabbit