Skip to content

fix: decouple datasources arch suffix from preference arch suffix#5105

Open
geetikakay wants to merge 1 commit into
RedHatQE:mainfrom
geetikakay:fix_arm64_smoke
Open

fix: decouple datasources arch suffix from preference arch suffix#5105
geetikakay wants to merge 1 commit into
RedHatQE:mainfrom
geetikakay:fix_arm64_smoke

Conversation

@geetikakay

@geetikakay geetikakay commented Jun 2, 2026

Copy link
Copy Markdown
Contributor
What this PR does / why we need it:

Split the single add_arch_suffix flag into two independent controls:

  • add_preference_arch_suffix: appends arch to clusterprefernces name
  • add_data_source_arch_suffix: appends arch to datasources name only when cluster_type is multiarch

these should be set independently because clusterpreferences (deployed by virt-operator) and datasources(deployed by ssp) have no direct dependency

Which issue(s) this PR fixes:

The previous logic tied the DataSource suffix to the preference suffix which is False
for amd64, causing multiarch+amd64 to resolve to "rhel10" instead
of "rhel10-amd64"

Special notes for reviewer:

I missed checking with standalone arm cluster and this PR should take care of it.

jira-ticket:

https://redhat.atlassian.net/browse/CNV-89104

Summary by CodeRabbit

  • Refactor

    • Architecture suffixing behavior split: naming for preferences and data-source identifiers are now controlled independently to avoid unexpected per-architecture name changes.
  • Tests

    • Expanded and updated test coverage to validate the new suffixing rules across operating systems, CPU architectures, and cluster types.
  • Chores

    • ARM64 test configuration now includes a CentOS Stream 10 instance-type preference.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@geetikakay

geetikakay commented Jun 2, 2026

Copy link
Copy Markdown
Contributor Author

/wip
testing pending

@coderabbitai

coderabbitai Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 1295dafa-7a47-4278-afe3-57e9b9d58494

📥 Commits

Reviewing files that changed from the base of the PR and between f0e171b and 2a05365.

📒 Files selected for processing (5)
  • tests/global_config_arm64.py
  • utilities/os_utils.py
  • utilities/pytest_utils.py
  • utilities/unittests/test_os_utils.py
  • utilities/unittests/test_pytest_utils.py

📝 Walkthrough

Walkthrough

Split the single arch-suffix flag into two booleans—add_preference_arch_suffix and add_data_source_arch_suffix—adjusted internal name construction, updated callers in generate_instance_type_matrix_dicts, revised unit/integration tests, and added CENTOS_STREAM10_PREFERENCE to the ARM64 global config.

Changes

Architecture suffix handling refactor

Layer / File(s) Summary
Function signature and documentation
utilities/os_utils.py
Updated generate_linux_instance_type_os_matrix parameters from a single add_arch_suffix to add_preference_arch_suffix and add_data_source_arch_suffix, and updated the docstring to document separate semantics.
Suffix appending logic
utilities/os_utils.py
Preference names use add_preference_arch_suffix; DATA_SOURCE_NAME receives -<arch_suffix> only when add_data_source_arch_suffix is True and arch_suffix is provided.
Caller integration in pytest_utils
utilities/pytest_utils.py
generate_instance_type_matrix_dicts computes add_preference_arch_suffix from CPU arch and add_data_source_arch_suffix from py_config["cluster_type"] == MULTIARCH, passes both flags into RHEL and CentOS Stream generation (centos.stream sets preference suffixing disabled).
Unit tests for os_utils behavior
utilities/unittests/test_os_utils.py
Replaced prior arch-suffix tests with targeted cases for preference-only default, conditional data-source suffixing, disabled preference suffixing, multiarch+AMD_64, and no-op when no arch_suffix.
Integration tests for pytest_utils callers
utilities/unittests/test_pytest_utils.py
Renamed test parameters to expected_add_preference_arch_suffix, updated assertions to pass add_preference_arch_suffix and explicit add_data_source_arch_suffix=False for non-multiarch, added test ensuring add_data_source_arch_suffix=True under MULTIARCH, and reformatted constants import.
ARM64 global config constant
tests/global_config_arm64.py
Added CENTOS_STREAM10_PREFERENCE import and defined instance_type_centos_os_list = [CENTOS_STREAM10_PREFERENCE].

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

new-tests

Suggested reviewers

  • dshchedr
  • rnetser
  • vsibirsk
  • RoniKishner

Caution

Pre-merge checks failed

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

  • Ignore

❌ Failed checks (1 error)

Check name Status Explanation Resolution
Stp Link Required ❌ Error Two new test files added with 174 total test functions, but neither file has STP/RFE/Jira link in module-, class-, or function-level docstrings. Add STP/RFE/Jira link to module docstring of utilities/unittests/test_os_utils.py and utilities/unittests/test_pytest_utils.py (e.g., "STP: https://..." in the docstring).
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: decoupling two independent arch suffix controls for datasources and preferences.
Description check ✅ Passed The description provides all required sections with substantive content explaining the change rationale, the specific bug being fixed, and reviewer notes.
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 and usage tips.

@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

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

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
  • geetikakay
  • rnetser
  • vsibirsk
Available Labels
  • hold
  • verified
  • wip
  • lgtm
  • approve
AI Features
  • Cherry-Pick Conflict Resolution: Enabled (claude/claude-opus-4-6[1m])

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

@codecov

codecov Bot commented Jun 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.65%. Comparing base (a2dc143) to head (2a05365).
⚠️ Report is 94 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5105      +/-   ##
==========================================
- Coverage   98.67%   98.65%   -0.02%     
==========================================
  Files          25       25              
  Lines        2487     2462      -25     
==========================================
- Hits         2454     2429      -25     
  Misses         33       33              
Flag Coverage Δ
utilities 98.65% <100.00%> (-0.02%) ⬇️

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

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

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

@geetikakay

Copy link
Copy Markdown
Contributor Author

/build-and-push-container

@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: 2

🤖 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 `@utilities/pytest_utils.py`:
- Line 512: Replace the defensive dict access using
py_config.get("cluster_type") with direct key access py_config["cluster_type"]
so the code for add_data_source_arch_suffix fails fast on a missing
configuration; update the expression that sets add_data_source_arch_suffix
(which compares to MULTIARCH) to use py_config["cluster_type"] and ensure any
related logic in this function continues to rely on the guaranteed presence of
the key.

In `@utilities/unittests/test_os_utils.py`:
- Around line 336-385: Add a unit test that covers the regression where
preference must remain bare while DataSource is suffixed for amd64: create a
test (e.g., test_multiarch_amd64_bare_preference_suffixed_data_source) that
calls generate_linux_instance_type_os_matrix with os_name="rhel",
preferences=[RHEL10_PREFERENCE], arch_suffix=AMD_64,
add_preference_arch_suffix=False, add_data_source_arch_suffix=True (import
AMD_64 from utilities.constants), then assert the result uses the bare
preference key RHEL10_PREFERENCE and that config["preference"] ==
RHEL10_PREFERENCE while config["DATA_SOURCE_NAME"] == f"rhel10-{AMD_64}" to pin
the bug fix.
🪄 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: 7c719c57-ceea-42ae-94ff-99b8bb42fa99

📥 Commits

Reviewing files that changed from the base of the PR and between b1117fc and 59f4d0e.

📒 Files selected for processing (5)
  • tests/global_config_arm64.py
  • utilities/os_utils.py
  • utilities/pytest_utils.py
  • utilities/unittests/test_os_utils.py
  • utilities/unittests/test_pytest_utils.py

Comment thread utilities/pytest_utils.py Outdated
Comment thread utilities/unittests/test_os_utils.py
@openshift-virtualization-qe-bot-3

Copy link
Copy Markdown
Contributor

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

@geetikakay

Copy link
Copy Markdown
Contributor Author

/wip cancel

@openshift-virtualization-qe-bot-5 openshift-virtualization-qe-bot-5 changed the title WIP: fix: decouple datasources arch suffix from preference arch suffix fix: decouple datasources arch suffix from preference arch suffix Jun 3, 2026
@geetikakay

Copy link
Copy Markdown
Contributor Author

/verified
jira ticket has all testing details

@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 formal review - just post the inline comment directly.

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

Analysis Requirements:

  1. Examine code changes in each modified file

  2. Identify affected code paths, functions, and classes

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

  4. Trace test dependencies through imports, shared utilities, 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 change request 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)
  • 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)

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 an inline review comment containing the test execution plan on the first changed line
  2. THEN STOP IMMEDIATELY - Do NOT generate any additional response
  3. FALLBACK ONLY: If submitting the review fails after retrying, post as a regular PR comment
  4. SILENCE = SUCCESS: After successfully submitting the review, your task is complete. No confirmation needed.

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

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

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

CRITICAL — 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/global_config_arm64.py
@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Tip

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
echo "=== Direct callers of generate_linux_instance_type_os_matrix ==="
rg -n 'generate_linux_instance_type_os_matrix' --type py -C2

echo ""
echo "=== Direct callers of generate_instance_type_matrix_dicts ==="
rg -n 'generate_instance_type_matrix_dicts' --type py -C2

echo ""
echo "=== Smoke test files ==="
rg -l '`@pytest.mark.smoke`' tests/

echo ""
echo "=== Gating test files ==="
rg -l '`@pytest.mark.gating`' tests/

echo ""
echo "=== Check if smoke files import generate_linux_instance_type_os_matrix or generate_instance_type_matrix_dicts ==="
SMOKE_FILES=$(rg -l '`@pytest.mark.smoke`' tests/)
for f in $SMOKE_FILES; do
  if grep -q 'generate_linux_instance_type_os_matrix\|generate_instance_type_matrix_dicts' "$f" 2>/dev/null; then
    echo "SMOKE MATCH: $f"
  fi
done

echo ""
echo "=== Check conftests in smoke file directories for these symbols ==="
SMOKE_FILES=$(rg -l '`@pytest.mark.smoke`' tests/)
for f in $SMOKE_FILES; do
  dir=$(dirname "$f")
  while [ "$dir" != "." ] && [ "$dir" != "/" ]; do
    conf="$dir/conftest.py"
    if [ -f "$conf" ]; then
      if grep -q 'generate_linux_instance_type_os_matrix\|generate_instance_type_matrix_dicts' "$conf" 2>/dev/null; then
        echo "CONFTEST MATCH: $conf for smoke test $f"
      fi
    fi
    dir=$(dirname "$dir")
  done
done

echo ""
echo "=== Tests that import or call generate_instance_type_matrix_dicts ==="
rg -n 'generate_instance_type_matrix_dicts\|generate_linux_instance_type_os_matrix' tests/ --type py -l

echo ""
echo "=== Check gating files for these symbols ==="
GATING_FILES=$(rg -l '`@pytest.mark.gating`' tests/)
for f in $GATING_FILES; do
  if grep -q 'generate_linux_instance_type_os_matrix\|generate_instance_type_matrix_dicts' "$f" 2>/dev/null; then
    echo "GATING MATCH: $f"
  fi
done

echo ""
echo "=== global_config_arm64.py content ==="
cat tests/global_config_arm64.py

echo ""
echo "=== Check callers of generate_instance_type_matrix_dicts in conftest files ==="
rg -n 'generate_instance_type_matrix_dicts' --type py

Length of output: 30221


🏁 Script executed:

#!/bin/bash
echo "=== Verify test_rhel_os.py uses instance_type_rhel_os_matrix ==="
rg -n 'instance_type_rhel_os_matrix\|instance_type_centos_os_matrix\|instance_type_fedora_os_matrix' tests/infrastructure/instance_types/ --type py -C2

echo ""
echo "=== Check update_cpu_arch_related_config callers ==="
rg -n 'update_cpu_arch_related_config' --type py -l

echo ""
echo "=== Get PR diff to find first changed line position ==="
gh pr diff 5105 --patch | head -80

echo ""
echo "=== Get PR commit SHA ==="
gh pr view 5105 --json commits --jq '.commits[-1].oid'

Length of output: 4947


🏁 Script executed:

#!/bin/bash
echo "=== Tests that use instance_type_rhel_os_matrix / centos / fedora ==="
rg -rn 'instance_type_rhel_os_matrix\|instance_type_centos_os_matrix\|instance_type_fedora_os_matrix' tests/ --type py -l

echo ""
echo "=== Check conftest.py for instance_type matrices and update_cpu_arch_related_config ==="
grep -n 'instance_type_rhel_os_matrix\|instance_type_centos_os_matrix\|update_cpu_arch_related_config' conftest.py | head -30

echo ""
echo "=== Find all files using these matrices ==="
rg -rn 'instance_type_rhel_os_matrix\|instance_type_centos_os_matrix\|instance_type_fedora_os_matrix' --type py -l

echo ""
echo "=== Post inline review comment via GitHub API ==="
# Get the diff to find position
DIFF_POSITION=$(gh api repos/RedHatQE/openshift-virtualization-tests/pulls/5105/files --jq '
  .[] | select(.filename == "tests/global_config_arm64.py") | .patch' | head -5)
echo "Patch snippet: $DIFF_POSITION"

# Get all PR files to confirm positions
gh api repos/RedHatQE/openshift-virtualization-tests/pulls/5105/files --jq '.[] | {filename: .filename, sha: .sha}'

Length of output: 2162


🏁 Script executed:

#!/bin/bash

BODY='**Test Execution Plan**

- **Run smoke tests: False** — No verified dependency path. Smoke-marked files (`tests/virt/node/general/test_container_disk_vm.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/install_upgrade_operators/csv/test_csv.py`, `tests/infrastructure/instance_types/supported_os/test_rhel_os.py`) do not reference `instance_type_rhel_os_matrix`, `instance_type_centos_os_matrix`, or `instance_type_fedora_os_matrix`.

- **Run gating tests: False** — No verified dependency path. Gating-marked test files do not reference the affected matrices populated by the modified `generate_linux_instance_type_os_matrix` / `generate_instance_type_matrix_dicts`.

- **Affected tests to run:**
  - `utilities/unittests/test_os_utils.py::TestGenerateInstanceTypeRhelOsMatrix` — directly tests the modified `generate_linux_instance_type_os_matrix` (new `add_preference_arch_suffix` / `add_data_source_arch_suffix` params)
  - `utilities/unittests/test_pytest_utils.py::TestGenerateInstanceTypeMatrixDicts` — directly tests the updated `generate_instance_type_matrix_dicts` logic

- **ARM64 / multiarch cluster integration:** Run on an ARM64 or multiarch cluster to validate that the new `instance_type_centos_os_list` in `tests/global_config_arm64.py` is picked up correctly and that DataSource names for RHEL/centos are constructed without an arch suffix on homogeneous clusters and with it on multiarch clusters.
'

gh api \
  repos/RedHatQE/openshift-virtualization-tests/pulls/5105/reviews \
  -X POST \
  -F event=COMMENT \
  -F commit_id=59f4d0e29af93f1bc9f54af042a86390f08e63df \
  -f "comments[][path]=tests/global_config_arm64.py" \
  -F "comments[][position]=4" \
  -f "comments[][body]=$BODY" \
  -f body=''

Length of output: 3648




🧠 Learnings used
Learnt from: EdDev
Repo: RedHatQE/openshift-virtualization-tests PR: 0
File: :0-0
Timestamp: 2026-04-30T13:42:43.892Z
Learning: In the openshift-virtualization-tests repository, when processing test execution plan requests for PRs that introduce NEW test classes or test files (not just modifications to existing tests), always verify STD-first workflow compliance as part of the analysis: (1) check if the new test class has actual implementation code (assertions, test logic) — if so, it needs a prior STD PR, (2) check if the test file has a module docstring with STP or Jira/RFE link, (3) check if `What this PR does / why we need it:` in the PR description has meaningful content. Flag any violation even when the bot's primary request is only for a test execution plan. These checks should be appended to the test execution plan inline comment.

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

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

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

Learnt from: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 0
File: :0-0
Timestamp: 2026-05-29T11:02:22.804Z
Learning: In the RedHatQE/openshift-virtualization-tests repository, version-bump PRs that update the main branch to reference a new CNV release (e.g., "Update project `main` to reference cnv 5.0") do NOT add new test files or test modules. These PRs only update metadata (pyproject.toml, tox.ini, .coderabbit.yaml) and clean up resolved Jira fixtures/markers in existing files. The "Stp Link Required" pre-merge check may incorrectly flag hundreds of "newly added" test files as a false positive due to the base-branch comparison shifting after branching — this should be ignored for such PRs.

Learnt from: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 4328
File: tests/network/flat_overlay/test_multi_network_policy.py:32-32
Timestamp: 2026-04-14T16:15:36.741Z
Learning: In the RedHatQE/openshift-virtualization-tests repository, when reviewing any PR with "Quarantine" in the title or a `quarantine` label, always verify compliance with docs/QUARANTINE_GUIDELINES.md:
- Category 1 (Product Bug): must use `pytest.mark.jira("CNV-XXXXX", run=False)` — the `pytest_jira` plugin conditionally skips the test when the Jira issue is open. Do NOT suggest replacing this with `xfail`.
- Category 2 (Automation Issue): must use `pytest.mark.xfail(run=False, reason=...)` — pytest itself handles the skip.
Flag any quarantine PR that uses the wrong category marker, is missing a Jira ticket reference, or uses `run=False` in the wrong context. Raising these compliance questions is always appropriate for quarantine PRs, even if the final resolution confirms the marker is correct.

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

Learnt from: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 0
File: :0-0
Timestamp: 2026-05-27T09:38:55.486Z
Learning: For PR reviews in RedHatQE/openshift-virtualization-tests, pre-merge checks must be re-evaluated and reported on every new commit push, not just on the initial review. The user (rnetser) has explicitly stated: "you must always run the pre merge checks on every commit."

Learnt from: servolkov
Repo: RedHatQE/openshift-virtualization-tests PR: 5111
File: tests/network/localnet/upgrade/test_default_bridge_connectivity.py:1-11
Timestamp: 2026-06-03T09:46:29.920Z
Learning: In RedHatQE/openshift-virtualization-tests, new test files (test_*.py) written as bug automation — i.e., tests that verify a fix for an OCP bug (OCPBUGS-*) or a CNV Jira bug (CNV-*) — do NOT require the STD-first workflow (separate STD placeholder PR before implementation) and do NOT require an STP link. The bug tracker URL (e.g., https://redhat.atlassian.net/browse/OCPBUGS-66994) in the module docstring is sufficient traceability. The STD may be included in the same implementation PR. Do not flag missing STP links or missing dedicated STD PRs for OCPBUGS/CNV bug-automation tests.

Learnt from: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 4954
File: .flake8:4-4
Timestamp: 2026-06-01T14:00:52.523Z
Learning: In RedHatQE/openshift-virtualization-tests, the smoke-marked test files (tests/storage/cdi_clone/test_clone.py, tests/storage/cdi_upload/test_upload_virtctl.py, tests/virt/cluster/common_templates/rhel/test_rhel_os_support.py, tests/virt/node/general/test_container_disk_vm.py) have traceable dependency paths to utilities/storage.py, utilities/hco.py (wait_for_hco_conditions), utilities/infra.py, and utilities/virt.py via direct imports and via tests/storage/conftest.py. Do not conclude "no smoke dependency path" without verifying these transitive imports.

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

Learnt from: azhivovk
Repo: RedHatQE/openshift-virtualization-tests PR: 5039
File: tests/network/l2_bridge/nad_ref_change/lib_helpers.py:1-1
Timestamp: 2026-06-02T21:16:58.118Z
Learning: In RedHatQE/openshift-virtualization-tests, when a PR only relocates functions to shared libraries and updates import paths in test files (no logic change), do NOT flag the callers as requiring full test re-execution. At most, run `pytest --collect-only` to verify the new import paths resolve correctly. Only require full re-execution of caller tests when the moved function's implementation changes behavior.

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

Learnt from: CR
Repo: RedHatQE/openshift-virtualization-tests PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-18T15:22:26.757Z
Learning: Applies to tests/**/test_*.py : New feature tests must follow the STD-first workflow: (1) STP (Software Test Plan) reviewed and approved, (2) STD (Software Test Description) placeholder tests with docstrings and `__test__ = False` reviewed, (3) Implementation only after STD review. Never submit test implementation without prior STD review.

Learnt from: dshchedr
Repo: RedHatQE/openshift-virtualization-tests PR: 4118
File: utilities/database.py:0-0
Timestamp: 2026-03-17T01:32:13.674Z
Learning: In RedHatQE/openshift-virtualization-tests, maintainer dshchedr prefers CodeRabbit to post targeted inline comments on the Files changed tab for each applicable location rather than aggregating multiple issues into a single discussion thread.

Learnt from: dshchedr
Repo: RedHatQE/openshift-virtualization-tests PR: 4118
File: utilities/database.py:0-0
Timestamp: 2026-03-17T01:32:13.674Z
Learning: In RedHatQE/openshift-virtualization-tests, maintainer dshchedr prefers CodeRabbit to post targeted inline comments on the Files Changed tab at each applicable location rather than aggregating multiple issues into a single PR discussion thread reply.

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

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

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

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

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

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

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

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

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

Learnt from: RoniKishner
Repo: RedHatQE/openshift-virtualization-tests PR: 4196
File: utilities/pytest_utils.py:522-527
Timestamp: 2026-03-22T12:40:15.236Z
Learning: In the RedHatQE/openshift-virtualization-tests repository, CentOS Stream VirtualMachineClusterPreferences do NOT have architecture-specific variants for any architecture (including ARM64 and s390x). Preferences use generic names like "centos.stream9" and "centos.stream10" without any architecture suffix. Therefore, in `utilities/pytest_utils.py`, the call to `generate_linux_instance_type_os_matrix` for CentOS Stream should always use `arch_suffix=None` (or omit the parameter entirely) — never passing cpu_arch as arch_suffix.

Learnt from: vsibirsk
Repo: RedHatQE/openshift-virtualization-tests PR: 3883
File: tests/global_config_s390x.py:16-22
Timestamp: 2026-02-23T16:30:33.855Z
Learning: On s390x clusters, Fedora VirtualMachineClusterPreference uses architecture-specific preference names with the s390x suffix (e.g., "fedora.42.s390x"), similar to RHEL 9/10 preferences. This differs from CentOS Stream which uses generic preference names without architecture suffixes on s390x. In tests/global_config_s390x.py and utilities/pytest_utils.py, Fedora instance type matrix generation should include arch_suffix=S390X on s390x clusters.

Learnt from: hmeir
Repo: RedHatQE/openshift-virtualization-tests PR: 4880
File: tests/install_upgrade_operators/pod_validation/test_pod_spec.py:67-70
Timestamp: 2026-05-19T08:29:42.737Z
Learning: In RedHatQE/openshift-virtualization-tests, when a PR is a cherry pick from another branch, the team prefers to keep the code identical to the source PR even if minor style improvements (e.g., replacing unused fixture parameters with `pytest.mark.usefixtures`) are possible. Do not insist on such changes in cherry-pick PRs targeting branch-specific branches (e.g., cnv-4.20).

Learnt from: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 0
File: :0-0
Timestamp: 2026-05-04T13:45:35.675Z
Learning: In the `openshift-virtualization-tests` repository, the PR description template is fulfilled on GitHub's rendered view. Do not flag missing PR template sections based on the raw diff alone.

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

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

Comment thread utilities/pytest_utils.py
@RoniKishner

Copy link
Copy Markdown
Contributor

/lgtm

@geetikakay

Copy link
Copy Markdown
Contributor Author

/test-plan

@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 formal review - just post the inline comment directly.

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

Analysis Requirements:

  1. Examine code changes in each modified file

  2. Identify affected code paths, functions, and classes

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

  4. Trace test dependencies through imports, shared utilities, 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 change request 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)
  • 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)

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 an inline review comment containing the test execution plan on the first changed line
  2. THEN STOP IMMEDIATELY - Do NOT generate any additional response
  3. FALLBACK ONLY: If submitting the review fails after retrying, post as a regular PR comment
  4. SILENCE = SUCCESS: After successfully submitting the review, your task is complete. No confirmation needed.

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

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

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

CRITICAL — 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/global_config_arm64.py
@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Tip

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Get latest commit SHA
COMMIT=$(gh pr view 5105 --repo RedHatQE/openshift-virtualization-tests --json commits --jq '.commits[-1].oid')
echo "Latest commit: $COMMIT"

# Get PR files to find position for tests/global_config_arm64.py
gh api repos/RedHatQE/openshift-virtualization-tests/pulls/5105/files \
  --jq '.[] | select(.filename == "tests/global_config_arm64.py") | {filename: .filename, patch: .patch}'

BODY='**Test Execution Plan**

- **Run smoke tests: True** — Verified path: `tests/infrastructure/instance_types/supported_os/test_rhel_os.py` (smoke) is parametrized from `py_config["instance_type_rhel_os_matrix"]` / `py_config["instance_type_centos_os_matrix"]`, which are populated by `generate_instance_type_matrix_dicts` → modified `generate_linux_instance_type_os_matrix` (new `add_preference_arch_suffix` / `add_data_source_arch_suffix` params).

- **Run gating tests: False** — No gating-marked file references the modified symbols.

**Affected tests to run:**
- `tests/infrastructure/instance_types/supported_os/test_rhel_os.py` *(smoke)* — parametrized via `instance_type_rhel_os_matrix` / `instance_type_centos_os_matrix`; validate correct preference and DataSource name construction.
- `utilities/unittests/test_os_utils.py::TestGenerateInstanceTypeRhelOsMatrix` — directly tests modified `generate_linux_instance_type_os_matrix`.
- `utilities/unittests/test_pytest_utils.py::TestGenerateInstanceTypeMatrixDicts` — directly tests updated `generate_instance_type_matrix_dicts`.

**Cluster coverage required:**
- Homogeneous ARM64: preference names carry `.arm64` suffix; DataSource names are bare (no suffix).
- Multiarch: DataSource names carry arch suffix for all architectures (AMD64, ARM64, s390x); ARM64 preferences carry `.arm64` suffix, CentOS Stream preferences remain bare.
- Homogeneous amd64: no arch suffix on either preference or DataSource.'

# Post inline review
gh api \
  repos/RedHatQE/openshift-virtualization-tests/pulls/5105/reviews \
  -X POST \
  -F event=COMMENT \
  -F commit_id="$COMMIT" \
  -f "comments[][path]=tests/global_config_arm64.py" \
  -F "comments[][position]=4" \
  -f "comments[][body]=$BODY" \
  -f body=''

Length of output: 4525




🧠 Learnings used
Learnt from: EdDev
Repo: RedHatQE/openshift-virtualization-tests PR: 0
File: :0-0
Timestamp: 2026-04-30T13:42:43.892Z
Learning: In the openshift-virtualization-tests repository, when processing test execution plan requests for PRs that introduce NEW test classes or test files (not just modifications to existing tests), always verify STD-first workflow compliance as part of the analysis: (1) check if the new test class has actual implementation code (assertions, test logic) — if so, it needs a prior STD PR, (2) check if the test file has a module docstring with STP or Jira/RFE link, (3) check if `What this PR does / why we need it:` in the PR description has meaningful content. Flag any violation even when the bot's primary request is only for a test execution plan. These checks should be appended to the test execution plan inline comment.

Learnt from: servolkov
Repo: RedHatQE/openshift-virtualization-tests PR: 5111
File: tests/network/localnet/upgrade/test_default_bridge_connectivity.py:1-11
Timestamp: 2026-06-03T09:46:34.574Z
Learning: In RedHatQE/openshift-virtualization-tests, new test files (test_*.py) written as bug automation — i.e., tests that verify a fix for an OCP bug (OCPBUGS-*) or a CNV Jira bug (CNV-*) — do NOT require the STD-first workflow (separate STD placeholder PR before implementation) and do NOT require an STP link. The bug tracker URL (e.g., https://redhat.atlassian.net/browse/OCPBUGS-66994) in the module docstring is sufficient traceability. The STD may be included in the same implementation PR. Do not flag missing STP links or missing dedicated STD PRs for OCPBUGS/CNV bug-automation tests.

Learnt from: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 0
File: :0-0
Timestamp: 2026-05-29T11:02:22.804Z
Learning: In the RedHatQE/openshift-virtualization-tests repository, version-bump PRs that update the main branch to reference a new CNV release (e.g., "Update project `main` to reference cnv 5.0") do NOT add new test files or test modules. These PRs only update metadata (pyproject.toml, tox.ini, .coderabbit.yaml) and clean up resolved Jira fixtures/markers in existing files. The "Stp Link Required" pre-merge check may incorrectly flag hundreds of "newly added" test files as a false positive due to the base-branch comparison shifting after branching — this should be ignored for such PRs.

Learnt from: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 4328
File: tests/network/flat_overlay/test_multi_network_policy.py:32-32
Timestamp: 2026-04-14T16:15:36.741Z
Learning: In the RedHatQE/openshift-virtualization-tests repository, when reviewing any PR with "Quarantine" in the title or a `quarantine` label, always verify compliance with docs/QUARANTINE_GUIDELINES.md:
- Category 1 (Product Bug): must use `pytest.mark.jira("CNV-XXXXX", run=False)` — the `pytest_jira` plugin conditionally skips the test when the Jira issue is open. Do NOT suggest replacing this with `xfail`.
- Category 2 (Automation Issue): must use `pytest.mark.xfail(run=False, reason=...)` — pytest itself handles the skip.
Flag any quarantine PR that uses the wrong category marker, is missing a Jira ticket reference, or uses `run=False` in the wrong context. Raising these compliance questions is always appropriate for quarantine PRs, even if the final resolution confirms the marker is correct.

Learnt from: dalia-frank
Repo: RedHatQE/openshift-virtualization-tests PR: 4603
File: tests/data_protection/oadp/test_velero.py:101-130
Timestamp: 2026-04-27T15:40:35.882Z
Learning: In the RedHatQE/openshift-virtualization-tests repository, when a test is re-enabled after being blocked by a product bug (e.g., a CNV Jira bug fix), the STD-first workflow and STP/RFE/Jira-epic module docstring requirements do NOT apply. These requirements are only for genuinely new feature tests. Do not flag previously blocked tests being re-enabled as missing STP traceability.

Learnt from: yossisegev
Repo: RedHatQE/openshift-virtualization-tests PR: 0
File: :0-0
Timestamp: 2026-05-14T14:01:37.353Z
Learning: In the RedHatQE/openshift-virtualization-tests repository, when a PR has the `needs-rebase` label and the pre-merge check reports a large number of "new test_*.py files" (e.g., 300+) that do not match the actual PR diff, this is a false positive caused by the check comparing the entire diverged branch file tree against main rather than just the PR diff. Do not raise STP Link Required or Docstring Coverage violations based on such check results — only flag these if the PR diff itself actually adds new test files or functions lacking docstrings.

Learnt from: azhivovk
Repo: RedHatQE/openshift-virtualization-tests PR: 4772
File: tests/network/l2_bridge/rhel9_rhel10_cluster/test_connectivity.py:31-37
Timestamp: 2026-05-08T06:44:12.879Z
Learning: In tests/network/l2_bridge/rhel9_rhel10_cluster/test_connectivity.py and tests/network/localnet/rhel9_rhel10_cluster/test_connectivity.py (dual-stream RHCOS 9/10 migration tests), the incremental/state-coupled test design is intentional and agreed upon in the STD (https://github.com/RedHatQE/openshift-virtualization-tests-design-docs/blob/main/stps/sig-virt/dual-stream-cluster-rhcos9-rhcos10/network.md). Tests are ordered (RHCOS 9 → RHCOS 10 → RHCOS 9) using pytest.mark.incremental, and test_*_to_rhcos9 intentionally relies on the VM already being on RHCOS 10 from the previous test. Do not flag this as a state-coupling issue or suggest making these tests independently runnable.

Learnt from: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 0
File: :0-0
Timestamp: 2026-05-31T17:55:25.719Z
Learning: In the RedHatQE/openshift-virtualization-tests repository, the STP/RFE/Jira link requirement applies ONLY to test files under the `tests/` directory (feature/STD tests). It does NOT apply to unit tests under `utilities/unittests/`, which cover internal utility functions and bug fixes.

Learnt from: azhivovk
Repo: RedHatQE/openshift-virtualization-tests PR: 4578
File: tests/network/localnet/nad_ref_change/test_nad_ref_change.py:18-18
Timestamp: 2026-04-26T11:44:22.059Z
Learning: In RedHatQE/openshift-virtualization-tests, STD (Standard Test Definition) PRs intentionally use placeholder Polarion IDs (e.g., `pytest.mark.polarion("CNV-00000")`) while test scenarios are still being agreed upon. Real Polarion IDs are filled in before or during the implementation PR. Do not flag placeholder Polarion IDs as a blocking issue in STD PRs that set `__test__ = False`.

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

Learnt from: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 4884
File: .coderabbit.yaml:77-81
Timestamp: 2026-05-17T14:29:54.117Z
Learning: In RedHatQE/openshift-virtualization-tests .coderabbit.yaml "STP link required" custom check: the STP/RFE/Jira link can appear at module-level docstring, enclosing class docstring, OR individual test function docstring — any level satisfies the requirement. The check must cover both (A) newly added test files (test_*.py) AND (B) newly added test functions (def test_*) inside existing files. A module-level or class-level STP link covers all tests in that scope. pytest.mark.polarion decorators do NOT substitute for the STP docstring link.

Learnt from: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 4908
File: utilities/unittests/test_pytest_utils.py:374-374
Timestamp: 2026-06-01T06:43:11.108Z
Learning: In RedHatQE/openshift-virtualization-tests, unit test files located under `utilities/unittests/` (and its subdirectories) do NOT require STP/RFE/Jira traceability links in test function docstrings. The STP/RFE/Jira traceability requirement applies only to integration/functional tests under the `tests/` directory. Do not flag missing STP/RFE/Jira links in any `test_*.py` file under `utilities/unittests/`.

Learnt from: rnetser
Repo: RedHatQE/openshift-virtualization-tests PR: 4884
File: .coderabbit.yaml:77-81
Timestamp: 2026-05-17T13:28:29.374Z
Learning: In RedHatQE/openshift-virtualization-tests, STP links in test file docstrings use two label variants: "STP:" (followed by URL) or "STP Reference:" (followed by URL). The URL always contains "openshift-virtualization-tests-design-docs/blob/main/stps/". The pytest.mark.polarion("CNV-XXXX") decorator is a separate per-test Polarion identifier and does NOT substitute for the STP docstring link. New test files must have the STP link at module, class, or test docstring level, with RFE: or Jira: links accepted as alternatives when no STP exists.

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

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

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

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

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

Learnt from: CR
Repo: RedHatQE/openshift-virtualization-tests PR: 0
File: docs/AI_CONTRIBUTION_POLICY.md:0-0
Timestamp: 2026-06-04T10:17:10.630Z
Learning: Applies to docs/**/test_*.py : Do not submit AI-generated tests without verifying marker completeness per project test fixture guidelines

Learnt from: CR
Repo: RedHatQE/openshift-virtualization-tests PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-18T15:22:26.757Z
Learning: Applies to tests/**/test_*.py : New feature tests must follow the STD-first workflow: (1) STP (Software Test Plan) reviewed and approved, (2) STD (Software Test Description) placeholder tests with docstrings and `__test__ = False` reviewed, (3) Implementation only after STD review. Never submit test implementation without prior STD review.

Learnt from: CR
Repo: RedHatQE/openshift-virtualization-tests PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-18T15:22:26.757Z
Learning: Applies to tests/**/test_*.py : All new tests must have markers. Check pytest.ini for available markers. Tier marker semantics: tier1 = operator/infrastructure tests, tier2 = customer use case tests, tier3 = complex/hardware/platform-specific/time-consuming tests. Assign the correct tier based on what the test validates. `tier2` is implicit and added automatically to all tests without exclusion markers—do NOT add it explicitly. Team markers (`network`, `storage`, `virt`, `iuo`, `observability`, `infrastructure`, `data_protection`, `chaos`) are implicit based on directory location—do NOT add them explicitly.

Learnt from: CR
Repo: RedHatQE/openshift-virtualization-tests PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-18T15:22:26.757Z
Learning: Applies to tests/**/test_*.py : STD (Software Test Description) docstrings must follow the format in `docs/SOFTWARE_TEST_DESCRIPTION.md`. Required sections: `Preconditions:`, `Steps:`, `Expected:`. Never use alternative section names. Each test verifies ONE thing with ONE `Expected:` assertion. Do NOT include implementation details, fixture names, code references, or variable names. Include STP link at the module, class, or test level. Markers can be at any level. Use `[Markers: ...]` syntax for parametrized markers. Name resources by function (e.g., 'client VM') not labels (e.g., 'VM-A'). Class/module docstring holds shared `Preconditions:`, individual tests add only their own. Include `[NEGATIVE]` indicator for failure scenario tests.

Learnt from: CR
Repo: RedHatQE/openshift-virtualization-tests PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-18T15:22:26.757Z
Learning: Applies to tests/**/test_*.py : When reviewing quarantine PRs, verify the quarantine mechanism matches the failure category: Product bugs use `pytest.mark.jira('CNV-XXXXX', run=False)`. Automation issues or unidentified failures use `pytest.mark.xfail(reason=f'{QUARANTINED}: ...', run=False)`. `pytest.mark.jira` is conditional (auto-re-enables when Jira resolved). `pytest.mark.xfail` quarantine is unconditional (requires manual de-quarantine PR).

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

Learnt from: azhivovk
Repo: RedHatQE/openshift-virtualization-tests PR: 5039
File: tests/network/l2_bridge/nad_ref_change/lib_helpers.py:1-1
Timestamp: 2026-06-02T21:17:09.602Z
Learning: In RedHatQE/openshift-virtualization-tests, when a PR only relocates functions to shared libraries and updates import paths in test files (no logic change), do NOT flag the callers as requiring full test re-execution. At most, run `pytest --collect-only` to verify the new import paths resolve correctly. Only require full re-execution of caller tests when the moved function's implementation changes behavior.

Learnt from: dshchedr
Repo: RedHatQE/openshift-virtualization-tests PR: 4118
File: utilities/database.py:0-0
Timestamp: 2026-03-17T01:32:13.674Z
Learning: In RedHatQE/openshift-virtualization-tests, maintainer dshchedr prefers CodeRabbit to post targeted inline comments on the Files changed tab for each applicable location rather than aggregating multiple issues into a single discussion thread.

Learnt from: dshchedr
Repo: RedHatQE/openshift-virtualization-tests PR: 4118
File: utilities/database.py:0-0
Timestamp: 2026-03-17T01:32:13.674Z
Learning: In RedHatQE/openshift-virtualization-tests, maintainer dshchedr prefers CodeRabbit to post targeted inline comments on the Files Changed tab at each applicable location rather than aggregating multiple issues into a single PR discussion thread reply.

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

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

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

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

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

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

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

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

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

Learnt from: RoniKishner
Repo: RedHatQE/openshift-virtualization-tests PR: 4196
File: utilities/pytest_utils.py:522-527
Timestamp: 2026-03-22T12:40:15.236Z
Learning: In the RedHatQE/openshift-virtualization-tests repository, CentOS Stream VirtualMachineClusterPreferences do NOT have architecture-specific variants for any architecture (including ARM64 and s390x). Preferences use generic names like "centos.stream9" and "centos.stream10" without any architecture suffix. Therefore, in `utilities/pytest_utils.py`, the call to `generate_linux_instance_type_os_matrix` for CentOS Stream should always use `arch_suffix=None` (or omit the parameter entirely) — never passing cpu_arch as arch_suffix.

Learnt from: vsibirsk
Repo: RedHatQE/openshift-virtualization-tests PR: 3883
File: tests/global_config_s390x.py:16-22
Timestamp: 2026-02-23T16:30:33.855Z
Learning: On s390x clusters, Fedora VirtualMachineClusterPreference uses architecture-specific preference names with the s390x suffix (e.g., "fedora.42.s390x"), similar to RHEL 9/10 preferences. This differs from CentOS Stream which uses generic preference names without architecture suffixes on s390x. In tests/global_config_s390x.py and utilities/pytest_utils.py, Fedora instance type matrix generation should include arch_suffix=S390X on s390x clusters.

Learnt from: hmeir
Repo: RedHatQE/openshift-virtualization-tests PR: 4880
File: tests/install_upgrade_operators/pod_validation/test_pod_spec.py:67-70
Timestamp: 2026-05-19T08:29:42.737Z
Learning: In RedHatQE/openshift-virtualization-tests, when a PR is a cherry pick from another branch, the team prefers to keep the code identical to the source PR even if minor style improvements (e.g., replacing unused fixture parameters with `pytest.mark.usefixtures`) are possible. Do not insist on such changes in cherry-pick PRs targeting branch-specific branches (e.g., cnv-4.20).

Comment thread utilities/os_utils.py
Comment on lines +275 to +277
add_data_source_arch_suffix: When True, append arch_suffix to the DataSource name. Only True on
multiarch clusters where SSP creates per-arch DataSources (e.g. "rhel10-arm64").
On homogeneous clusters DataSources are bare (e.g. "rhel10").

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.

the decision here is based on internal implementation; why should a user pass this flag? why not just check inside this function if the cluster is multiarch?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I kept the multiarch check in pytest_utils because that is where the other instance type matrix setup already reads py_config and add_preference_arch_suffix has to be passed anyway (for centos as exception).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

also they look consistent, decision making for preference and datasource regarding suffix is taken in similar kind of arrangement.

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.

function is os independent now and all os related logic is done in the caller function (generate_instance_type_matrix_dicts).
i believe it's cleaner this way.

just that maybe reduce amount of args here? instead of making new args bool, pass arch name str and drop arch_suffix?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks @vsibirsk , arch_suffix is what to append and the two flags are where to append it. They are independant preference suffixing follows OS and DataSource suffixing follows cluster type. example : centos on multiarch needs arch_suffix for DataSource but add_preference_arch_suffix=False because ClusterPreferences have no arch variant. A single arch str would either need to be passed twice (preference + data_source) or forces os_utils to know about amd64, multiarch and centos again.
so what we do right now i.e One arch_suffix plus two flags avoids both: arch once, policy stays in the caller.

@geetikakay geetikakay Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Basically this approach handles exceptional cases(centos-stream*) well
rhel.10, rhel.10.arm64, rhel.10.s390x ← arch variants exist
fedora, fedora.arm64, fedora.s390x ← arch variants exist
centos.stream10 ← no arch variants (no centos.stream10.arm64)
centos.stream9 ← no arch variants

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.

My understanding is add_preference_arch_suffix and add_data_source_arch_suffix flags are because centos-stream-10 preference does not have any suffix for any architecture, keeping as neutral preference.

Unlike other OSes like rhel9 that has its own preference(e.g. rhel.9.arm, rhel9.arm.s390x, ..) and DataSource (e.g. rhel9-arm, rhel9-s390x, ..), centos-stream-10 does not follow same thumb rule having preference(e.g. centos.stream10 ) and DataSource(e.g. centos-stream9-arm64, centos-stream9-s390x )

So, in someway there is a need to pass add_preference_arch_suffix and add_data_source_arch_suffix to decouple the generation of a customized instance_type_os_matrix for centos-stream-10.

For now it's just centos which has neutral preference, maybe we have more such os in future  then we do not have to change it

In future if we decide to have suffix for preference as we see need to add extra spec for centos based on cpu we could take off this parameter

@alexandermamaniy

Copy link
Copy Markdown
Contributor

/verified
s390x only

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


from utilities.constants import (
ARM_64,
CENTOS_STREAM10_PREFERENCE,

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.

Test Execution Plan

  • Run smoke tests: True — Verified path: tests/infrastructure/instance_types/supported_os/test_rhel_os.py (@pytest.mark.smoke) is parametrized from py_config["instance_type_rhel_os_matrix"] / py_config["instance_type_centos_os_matrix"], populated by generate_instance_type_matrix_dicts → modified generate_linux_instance_type_os_matrix (signature changed: add_arch_suffix replaced by add_preference_arch_suffix + add_data_source_arch_suffix).

  • Run gating tests: False — No gating-marked file references the modified symbols.

Affected tests to run:

  • tests/infrastructure/instance_types/supported_os/test_rhel_os.py (smoke) — parametrized via instance_type_rhel_os_matrix / instance_type_centos_os_matrix; validates correct preference and DataSource name construction per architecture.
  • utilities/unittests/test_os_utils.py::TestGenerateInstanceTypeRhelOsMatrix — unit tests for modified generate_linux_instance_type_os_matrix.
  • utilities/unittests/test_pytest_utils.py::TestGenerateInstanceTypeMatrixDicts — unit tests for updated generate_instance_type_matrix_dicts including new multiarch parametrized cases.

Real tests (cluster required)

Error path (the fix — amd64 multiarch DataSource suffix):

pytest tests/infrastructure/instance_types/supported_os/test_rhel_os.py --collect-only

Expected: matrix entries for multiarch+amd64 show DataSource names like rhel10-amd64, not bare rhel10.

Happy path (regression — homogeneous ARM64 preference suffix):

pytest tests/infrastructure/instance_types/supported_os/test_rhel_os.py -k rhel

Expected: on ARM64 cluster, preferences carry .arm64 suffix; DataSource names are bare (no arch suffix).

Cluster coverage required:

  • Homogeneous ARM64: preference names carry .arm64 suffix; DataSource names are bare.
  • Multiarch: DataSource names carry arch suffix for all architectures; CentOS Stream preferences remain bare.
  • Homogeneous amd64: no arch suffix on preference or DataSource.

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Tip

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
COMMIT=$(gh pr view 5105 --repo RedHatQE/openshift-virtualization-tests --json commits --jq '.commits[-1].oid')
echo "Latest commit: $COMMIT"

# Confirm patch position for tests/global_config_arm64.py
gh api repos/RedHatQE/openshift-virtualization-tests/pulls/5105/files \
  --jq '.[] | select(.filename == "tests/global_config_arm64.py") | {filename: .filename, patch: .patch}'

BODY='**Test Execution Plan**

- **Run smoke tests: True** — Verified path: `tests/infrastructure/instance_types/supported_os/test_rhel_os.py` (`@pytest.mark.smoke`) is parametrized from `py_config["instance_type_rhel_os_matrix"]` / `py_config["instance_type_centos_os_matrix"]`, populated by `generate_instance_type_matrix_dicts` → modified `generate_linux_instance_type_os_matrix` (signature changed: `add_arch_suffix` replaced by `add_preference_arch_suffix` + `add_data_source_arch_suffix`).

- **Run gating tests: False** — No gating-marked file references the modified symbols.

**Affected tests to run:**
- `tests/infrastructure/instance_types/supported_os/test_rhel_os.py` *(smoke)* — parametrized via `instance_type_rhel_os_matrix` / `instance_type_centos_os_matrix`; validates correct preference and DataSource name construction per architecture.
- `utilities/unittests/test_os_utils.py::TestGenerateInstanceTypeRhelOsMatrix` — unit tests for modified `generate_linux_instance_type_os_matrix`.
- `utilities/unittests/test_pytest_utils.py::TestGenerateInstanceTypeMatrixDicts` — unit tests for updated `generate_instance_type_matrix_dicts` including new multiarch parametrized cases.

**Real tests (cluster required)**

Error path (the fix — amd64 multiarch DataSource suffix):

Length of output: 2548


🏁 Script executed:

#!/bin/bash
python3 << 'PYEOF'
import subprocess, json

body = """**Test Execution Plan**

- **Run smoke tests: True** — Verified path: `tests/infrastructure/instance_types/supported_os/test_rhel_os.py` (`@pytest.mark.smoke`) is parametrized from `py_config["instance_type_rhel_os_matrix"]` / `py_config["instance_type_centos_os_matrix"]`, populated by `generate_instance_type_matrix_dicts` → modified `generate_linux_instance_type_os_matrix` (signature changed: `add_arch_suffix` replaced by `add_preference_arch_suffix` + `add_data_source_arch_suffix`).

- **Run gating tests: False** — No gating-marked file references the modified symbols.

**Affected tests to run:**
- `tests/infrastructure/instance_types/supported_os/test_rhel_os.py` *(smoke)* — parametrized via `instance_type_rhel_os_matrix` / `instance_type_centos_os_matrix`; validates correct preference and DataSource name construction per architecture.
- `utilities/unittests/test_os_utils.py::TestGenerateInstanceTypeRhelOsMatrix` — unit tests for modified `generate_linux_instance_type_os_matrix`.
- `utilities/unittests/test_pytest_utils.py::TestGenerateInstanceTypeMatrixDicts` — unit tests for updated `generate_instance_type_matrix_dicts` including new multiarch parametrized cases.

**Real tests (cluster required)**

Error path (the fix — amd64 multiarch DataSource suffix):

Length of output: 1837


🏁 Script executed:

#!/bin/bash
cat > /tmp/review_body.txt << 'ENDBODY'
**Test Execution Plan**

- **Run smoke tests: True** — Verified path: `tests/infrastructure/instance_types/supported_os/test_rhel_os.py` (`@pytest.mark.smoke`) is parametrized from `py_config["instance_type_rhel_os_matrix"]` / `py_config["instance_type_centos_os_matrix"]`, populated by `generate_instance_type_matrix_dicts` → modified `generate_linux_instance_type_os_matrix` (signature changed: `add_arch_suffix` replaced by `add_preference_arch_suffix` + `add_data_source_arch_suffix`).

- **Run gating tests: False** — No gating-marked file references the modified symbols.

**Affected tests to run:**
- `tests/infrastructure/instance_types/supported_os/test_rhel_os.py` *(smoke)* — parametrized via `instance_type_rhel_os_matrix` / `instance_type_centos_os_matrix`; validates correct preference and DataSource name construction per architecture.
- `utilities/unittests/test_os_utils.py::TestGenerateInstanceTypeRhelOsMatrix` — unit tests for modified `generate_linux_instance_type_os_matrix`.
- `utilities/unittests/test_pytest_utils.py::TestGenerateInstanceTypeMatrixDicts` — unit tests for updated `generate_instance_type_matrix_dicts` including new multiarch parametrized cases.

**Real tests (cluster required)**

Error path (the fix — amd64 multiarch DataSource suffix):

    pytest tests/infrastructure/instance_types/supported_os/test_rhel_os.py --collect-only

Expected: matrix entries for multiarch+amd64 show DataSource names like `rhel10-amd64`, not bare `rhel10`.

Happy path (regression — homogeneous ARM64 preference suffix):

    pytest tests/infrastructure/instance_types/supported_os/test_rhel_os.py -k rhel

Expected: on ARM64 cluster, preferences carry `.arm64` suffix; DataSource names are bare (no arch suffix).

**Cluster coverage required:**
- Homogeneous ARM64: preference names carry `.arm64` suffix; DataSource names are bare.
- Multiarch: DataSource names carry arch suffix for all architectures; CentOS Stream preferences remain bare.
- Homogeneous amd64: no arch suffix on preference or DataSource.
ENDBODY

python3 - << 'PYEOF'
import subprocess, json

with open("/tmp/review_body.txt") as f:
    body = f.read()

payload = {
    "commit_id": "2a0536598c920068426eaa47ef9311b20f050345",
    "event": "COMMENT",
    "body": "",
    "comments": [
        {
            "path": "tests/global_config_arm64.py",
            "position": 4,
            "body": body
        }
    ]
}

result = subprocess.run(
    ["gh", "api", "repos/RedHatQE/openshift-virtualization-tests/pulls/5105/reviews",
     "-X", "POST",
     "--input", "-"],
    input=json.dumps(payload).encode(),
    capture_output=True
)
print("STDOUT:", result.stdout.decode()[:500])
print("STDERR:", result.stderr.decode()[:300])
print("Return code:", result.returncode)
PYEOF

Length of output: 3401



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.