Skip to content

WIP: infra: align tests to fit multiarch needs #4788

Open
geetikakay wants to merge 3 commits intoRedHatQE:mainfrom
geetikakay:multiarch
Open

WIP: infra: align tests to fit multiarch needs #4788
geetikakay wants to merge 3 commits intoRedHatQE:mainfrom
geetikakay:multiarch

Conversation

@geetikakay
Copy link
Copy Markdown
Contributor

@geetikakay geetikakay commented May 8, 2026

Update multiarch matrix generation so preference and DataSource names match architecture-specific cluster naming for RHEL, Fedora, and CentOS.

Short description:
More details:
What this PR does / why we need it:
Which issue(s) this PR fixes:
Special notes for reviewer:

rrmngmnt's package manager auto-detection uses which to find the package manager binary which is not available in centos-stream10 and hence some of tests didn't work. 8e0f430 is to fix it.

jira-ticket:

Summary by CodeRabbit

  • New Features

    • Extended support for ARM_64 architecture with CentOS Stream 10 preference configuration
    • Enhanced architecture preference handling to provide more flexible configuration options
  • Bug Fixes

    • Improved QEMU guest agent presence detection methodology
  • Tests

    • Expanded test coverage for instance-type OS matrix generation with parametrized test cases
    • Added validation for architecture-specific configurations and preference handling

geetikakay added 3 commits May 8, 2026 11:12
Update multiarch matrix generation so preference and DataSource names match architecture-specific cluster naming for RHEL, Fedora, and CentOS.

Signed-off-by: Geetika Kapoor <gkapoor@redhat.com>
Assisted-by: Cursor
Replace package-manager helper lookup with an explicit rpm query so guest-agent presence checks are consistent across environments.

Signed-off-by: Geetika Kapoor <gkapoor@redhat.com>
Add and refactor unit tests to validate arch suffix handling and DataSource naming, and align new test inputs with existing constants.

Signed-off-by: Geetika Kapoor <gkapoor@redhat.com>
Assisted-by: Cursor
@geetikakay
Copy link
Copy Markdown
Contributor Author

geetikakay commented May 8, 2026

/wip
testing across different env

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 8, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

This PR extends instance-type OS matrix generation with conditional architecture suffix handling via a new arch_in_preference parameter, updates call sites and tests to leverage the parameter, adds CentOS Stream 10 support for ARM architectures, and improves QEMU guest agent detection logic.

Changes

Architecture Preference Suffix Control

Layer / File(s) Summary
Function Signature & Contract
utilities/os_utils.py
generate_linux_instance_type_os_matrix() adds arch_in_preference: bool = True parameter; docstring updated to document conditional architecture suffix application.
Preference String Construction
utilities/os_utils.py
PREFERENCE_STR now conditionally appends .{arch_suffix} based on arch_in_preference; DATA_SOURCE_NAME always incorporates arch_suffix when provided.
Integration with pytest_utils
utilities/pytest_utils.py
Computes arch_in_preference = (cpu_arch != AMD_64) for RHEL and Fedora; CentOS switches to arch_suffix=cpu_arch with arch_in_preference=False.
Global Configuration
tests/global_config_multiarch.py
Adds CENTOS_STREAM10_PREFERENCE to instance_type_centos_os_list for ARM_64 architecture.
Unit Test Coverage
utilities/unittests/test_os_utils.py
Three new test methods validate suffix application/omission behavior and DATA_SOURCE_NAME consistency across arch_in_preference states.
Integration Test Refactoring
utilities/unittests/test_pytest_utils.py
RHEL tests consolidated into parametrized test over cpu_arch variants; Fedora/CentOS tests refactored into parametrized test covering expected call signatures and config outputs; hard-coded strings replaced with imported preference constants; removed redundant CentOS non-s390x test.

QEMU Guest Agent Detection

Layer / File(s) Summary
Host Agent Detection
utilities/virt.py
check_qemu_guest_agent_installed() now executes rpm -q qemu-guest-agent and returns True when exit code is 0, replacing package-manager existence check.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description includes a short summary at the top covering the main change. However, most required template sections (More details, What this PR does/why, Which issue fixes) are empty or minimally filled. Fill in 'More details' and 'What this PR does / why we need it' sections to explain the multiarch matrix changes and their purpose more thoroughly.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'WIP: infra: align tests to fit multiarch needs' directly aligns with the main change: updating multiarch matrix generation and tests to handle architecture-specific naming.
Docstring Coverage ✅ Passed Docstring coverage is 84.62% which is sufficient. The required threshold is 80.00%.
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.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

❤️ Share

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

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

Report bugs in Issues

Welcome! 🎉

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

🔄 Automatic Actions

  • Reviewer Assignment: Reviewers are automatically assigned based on the OWNERS file in the repository root
  • Size Labeling: PR size labels (XS, S, M, L, XL, XXL) are automatically applied based on changes
  • Issue Creation: A tracking issue is created for this PR and will be closed when the PR is merged or closed
  • 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
Copy link
Copy Markdown

codecov Bot commented May 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.67%. Comparing base (b4ad2e0) to head (6fc4ebc).
⚠️ Report is 140 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4788      +/-   ##
==========================================
+ Coverage   98.63%   98.67%   +0.03%     
==========================================
  Files          25       25              
  Lines        2420     2487      +67     
==========================================
+ Hits         2387     2454      +67     
  Misses         33       33              
Flag Coverage Δ
utilities 98.67% <100.00%> (+0.03%) ⬆️

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

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

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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

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

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

1-1: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

HIGH: Restore required PR template sections in the PR description.

The PR description is missing required template headers. Please add:

  • ##### What this PR does / why we need it: (must contain meaningful content)
  • ##### Which issue(s) this PR fixes:
  • ##### Special notes for reviewer:
  • ##### jira-ticket:

As per coding guidelines: “Required sections (must be present, even if empty) … What this PR does / why we need it: — MUST be present AND have meaningful content … If any required section is absent … flag it as HIGH severity.”

🤖 Prompt for 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.

In `@utilities/virt.py` at line 1, The PR description is missing required template
headers; edit the PR description (not the code) to restore the sections: add a
meaningful paragraph under "##### What this PR does / why we need it:", add
"##### Which issue(s) this PR fixes:", add "##### Special notes for reviewer:",
and add "##### jira-ticket:" with the ticket ID (or N/A) so the PR complies with
guidelines; reference this PR that touches utilities/virt.py (e.g., where the
change is the import line "from __future__ import annotations") to ensure the
description clearly explains why that change was made and links to the related
issue/jira.
🤖 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/os_utils.py`:
- Around line 257-262: The function generate_linux_instance_type_os_matrix
currently has a boolean parameter arch_in_preference that should be keyword-only
to satisfy Ruff FBT001/FBT002; update the function signature for
generate_linux_instance_type_os_matrix by inserting a bare * before arch_suffix
(or before arch_in_preference) so arch_in_preference becomes keyword-only,
leaving all other logic unchanged and ensuring existing call sites that already
pass arch_in_preference by keyword continue to work.

---

Outside diff comments:
In `@utilities/virt.py`:
- Line 1: The PR description is missing required template headers; edit the PR
description (not the code) to restore the sections: add a meaningful paragraph
under "##### What this PR does / why we need it:", add "##### Which issue(s)
this PR fixes:", add "##### Special notes for reviewer:", and add "#####
jira-ticket:" with the ticket ID (or N/A) so the PR complies with guidelines;
reference this PR that touches utilities/virt.py (e.g., where the change is the
import line "from __future__ import annotations") to ensure the description
clearly explains why that change was made and links to the related issue/jira.
🪄 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: e8c017d4-00dc-4654-bc96-58fd0a2b862f

📥 Commits

Reviewing files that changed from the base of the PR and between 37989ad and 6fc4ebc.

📒 Files selected for processing (6)
  • tests/global_config_multiarch.py
  • utilities/os_utils.py
  • utilities/pytest_utils.py
  • utilities/unittests/test_os_utils.py
  • utilities/unittests/test_pytest_utils.py
  • utilities/virt.py

Comment thread utilities/os_utils.py
@geetikakay
Copy link
Copy Markdown
Contributor Author

/build-and-push-container

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants