Skip to content

Handle missing cpu-arch config gracefully in pytest fixture#5285

Merged
rnetser merged 2 commits into
RedHatQE:mainfrom
yossisegev:multi-arch-tuning
Jun 29, 2026
Merged

Handle missing cpu-arch config gracefully in pytest fixture#5285
rnetser merged 2 commits into
RedHatQE:mainfrom
yossisegev:multi-arch-tuning

Conversation

@yossisegev

@yossisegev yossisegev commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

The current implementation of checking the cpu-arch argument only supports a single value, however for multi-arch tests it is required to pass a list of architectures (--cpu-arch=amd64,arm64)."
The fixture now uses dict.get() instead of direct indexing to handle missing cpu_arch gracefully.
cpu_arch is not set for multi-arch cluster runs now (by design), and this fix handles the KeyError failure.

Assisted-by: Claude Code noreply@anthropic.com

Summary by CodeRabbit

Summary of changes

  • New Features

    • Added architecture-aware selection for Fedora container images and container image digests, ensuring VM disk/volume provisioning and images match the resolved VM architecture (including multi-arch behavior).
  • Bug Fixes

    • Improved cluster CPU architecture reporting to use the cluster configuration directly and avoid missing/undefined values.
  • Tests

    • Updated fixtures to handle optional CPU architecture configuration safely when the key is absent.

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

An error occurred during the review process. Please try again later.

📝 Walkthrough

Walkthrough

Adds optional architecture selection to VM image resolution and updates test fixtures to read CPU architecture values from safer or different config keys.

Changes

Architecture-aware Container Image and Fixture Updates

Layer / File(s) Summary
Container image architecture override
libs/vm/vm.py
container_image now accepts an optional arch override and passes architecture=arch or py_config["cpu_arch"] to get_oc_image_info.
Fedora image selection uses VMI architecture
libs/vm/factory.py
fedora_image accepts optional arch, selects architecture-specific Fedora image metadata when present, and _fill_vm_spec_defaults calls fedora_image(arch=vmi_spec.architecture).
CPU architecture fixture source changes
tests/conftest.py
nodes_cpu_architecture switches to py_config.get("cpu_arch"), and cluster_info now reads py_config['cluster_arch'] for the cluster CPU architecture line.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • vsibirsk
  • rnetser
  • dshchedr
  • RoniKishner

Caution

Pre-merge checks failed

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

  • Ignore

❌ Failed checks (2 errors)

Check name Status Explanation Resolution
Description check ❌ Error The description covers the change and rationale, but it omits the required template sections and Jira ticket. Add the template headings for issue(s), special notes, and jira-ticket, and place the current summary and verification under them.
Stp Link Required ❌ Error New test file tests/storage/disk_preallocation/test_disk_preallocation.py lacks a valid STP/RFE/Jira docstring; its Jira line is after imports and omits the required skip marker. Add a real module/class/test docstring with an STP/RFE/Jira URL. If you keep a Jira line, append # <skip-jira-utils-check> on the same line.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main fixture change and stays within the length limit.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Review ran into problems

🔥 Problems

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


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@openshift-virtualization-qe-bot

Copy link
Copy Markdown

Report bugs in Issues

Welcome! 🎉

This pull request will be automatically processed with the following features:

🔄 Automatic Actions

  • Reviewer Assignment: Reviewers are automatically assigned based on the OWNERS file in the repository root
  • Size Labeling: PR size labels (XS, S, M, L, XL, XXL) are automatically applied based on changes
  • Issue Creation: A tracking issue is created for this PR and will be closed when the PR is merged or closed
  • Branch Labeling: Branch-specific labels are applied to track the target branch
  • Auto-verification: Auto-verified users have their PRs automatically marked as verified
  • Labels: Enabled categories: branch, can-be-merged, cherry-pick, has-conflicts, hold, needs-rebase, size, verified, wip

📋 Available Commands

PR Status Management

  • /wip - Mark PR as work in progress (adds WIP: prefix to title)
  • /wip cancel - Remove work in progress status
  • /hold - Block PR merging (approvers only)
  • /hold cancel - Unblock PR merging
  • /verified - Mark PR as verified
  • /verified cancel - Remove verification status
  • /reprocess - Trigger complete PR workflow reprocessing (useful if webhook failed or configuration changed)
  • /regenerate-welcome - Regenerate this welcome message
  • /security-override - Set security check runs to pass (maintainers only)
  • /security-override cancel - Re-run security checks

Review & Approval

  • /lgtm - Approve changes (looks good to me)
  • /approve - Approve PR (approvers only)
  • /assign-reviewers - Assign reviewers based on OWNERS file
  • /assign-reviewer @username - Assign specific reviewer
  • /check-can-merge - Check if PR meets merge requirements

Testing & Validation

  • /retest tox - Run Python test suite with tox
  • /retest build-container - Rebuild and test container image
  • /retest verify-bugs-are-open - verify-bugs-are-open
  • /retest all - Run all available tests

Container Operations

  • /build-and-push-container - Build and push container image (tagged with PR number)
    • Supports additional build arguments: /build-and-push-container --build-arg KEY=value

Cherry-pick Operations

  • /cherry-pick <branch> - Schedule cherry-pick to target branch when PR is merged
    • Multiple branches: /cherry-pick branch1 branch2 branch3
  • /cherry-pick-retry <branch> - Retry a failed cherry-pick (merged PRs only)

Branch Management

  • /rebase - Rebase this PR branch onto its base branch

Label Management

  • /<label-name> - Add a label to the PR
  • /<label-name> cancel - Remove a label from the PR

✅ Merge Requirements

This PR will be automatically approved when the following conditions are met:

  1. Approval: /approve from at least one approver
  2. LGTM Count: Minimum 2 /lgtm from reviewers
  3. Status Checks: All required status checks must pass
  4. No Blockers: No wip, hold, has-conflicts labels and PR must be mergeable (no conflicts)
  5. Verified: PR must be marked as verified

📊 Review Process

Approvers and Reviewers

Approvers:

  • dshchedr
  • myakove
  • rnetser
  • vsibirsk

Reviewers:

  • RoniKishner
  • dshchedr
  • rnetser
  • vsibirsk
Available Labels
  • hold
  • verified
  • wip
  • lgtm
  • approve
AI Features
  • Cherry-Pick Conflict Resolution: Enabled (claude/claude-opus-4-6[1m])
Security Checks
  • Suspicious Path Detection: Monitors paths: .claude/, .vscode/, .cursor/, .devcontainer/, .pi/, .github/workflows/, .github/actions/
  • Committer Identity Check: Verifies last committer matches PR author
  • Mandatory: Security checks block merge (use /security-override to bypass — maintainers only)

💡 Tips

  • WIP Status: Use /wip when your PR is not ready for review
  • Verification: The verified label is removed on new commits unless the push is detected as a clean rebase
  • Cherry-picking: Cherry-pick labels are processed when the PR is merged
  • Container Builds: Container images are automatically tagged with the PR number
  • Permission Levels: Some commands require approver permissions
  • Auto-verified Users: Certain users have automatic verification and merge privileges

For more information, please refer to the project documentation or contact the maintainers.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/conftest.py`:
- Line 1046: The fixture is using `.get("cpu_arch")` which returns None when the
key is missing, masking configuration errors instead of failing fast. Replace
the `.get()` call with direct dictionary access using square brackets (e.g.,
`py_config["cpu_arch"]`) to raise a KeyError immediately if the key is missing.
Additionally, the returned value needs to handle comma-separated architecture
strings (like `amd64,arm64`) by normalizing them to a single architecture value
that downstream code expecting `nodes_cpu_architecture` can safely use in
architecture map lookups.
🪄 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: 446a9497-c457-452b-9741-232b2aa4aa34

📥 Commits

Reviewing files that changed from the base of the PR and between 08cf872 and e71c6d6.

📒 Files selected for processing (1)
  • tests/conftest.py

Comment thread tests/conftest.py
@yossisegev

Copy link
Copy Markdown
Contributor Author

/verified

Verify that the list value of cpu-arch is consumed successfully in mulit-arch testing, i.e when running

Verify nothing is broken in specific-arch test in multi-arch cluster, i.e.

uv run pytest --verbose --jira -rs -s -o log_cli=true --junitxml=xunit_results.xml --pytest-log-file=pytest-tests.log --leftovers-collector --tb=native --skip-deprecated-api-test --cluster-sanity-skip-storage-check -m 'single_nic and not sriov and not ipv6 and not mtv and not sno and not nmstate' --tc-file=tests/global_config_arm64.py --cpu-arch=arm64 tests/network/user_defined_network/ip_specification/test_ip_specification.py

All tests passed, and VM spec was created with the explicit architecture: arm64

Verify nothing break on homogeneous cluster:

All tests passed, and VM spec was created without architecture at all.

@openshift-virtualization-qe-bot-3

Copy link
Copy Markdown
Contributor

@coderabbitai

Test execution plan request details

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

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

Analysis Requirements:

  1. Examine code changes in each modified file

  2. Identify affected code paths, functions, and classes

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

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

  5. Detect new tests introduced in the PR

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

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

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

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

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

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

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

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

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

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

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

Test Execution Plan

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

Use these formats:

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

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

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

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

Example output for a session-startup fix:

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

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

Guidelines:

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

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

When PR modifies fixtures for hardware-specific resources:

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

CRITICAL WORKFLOW COMPLETION RULES:

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

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

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

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

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

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

Comment thread tests/conftest.py
@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Tip

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Inspect the nodes_cpu_architecture fixture in tests/conftest.py
rg -n 'nodes_cpu_architecture|cpu_arch' tests/conftest.py -A5 -B2

echo "=== Find all callers of nodes_cpu_architecture ==="
rg -rn 'nodes_cpu_architecture' tests/ --include='*.py' -l

echo "=== Find smoke-marked tests ==="
rg -rn '`@pytest.mark.smoke`' tests/ --include='*.py' -l | head -30

echo "=== Find gating-marked tests ==="
rg -rn '`@pytest.mark.gating`' tests/ --include='*.py' -l | head -30

echo "=== Check if nodes_cpu_architecture is autouse ==="
rg -n 'autouse.*nodes_cpu_architecture|nodes_cpu_architecture.*autouse' tests/conftest.py

echo "=== Show full fixture definition ==="
rg -n 'def nodes_cpu_architecture' tests/conftest.py -A20

Length of output: 7515


🏁 Script executed:

#!/bin/bash
echo "=== Find all callers of nodes_cpu_architecture in tests ==="
rg -rn 'nodes_cpu_architecture' tests/ -l

echo "=== Find smoke-marked tests ==="
rg -rn '`@pytest.mark.smoke`' tests/ -l | head -30

echo "=== Find gating-marked tests ==="
rg -rn '`@pytest.mark.gating`' tests/ -l | head -30

echo "=== Check which test files use host_cpu_model, cpu_for_migration, modern_cpu_for_migration, machine_type_from_kubevirt_config, is_s390x_cluster ==="
rg -rn 'host_cpu_model|cpu_for_migration|modern_cpu_for_migration|machine_type_from_kubevirt_config|is_s390x_cluster' tests/ -l | head -30

echo "=== Check which test files use skip_if_no_common_cpu ==="
rg -rn 'skip_if_no_common_cpu' tests/ -l | head -20

Length of output: 5026


🏁 Script executed:

#!/bin/bash
echo "=== Check nodes_cpu_architecture usage in tests/virt/node/conftest.py ==="
rg -n 'nodes_cpu_architecture|autouse' tests/virt/node/conftest.py -B2 -A5

echo "=== Get the diff to identify first changed line ==="
git diff HEAD~1 -- tests/conftest.py | head -40

echo "=== Check if any smoke test files are in the downstream fixture users ==="
# smoke files: test_container_disk_vm.py, test_csv.py, test_rhel_os_support.py, test_clone.py, test_upload_virtctl.py, test_rhel_os.py
rg -n 'cpu_for_migration|host_cpu_model|modern_cpu_for_migration|is_s390x_cluster|machine_type_from_kubevirt_config|nodes_cpu_architecture|skip_if_no_common_cpu' \
  tests/virt/node/general/test_container_disk_vm.py \
  tests/install_upgrade_operators/csv/test_csv.py \
  tests/virt/cluster/common_templates/rhel/test_rhel_os_support.py \
  tests/storage/cdi_clone/test_clone.py \
  tests/storage/cdi_upload/test_upload_virtctl.py \
  tests/infrastructure/instance_types/supported_os/test_rhel_os.py 2>/dev/null

echo "=== Check conftest hierarchy for smoke test test_container_disk_vm.py ==="
rg -n 'nodes_cpu_architecture|cpu_for_migration|host_cpu_model|is_s390x_cluster' tests/virt/conftest.py | head -20

echo "=== Get PR diff first changed line number ==="
git diff HEAD~1 -- tests/conftest.py | grep '^@@' | head -5

Length of output: 2618


🏁 Script executed:

#!/bin/bash
# Post inline review comment on the changed line in tests/conftest.py
PR_NUMBER=5285
REPO="RedHatQE/openshift-virtualization-tests"

COMMENT_BODY="## Test Execution Plan

**Run smoke tests: False**
No smoke-marked test file has a verified dependency path to \`nodes_cpu_architecture\`. The \`vmx_disabled_flag\` fixture in \`tests/virt/node/conftest.py\` uses \`nodes_cpu_architecture\` but is not \`autouse\`, so it only affects tests that explicitly request it — none of which are smoke-marked.

**Run gating tests: True**
- \`tests/virt/node/general/test_machinetype.py\` (gating) → directly requests \`nodes_cpu_architecture\` fixture
- \`tests/virt/node/cpu_sockets_threads/test_cpu_support_sockets_threads.py\` (gating) → \`cpu_for_migration\` fixture → \`nodes_cpu_architecture\`
- \`tests/virt/node/migration_and_maintenance/test_vm_unscheduled_node.py\` (gating) → \`cpu_for_migration\`\`nodes_cpu_architecture\`

**Affected tests to run**
- \`tests/virt/node/general/test_machinetype.py\` (gating — direct \`nodes_cpu_architecture\` user)
- \`tests/virt/node/cpu_sockets_threads/test_cpu_support_sockets_threads.py\` (gating — via \`cpu_for_migration\`)
- \`tests/install_upgrade_operators/strict_reconciliation/test_hco_default_cpu_model.py\` (direct \`nodes_cpu_architecture\` user)
- \`tests/install_upgrade_operators/must_gather/test_must_gather_vms.py\` (direct \`nodes_cpu_architecture\` + \`skip_if_no_common_cpu\` user)

**Real tests (cluster required)**

*Error path (the fix — session startup without \`--cpu-arch\`):*
\`\`\`
uv run pytest tests/virt/node/general/test_machinetype.py --collect-only
\`\`\`
Expected: collection succeeds (no \`KeyError\` on \`py_config[\"cpu_arch\"]\`)

*Happy path — single arch regression:*
\`\`\`
uv run pytest tests/virt/node/general/test_machinetype.py --tc-file=tests/global_config_arm64.py --cpu-arch=arm64 -k test_default_machine_type
\`\`\`
Expected: session starts normally, \`nodes_cpu_architecture == \"arm64\"\`

*Multi-arch path (the new feature):*
\`\`\`
uv run pytest tests/network/network_service/test_service_multiarch.py --cpu-arch=arm64,amd64 -m multiarch --collect-only
\`\`\`
Expected: session starts, \`nodes_cpu_architecture == \"arm64,amd64\"\`"

gh api \
  --method POST \
  -H "Accept: application/vnd.github+json" \
  "/repos/${REPO}/pulls/${PR_NUMBER}/reviews" \
  -f body="" \
  -f event="COMMENT" \
  -f "comments[][path]=tests/conftest.py" \
  -F "comments[][line]=1046" \
  -f "comments[][side]=RIGHT" \
  -f "comments[][body]=${COMMENT_BODY}"

Length of output: 4329



@yossisegev

Copy link
Copy Markdown
Contributor Author

/verified

Verify that the list value of cpu-arch is consumed successfully in mulit-arch testing, i.e when running

Verify nothing is broken in specific-arch test in multi-arch cluster, i.e.

uv run pytest --verbose --jira -rs -s -o log_cli=true --junitxml=xunit_results.xml --pytest-log-file=pytest-tests.log --leftovers-collector --tb=native --skip-deprecated-api-test --cluster-sanity-skip-storage-check -m 'single_nic and not sriov and not ipv6 and not mtv and not sno and not nmstate' --tc-file=tests/global_config_arm64.py --cpu-arch=arm64 tests/network/user_defined_network/ip_specification/test_ip_specification.py

All tests passed, and VM spec was created with the explicit architecture: arm64

Verify nothing break on homogeneous cluster:

All tests passed, and VM spec was created without architecture at all.

Verify cluster arch list is printed as expected in cluster info.

Comment thread libs/vm/factory.py
@yossisegev

Copy link
Copy Markdown
Contributor Author

/verified

  1. Affected tests (test_ip_specification.py) on homogeneous cluster.
  2. Affected tests (test_ip_specification.py) on multi-arch cluster.
  3. Rabbit's test-plan.
    https://jenkins-csb-cnvqe-main.dno.corp.redhat.com/job/openshift-virtualization-tests-runner/5775/testReport/
    2 tests failed (out of 83), but they practice the same flow that other passing tests do, so I consider them as can be waived.

yossisegev and others added 2 commits June 25, 2026 17:19
The current implementation of checking the `cpu-arch` argument only
supports a single value, however for multi-arch tests it is required to
pass a list of architectures (`--cpu-arch=amd64,arm64`).", and be sure
to pull a VM image of the correct arch.

Signed-off-by: Yossi Segev <ysegev@redhat.com>
Assisted-by: Claude Code <noreply@anthropic.com>

Signed-off-by:  <ysegev@redhat.com>
@yossisegev

Copy link
Copy Markdown
Contributor Author

/verified

Verified by running the affected tests (test_ip_specification.py) on different setups, and having the test passing + expected output:

  1. Heterogeneous cluster:
        Cluster CPU Architecture: {'arm64', 'amd64'}
  1. Homogeneous cluster:
	Cluster CPU Architecture: {'amd64'}

@openshift-virtualization-qe-bot-3

Copy link
Copy Markdown
Contributor

@coderabbitai

Test execution plan request details

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

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

Analysis Requirements:

  1. Examine code changes in each modified file

  2. Identify affected code paths, functions, and classes

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

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

  5. Detect new tests introduced in the PR

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

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

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

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

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

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

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

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

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

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

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

Test Execution Plan

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

Use these formats:

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

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

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

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

Example output for a session-startup fix:

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

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

Guidelines:

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

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

When PR modifies fixtures for hardware-specific resources:

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

CRITICAL WORKFLOW COMPLETION RULES:

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

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

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

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

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

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

@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Test Execution Plan

Run smoke tests: False
No smoke-marked test has a verified dependency path to the modified shared libraries/fixtures. The changed addition in tests/storage/cdi_upload/test_upload_virtctl.py is not smoke-marked, and no smoke-marked file was verified to depend on nodes_cpu_architecture, cluster_vlan_ids, update_nad_references, or the moved libs.net.nodenetworkconfigurationpolicy helpers.

Run gating tests: True
Verified paths:

  • tests/virt/node/general/test_machinetype.py (gating) → nodes_cpu_architecture fixture → modified tests/conftest.py
  • tests/storage/disk_preallocation/test_disk_preallocation.py::test_preallocation_dv (gating) → changed fixtures in tests/storage/disk_preallocation/conftest.py
  • tests/storage/disk_preallocation/test_disk_preallocation.py::test_preallocation_globally_dv_spec_without_preallocation (gating) → changed fixtures in tests/storage/disk_preallocation/conftest.py
  • tests/install_upgrade_operators/deployment/test_hco_deployment_params.py (gating) → assertions/xfail flow changed directly in the test file

Affected tests to run

  • tests/virt/node/general/test_machinetype.py (gating)
  • tests/install_upgrade_operators/deployment/test_hco_deployment_params.py (gating)
  • tests/storage/disk_preallocation/test_disk_preallocation.py::test_preallocation_dv (gating)
  • tests/storage/disk_preallocation/test_disk_preallocation.py::test_preallocation_globally_dv_spec_without_preallocation (gating)
  • tests/install_upgrade_operators/pod_validation/test_pod_spec.py
  • tests/storage/cdi_upload/test_upload_virtctl.py::test_virtctl_image_upload_dv_in_pudn_namespace
  • tests/network/l2_bridge/nad_ref_change/test_nad_ref_change.py
  • tests/network/localnet/nad_ref_change/test_nad_ref_change.py
  • tests/network/l2_bridge/rhel9_rhel10_cluster/test_connectivity.py
  • tests/network/localnet/rhel9_rhel10_cluster/test_connectivity.py

Real tests (cluster required)

Error path (shared session/runtime fix):
uv run pytest tests/virt/node/general/test_machinetype.py --collect-only
Expected: collection succeeds without KeyError: 'cpu_arch'

Happy path (plugin + shared fixture wiring regression):
uv run pytest tests/network/localnet/rhel9_rhel10_cluster/test_connectivity.py --collect-only
Expected: collection succeeds with the plugin-provided network fixtures and no fixture/import errors

Runtime regression:
uv run pytest tests/storage/cdi_upload/test_upload_virtctl.py -k test_virtctl_image_upload_dv_in_pudn_namespace
Expected: DataVolume upload succeeds in a namespace with a primary UDN

@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Tip

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

BASE="$(git merge-base HEAD origin/main 2>/dev/null || true)"
if [[ -z "${BASE}" ]]; then
  BASE="HEAD~1"
fi

echo "=== MERGE BASE ==="
echo "$BASE"

echo "=== CHANGED FILES IN ORDER ==="
git diff --name-only "$BASE"...HEAD

echo "=== FIRST HUNK FOR EACH CHANGED FILE ==="
for f in $(git diff --name-only "$BASE"...HEAD); do
  echo "--- $f ---"
  git diff --unified=0 "$BASE"...HEAD -- "$f" | sed -n '1,40p'
done

echo "=== AST OUTLINES ==="
ast-grep outline tests/conftest.py --view expanded | sed -n '1,220p'
echo "---"
ast-grep outline libs/vm/factory.py --view expanded | sed -n '1,220p'
echo "---"
ast-grep outline libs/vm/vm.py --view expanded | sed -n '1,220p'

echo "=== MODIFIED SYMBOLS IN LIB FILES ==="
git diff --unified=0 "$BASE"...HEAD -- libs/vm/factory.py libs/vm/vm.py | rg -n '^[+-]\s*def '

echo "=== RELEVANT SLICES: tests/conftest.py ==="
rg -n -C3 'def nodes_cpu_architecture|def cluster_info|cpu_arch|cluster_arch|def cpu_for_migration|def host_cpu_model|def modern_cpu_for_migration|def machine_type_from_kubevirt_config|def skip_if_no_common_cpu' tests/conftest.py

echo "=== RELEVANT SLICES: libs/vm/factory.py ==="
rg -n -C3 'def fedora_image|def _fill_vm_spec_defaults|fedora_image\(|container_image\(' libs/vm/factory.py

echo "=== RELEVANT SLICES: libs/vm/vm.py ==="
rg -n -C3 'def container_image|get_oc_image_info|cpu_arch|architecture' libs/vm/vm.py

echo "=== DIRECT CALLERS IN tests/ AND conftest OF CHANGED SYMBOLS ==="
rg -n --type py -C2 '\b(fedora_image|container_image)\s*\(' tests
echo "--- nodes_cpu_architecture users ---"
rg -n --type py -C2 '\bnodes_cpu_architecture\b' tests

echo "=== SAME-FILE / TRANSITIVE CALLERS IN libs/ ==="
rg -n --type py -C2 '\bcontainer_image\s*\(' libs
echo "---"
rg -n --type py -C2 '\bfedora_image\s*\(' libs

echo "=== FIXTURE / HELPER CHAINS TO FEDORA VM HELPERS ==="
rg -n --type py -C2 '\bfedora_vm\b|\bfedora_vm_body\b|_fill_vm_spec_defaults' tests libs

echo "=== SMOKE-MARKED TEST FILES ==="
rg -l --type py '^\s*`@pytest`\.mark\.smoke\b' tests | sort

echo "=== GATING-MARKED TEST FILES ==="
rg -l --type py '^\s*`@pytest`\.mark\.gating\b' tests | sort

echo "=== OVERLAP: SMOKE FILES THAT MENTION AFFECTED FIXTURES/HELPERS ==="
smoke_files="$(mktemp)"
rg -l --type py '^\s*`@pytest`\.mark\.smoke\b' tests | sort > "$smoke_files"
while IFS= read -r f; do
  if rg -q --type py '\b(fedora_vm|fedora_image|container_image|nodes_cpu_architecture|cpu_for_migration|machine_type_from_kubevirt_config|host_cpu_model|modern_cpu_for_migration|skip_if_no_common_cpu)\b' "$f"; then
    echo "$f"
    rg -n --type py -C2 '\b(fedora_vm|fedora_image|container_image|nodes_cpu_architecture|cpu_for_migration|machine_type_from_kubevirt_config|host_cpu_model|modern_cpu_for_migration|skip_if_no_common_cpu)\b' "$f"
  fi
done < "$smoke_files"

echo "=== OVERLAP: GATING FILES THAT MENTION AFFECTED FIXTURES/HELPERS ==="
gating_files="$(mktemp)"
rg -l --type py '^\s*`@pytest`\.mark\.gating\b' tests | sort > "$gating_files"
while IFS= read -r f; do
  if rg -q --type py '\b(fedora_vm|fedora_image|container_image|nodes_cpu_architecture|cpu_for_migration|machine_type_from_kubevirt_config|host_cpu_model|modern_cpu_for_migration|skip_if_no_common_cpu)\b' "$f"; then
    echo "$f"
    rg -n --type py -C2 '\b(fedora_vm|fedora_image|container_image|nodes_cpu_architecture|cpu_for_migration|machine_type_from_kubevirt_config|host_cpu_model|modern_cpu_for_migration|skip_if_no_common_cpu)\b' "$f"
  fi
done < "$gating_files"

echo "=== CONFTST HIERARCHY CHECK FOR SMOKE FILES ==="
python - <<'PY'
from pathlib import Path
import subprocess

smoke = subprocess.check_output(
    ["rg", "-l", "--type", "py", r"^\s*`@pytest`\.mark\.smoke\b", "tests"],
    text=True
).splitlines()

symbols = r"\b(fedora_vm|fedora_image|container_image|nodes_cpu_architecture|cpu_for_migration|machine_type_from_kubevirt_config|host_cpu_model|modern_cpu_for_migration|skip_if_no_common_cpu)\b"

seen = set()
for f in smoke:
    p = Path(f).parent
    while True:
        c = p / "conftest.py"
        key = (f, str(c))
        if c.exists() and key not in seen:
            seen.add(key)
            out = subprocess.run(
                ["rg", "-n", "--type", "py", "-C2", symbols, str(c)],
                text=True, capture_output=True
            )
            if out.returncode == 0 and out.stdout.strip():
                print(f"SMOKE FILE: {f}")
                print(f"CONFTST: {c}")
                print(out.stdout.rstrip())
                print("---")
        if p == Path("tests"):
            break
        p = p.parent
PY

Length of output: 71640


🏁 Script executed:

#!/bin/bash
set -euo pipefail

BASE="$(git merge-base HEAD origin/main 2>/dev/null || true)"
if [[ -z "${BASE}" ]]; then
  BASE="HEAD~1"
fi

echo "=== FIRST CHANGED FILE / LINE ==="
first_file="$(git diff --name-only "$BASE"...HEAD | head -1)"
echo "first_file=$first_file"
git diff --unified=0 "$BASE"...HEAD -- "$first_file" | sed -n '1,20p'

echo "=== MODIFIED LIB SYMBOLS ==="
printf '%s\n' \
  'dict_normalization_for_dataclass' \
  'cluster_vlans' \
  'NodeNetworkConfigurationPolicy' \
  'update_nad_references' \
  'fedora_image' \
  'container_image'

echo "=== DIRECT TEST/CONFTEST CALLERS OR IMPORTERS ==="
for sym in dict_normalization_for_dataclass cluster_vlans update_nad_references fedora_image container_image; do
  echo "--- symbol: $sym ---"
  rg -n --type py -C2 "\\b${sym}\\b" tests conftest.py || true
done

echo "--- module/class: libs.net.nodenetworkconfigurationpolicy imports/usages ---"
rg -n --type py -C2 'nodenetworkconfigurationpolicy|libnncp|NodeNetworkConfigurationPolicy' tests conftest.py || true

echo "=== FIXTURE CHAINS / SAME-FILE CALLERS ==="
echo "--- fedora_image / _fill_vm_spec_defaults / fedora_vm ---"
rg -n --type py -C2 '\bfedora_image\b|\b_fill_vm_spec_defaults\b|\bfedora_vm\b' libs tests conftest.py || true

echo "--- cluster_vlans / cluster_vlan_ids ---"
rg -n --type py -C2 '\bcluster_vlans\b|\bcluster_vlan_ids\b' libs tests conftest.py || true

echo "--- update_nad_references ---"
rg -n --type py -C2 '\bupdate_nad_references\b' libs tests conftest.py || true

echo "=== MARKER STATUS FOR CANDIDATE TEST FILES ==="
candidates=(
  tests/storage/cdi_upload/test_upload_virtctl.py
  tests/storage/disk_preallocation/test_disk_preallocation.py
  tests/install_upgrade_operators/deployment/test_hco_deployment_params.py
  tests/install_upgrade_operators/pod_validation/test_pod_spec.py
  tests/network/l2_bridge/nad_ref_change/test_nad_ref_change.py
  tests/network/localnet/nad_ref_change/test_nad_ref_change.py
  tests/network/l2_bridge/rhel9_rhel10_cluster/test_connectivity.py
  tests/network/localnet/rhel9_rhel10_cluster/test_connectivity.py
  tests/network/connectivity/conftest.py
  tests/network/l2_bridge/conftest.py
  tests/network/localnet/conftest.py
)
for f in "${candidates[@]}"; do
  if [[ -f "$f" ]]; then
    echo "--- $f ---"
    rg -n --type py '^\s*`@pytest`\.mark\.(smoke|gating)\b|^pytestmark\s*=' "$f" || true
  fi
done

echo "=== GLOBAL SMOKE FILES THAT DIRECTLY USE CHANGED SYMBOLS ==="
smoke_files=$(mktemp)
rg -l --type py '^\s*`@pytest`\.mark\.smoke\b' tests | sort > "$smoke_files"
while IFS= read -r f; do
  if rg -q --type py '\b(dict_normalization_for_dataclass|cluster_vlans|cluster_vlan_ids|nodenetworkconfigurationpolicy|libnncp|update_nad_references|fedora_image|container_image|fedora_vm|nodes_cpu_architecture)\b' "$f"; then
    echo "--- $f ---"
    rg -n --type py -C2 '\b(dict_normalization_for_dataclass|cluster_vlans|cluster_vlan_ids|nodenetworkconfigurationpolicy|libnncp|update_nad_references|fedora_image|container_image|fedora_vm|nodes_cpu_architecture)\b' "$f" || true
  fi
done < "$smoke_files"

echo "=== GLOBAL GATING FILES THAT DIRECTLY USE CHANGED SYMBOLS ==="
gating_files=$(mktemp)
rg -l --type py '^\s*`@pytest`\.mark\.gating\b' tests | sort > "$gating_files"
while IFS= read -r f; do
  if rg -q --type py '\b(dict_normalization_for_dataclass|cluster_vlans|cluster_vlan_ids|nodenetworkconfigurationpolicy|libnncp|update_nad_references|fedora_image|container_image|fedora_vm|nodes_cpu_architecture)\b' "$f"; then
    echo "--- $f ---"
    rg -n --type py -C2 '\b(dict_normalization_for_dataclass|cluster_vlans|cluster_vlan_ids|nodenetworkconfigurationpolicy|libnncp|update_nad_references|fedora_image|container_image|fedora_vm|nodes_cpu_architecture)\b' "$f" || true
  fi
done < "$gating_files"

echo "=== CHANGED TEST FILES WITH SMOKE/GATING MARKERS ==="
git diff --name-only "$BASE"...HEAD -- tests | while read -r f; do
  [[ -f "$f" ]] || continue
  if rg -q --type py '^\s*`@pytest`\.mark\.(smoke|gating)\b|^pytestmark\s*=' "$f"; then
    echo "--- $f ---"
    rg -n --type py '^\s*`@pytest`\.mark\.(smoke|gating)\b|^pytestmark\s*=' "$f" || true
  fi
done

Length of output: 55747


🏁 Script executed:

#!/bin/bash
set -euo pipefail

REPO="RedHatQE/openshift-virtualization-tests"
PR_NUMBER="5285"
PATH_IN_PR=".github/workflows/retest-smoke.yml"
LINE_NO=1

read -r -d '' COMMENT_BODY <<'EOF' || true
## Test Execution Plan

**Run smoke tests: False**  
No smoke-marked test has a verified dependency path to the modified shared libraries/fixtures. The changed addition in `tests/storage/cdi_upload/test_upload_virtctl.py` is not smoke-marked, and no smoke-marked file was verified to depend on `nodes_cpu_architecture`, `cluster_vlan_ids`, `update_nad_references`, or the moved `libs.net.nodenetworkconfigurationpolicy` helpers.

**Run gating tests: True**  
Verified paths:
- `tests/virt/node/general/test_machinetype.py` (gating) → `nodes_cpu_architecture` fixture → modified `tests/conftest.py`
- `tests/storage/disk_preallocation/test_disk_preallocation.py::test_preallocation_dv` (gating) → changed fixtures in `tests/storage/disk_preallocation/conftest.py`
- `tests/storage/disk_preallocation/test_disk_preallocation.py::test_preallocation_globally_dv_spec_without_preallocation` (gating) → changed fixtures in `tests/storage/disk_preallocation/conftest.py`
- `tests/install_upgrade_operators/deployment/test_hco_deployment_params.py` (gating) → assertions/xfail flow changed directly in the test file

**Affected tests to run**
- `tests/virt/node/general/test_machinetype.py` (gating)
- `tests/install_upgrade_operators/deployment/test_hco_deployment_params.py` (gating)
- `tests/storage/disk_preallocation/test_disk_preallocation.py::test_preallocation_dv` (gating)
- `tests/storage/disk_preallocation/test_disk_preallocation.py::test_preallocation_globally_dv_spec_without_preallocation` (gating)
- `tests/install_upgrade_operators/pod_validation/test_pod_spec.py`
- `tests/storage/cdi_upload/test_upload_virtctl.py::test_virtctl_image_upload_dv_in_pudn_namespace`
- `tests/network/l2_bridge/nad_ref_change/test_nad_ref_change.py`
- `tests/network/localnet/nad_ref_change/test_nad_ref_change.py`
- `tests/network/l2_bridge/rhel9_rhel10_cluster/test_connectivity.py`
- `tests/network/localnet/rhel9_rhel10_cluster/test_connectivity.py`

**Real tests (cluster required)**

Error path (shared session/runtime fix):
`uv run pytest tests/virt/node/general/test_machinetype.py --collect-only`  
Expected: collection succeeds without `KeyError: 'cpu_arch'`

Happy path (plugin + shared fixture wiring regression):
`uv run pytest tests/network/localnet/rhel9_rhel10_cluster/test_connectivity.py --collect-only`  
Expected: collection succeeds with the plugin-provided network fixtures and no fixture/import errors

Runtime regression:
`uv run pytest tests/storage/cdi_upload/test_upload_virtctl.py -k test_virtctl_image_upload_dv_in_pudn_namespace`  
Expected: DataVolume upload succeeds in a namespace with a primary UDN
EOF

payload="$(mktemp)"
jq -n \
  --arg body "" \
  --arg event "COMMENT" \
  --arg path "$PATH_IN_PR" \
  --arg bodyText "$COMMENT_BODY" \
  --argjson line "$LINE_NO" \
  '{
    body: $body,
    event: $event,
    comments: [
      {
        path: $path,
        line: $line,
        side: "RIGHT",
        body: $bodyText
      }
    ]
  }' > "$payload"

for attempt in 1 2; do
  gh api \
    --method POST \
    -H "Accept: application/vnd.github+json" \
    "/repos/${REPO}/pulls/${PR_NUMBER}/reviews" \
    --input "$payload" \
    >/dev/null && exit 0
  sleep 2
done

exit 1

Length of output: 3810


🏁 Script executed:

#!/bin/bash
set -euo pipefail

REPO="RedHatQE/openshift-virtualization-tests"
PR_NUMBER="5285"
PATH_IN_PR=".github/workflows/retest-smoke.yml"

HEAD_SHA="$(gh api "/repos/${REPO}/pulls/${PR_NUMBER}" --jq '.head.sha')"

read -r -d '' COMMENT_BODY <<'EOF' || true
## Test Execution Plan

**Run smoke tests: False**  
No smoke-marked test has a verified dependency path to the modified shared libraries/fixtures. The changed addition in `tests/storage/cdi_upload/test_upload_virtctl.py` is not smoke-marked, and no smoke-marked file was verified to depend on `nodes_cpu_architecture`, `cluster_vlan_ids`, `update_nad_references`, or the moved `libs.net.nodenetworkconfigurationpolicy` helpers.

**Run gating tests: True**  
Verified paths:
- `tests/virt/node/general/test_machinetype.py` (gating) → `nodes_cpu_architecture` fixture → modified `tests/conftest.py`
- `tests/storage/disk_preallocation/test_disk_preallocation.py::test_preallocation_dv` (gating) → changed fixtures in `tests/storage/disk_preallocation/conftest.py`
- `tests/storage/disk_preallocation/test_disk_preallocation.py::test_preallocation_globally_dv_spec_without_preallocation` (gating) → changed fixtures in `tests/storage/disk_preallocation/conftest.py`
- `tests/install_upgrade_operators/deployment/test_hco_deployment_params.py` (gating) → assertions/xfail flow changed directly in the test file

**Affected tests to run**
- `tests/virt/node/general/test_machinetype.py` (gating)
- `tests/install_upgrade_operators/deployment/test_hco_deployment_params.py` (gating)
- `tests/storage/disk_preallocation/test_disk_preallocation.py::test_preallocation_dv` (gating)
- `tests/storage/disk_preallocation/test_disk_preallocation.py::test_preallocation_globally_dv_spec_without_preallocation` (gating)
- `tests/install_upgrade_operators/pod_validation/test_pod_spec.py`
- `tests/storage/cdi_upload/test_upload_virtctl.py::test_virtctl_image_upload_dv_in_pudn_namespace`
- `tests/network/l2_bridge/nad_ref_change/test_nad_ref_change.py`
- `tests/network/localnet/nad_ref_change/test_nad_ref_change.py`
- `tests/network/l2_bridge/rhel9_rhel10_cluster/test_connectivity.py`
- `tests/network/localnet/rhel9_rhel10_cluster/test_connectivity.py`

**Real tests (cluster required)**

Error path (shared session/runtime fix):
`uv run pytest tests/virt/node/general/test_machinetype.py --collect-only`  
Expected: collection succeeds without `KeyError: 'cpu_arch'`

Happy path (plugin + shared fixture wiring regression):
`uv run pytest tests/network/localnet/rhel9_rhel10_cluster/test_connectivity.py --collect-only`  
Expected: collection succeeds with the plugin-provided network fixtures and no fixture/import errors

Runtime regression:
`uv run pytest tests/storage/cdi_upload/test_upload_virtctl.py -k test_virtctl_image_upload_dv_in_pudn_namespace`  
Expected: DataVolume upload succeeds in a namespace with a primary UDN
EOF

# Retry inline review comment using diff position on the first changed line of the first changed file.
for attempt in 1 2; do
  if gh api \
    --method POST \
    -H "Accept: application/vnd.github+json" \
    "/repos/${REPO}/pulls/${PR_NUMBER}/comments" \
    -f body="$COMMENT_BODY" \
    -f commit_id="$HEAD_SHA" \
    -f path="$PATH_IN_PR" \
    -F position=1 \
    >/dev/null
  then
    exit 0
  fi
  sleep 2
done

# Fallback: regular PR comment
gh api \
  --method POST \
  -H "Accept: application/vnd.github+json" \
  "/repos/${REPO}/issues/${PR_NUMBER}/comments" \
  -f body="$COMMENT_BODY" \
  >/dev/null

Length of output: 3709



@yossisegev

Copy link
Copy Markdown
Contributor Author

/build-and-push-container

@yossisegev

Copy link
Copy Markdown
Contributor Author

Test Execution Plan

Run smoke tests: False No smoke-marked test has a verified dependency path to the modified shared libraries/fixtures. The changed addition in tests/storage/cdi_upload/test_upload_virtctl.py is not smoke-marked, and no smoke-marked file was verified to depend on nodes_cpu_architecture, cluster_vlan_ids, update_nad_references, or the moved libs.net.nodenetworkconfigurationpolicy helpers.

Run gating tests: True Verified paths:

  • tests/virt/node/general/test_machinetype.py (gating) → nodes_cpu_architecture fixture → modified tests/conftest.py
  • tests/storage/disk_preallocation/test_disk_preallocation.py::test_preallocation_dv (gating) → changed fixtures in tests/storage/disk_preallocation/conftest.py
  • tests/storage/disk_preallocation/test_disk_preallocation.py::test_preallocation_globally_dv_spec_without_preallocation (gating) → changed fixtures in tests/storage/disk_preallocation/conftest.py
  • tests/install_upgrade_operators/deployment/test_hco_deployment_params.py (gating) → assertions/xfail flow changed directly in the test file

Affected tests to run

  • tests/virt/node/general/test_machinetype.py (gating)
  • tests/install_upgrade_operators/deployment/test_hco_deployment_params.py (gating)
  • tests/storage/disk_preallocation/test_disk_preallocation.py::test_preallocation_dv (gating)
  • tests/storage/disk_preallocation/test_disk_preallocation.py::test_preallocation_globally_dv_spec_without_preallocation (gating)
  • tests/install_upgrade_operators/pod_validation/test_pod_spec.py
  • tests/storage/cdi_upload/test_upload_virtctl.py::test_virtctl_image_upload_dv_in_pudn_namespace
  • tests/network/l2_bridge/nad_ref_change/test_nad_ref_change.py
  • tests/network/localnet/nad_ref_change/test_nad_ref_change.py
  • tests/network/l2_bridge/rhel9_rhel10_cluster/test_connectivity.py
  • tests/network/localnet/rhel9_rhel10_cluster/test_connectivity.py

Real tests (cluster required)

Error path (shared session/runtime fix): uv run pytest tests/virt/node/general/test_machinetype.py --collect-only Expected: collection succeeds without KeyError: 'cpu_arch'

Happy path (plugin + shared fixture wiring regression): uv run pytest tests/network/localnet/rhel9_rhel10_cluster/test_connectivity.py --collect-only Expected: collection succeeds with the plugin-provided network fixtures and no fixture/import errors

Runtime regression: uv run pytest tests/storage/cdi_upload/test_upload_virtctl.py -k test_virtctl_image_upload_dv_in_pudn_namespace Expected: DataVolume upload succeeds in a namespace with a primary UDN

@coderabbitai I verified per your test-plan in the job tests-runner #5786 (the full URL is removed).
81 tests passed, 2 virt tests failed in getting golden image data-source, which doesn't seem to be related.

@coderabbitai

coderabbitai Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Tip

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

@yossisegev Thanks — that closes the verification gap for me.

LOW: The result looks consistent with the scope of this PR: 81 passing tests across the targeted paths is strong coverage, and the 2 failures being isolated to golden image data-source retrieval do not look causally tied to the cpu_arch / VM architecture fallback changes you made here.

That distinction matters because the purpose of the requested verification was to prove:

  • the missing-cpu_arch path no longer blows up at collection/runtime, and
  • the VM spec/image resolution still behaves correctly across homogeneous and multi-arch scenarios.

Based on your run, that evidence is now in place.

@yossisegev

Copy link
Copy Markdown
Contributor Author

@coderabbitai I see the icon saying that there are open review comments from you, but I don't find any. Please point me to any open issues you have, or otherwise change the comments icon to a green checkmark.

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

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"
owner="${repo%%/*}"
name="${repo#*/}"
pr_number=5285

echo "=== Review threads (resolution state + participants) ==="
gh api graphql \
  -F owner="$owner" \
  -F name="$name" \
  -F number="$pr_number" \
  -f query='
query($owner: String!, $name: String!, $number: Int!) {
  repository(owner: $owner, name: $name) {
    pullRequest(number: $number) {
      reviewThreads(first: 100) {
        nodes {
          isResolved
          isOutdated
          path
          line
          comments(first: 20) {
            nodes {
              author { login }
              body
              createdAt
              url
            }
          }
        }
      }
    }
  }
}' | jq -r '
  .data.repository.pullRequest.reviewThreads.nodes[]
  | {
      isResolved,
      isOutdated,
      path,
      line,
      authors: ([.comments.nodes[].author.login] | unique),
      comments: [.comments.nodes[] | {author: .author.login, url, body: (.body | gsub("\n"; " ") | .[0:160])}]
    }'

echo "=== Unresolved threads involving coderabbitai[bot] ==="
gh api graphql \
  -F owner="$owner" \
  -F name="$name" \
  -F number="$pr_number" \
  -f query='
query($owner: String!, $name: String!, $number: Int!) {
  repository(owner: $owner, name: $name) {
    pullRequest(number: $number) {
      reviewThreads(first: 100) {
        nodes {
          isResolved
          isOutdated
          path
          line
          comments(first: 20) {
            nodes {
              author { login }
              body
              url
            }
          }
        }
      }
    }
  }
}' | jq -r '
  .data.repository.pullRequest.reviewThreads.nodes[]
  | select(.isResolved == false)
  | select(any(.comments.nodes[]; .author.login == "coderabbitai[bot]"))
  | {
      path,
      line,
      comments: [.comments.nodes[] | {author: .author.login, url, body: (.body | gsub("\n"; " ") | .[0:200])}]
    }'

echo "=== Recent issue comments by coderabbitai[bot] ==="
gh api "/repos/$repo/issues/$pr_number/comments" --paginate \
  --jq '.[] | select(.user.login=="coderabbitai[bot]") | {created_at, html_url, body: (.body|.[0:200])}'

Length of output: 14275


@yossisegev LOW: I checked #5285, and I do not have any unresolved review threads there.

Why this matters: GitHub’s review indicator is driven by unresolved review state, so if there are no open threads from me, the right fix is to explicitly resolve my remaining review state so the UI can catch up.

I’m clearing my review comments now.
[resolve]

@rnetser rnetser left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

/approve
/lgtm

@openshift-virtualization-qe-bot-4

Copy link
Copy Markdown

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

@yossisegev

Copy link
Copy Markdown
Contributor Author

/cherry-pick cnv-4.22

2 similar comments
@yossisegev

Copy link
Copy Markdown
Contributor Author

/cherry-pick cnv-4.22

@yossisegev

Copy link
Copy Markdown
Contributor Author

/cherry-pick cnv-4.22

@openshift-virtualization-qe-bot-6

Copy link
Copy Markdown

Cherry-picked PR Handle missing cpu-arch config gracefully in pytest fixture into cnv-4.22: #5427

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.