Skip to content

Fix virt_who test case to inventory report generation - #20864

Merged
LadislavVasina1 merged 1 commit into
SatelliteQE:masterfrom
jnagare-redhat:virt_who_fix_for_inventory_upload
Feb 27, 2026
Merged

Fix virt_who test case to inventory report generation#20864
LadislavVasina1 merged 1 commit into
SatelliteQE:masterfrom
jnagare-redhat:virt_who_fix_for_inventory_upload

Conversation

@jnagare-redhat

@jnagare-redhat jnagare-redhat commented Feb 25, 2026

Copy link
Copy Markdown
Contributor

Problem Statement

virt who test case test_positive_minimal_report_hypervisor was failing as it was not updated to new inventory report generation mechanism

Solution

Fix virt_who test case to inventory report generation

Related Issues

PRT test Cases example

trigger: test-robottelo
pytest: tests/foreman/virtwho/ui/test_esx_sca.py -k test_positive_minimal_report_hypervisor
theforeman:
    foreman_rh_cloud: 1156

Summary by Sourcery

Bug Fixes:

  • Adjust virt-who minimal hypervisor report test to use the new generate-and-upload job and corresponding report download API.

@sourcery-ai

sourcery-ai Bot commented Feb 25, 2026

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates the virt-who UI test for minimal hypervisor report to align with the new cloud inventory report generation/upload workflow and task naming, including using the new download-only helper.

File-Level Changes

Change Details Files
Align virt-who minimal hypervisor report test with new cloud inventory report generation/upload API and background task name.
  • Use the combined generate-and-upload report helper on the organization cloud inventory session instead of the old generate-only helper.
  • Update the Foreman task search query to look for the new HostInventoryReport background job label instead of the deprecated GenerateReport job label.
  • Use the new download-only report helper when fetching the generated report path instead of the previous generic download helper.
tests/foreman/virtwho/ui/test_esx_sca.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai 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.

Hey - I've left some high level feedback:

  • The hard-coded task label string (ForemanInventoryUpload::Async::HostInventoryReportJob) is brittle given recent renames; consider centralizing it in a helper/constant or querying by a less volatile attribute to avoid future breakages.
  • The wait_for block assumes the first task in the search result ([0]) is the desired one; adding a more specific search filter or validating the result set before indexing would make this more robust.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The hard-coded task label string (`ForemanInventoryUpload::Async::HostInventoryReportJob`) is brittle given recent renames; consider centralizing it in a helper/constant or querying by a less volatile attribute to avoid future breakages.
- The `wait_for` block assumes the first task in the search result (`[0]`) is the desired one; adding a more specific search filter or validating the result set before indexing would make this more robust.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@jnagare-redhat jnagare-redhat added CherryPick PR needs CherryPick to previous branches Auto_Cherry_Picked Automatically cherrypicked PR using GHA Stream Introduced in or relating directly to Satellite Stream/Master 6.19.z labels Feb 25, 2026
@jnagare-redhat

Copy link
Copy Markdown
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/virtwho/ui/test_esx_sca.py -k test_positive_minimal_report_hypervisor
theforeman:
foreman_rh_cloud: 1156

@Satellite-QE

Copy link
Copy Markdown
Collaborator

PRT Result

Build Number: 14452
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/virtwho/ui/test_esx_sca.py -k test_positive_minimal_report_hypervisor --external-logging
Test Result : ========== 1 passed, 17 deselected, 7 warnings in 1383.03s (0:23:03) ===========

@Satellite-QE Satellite-QE added the PRT-Passed Indicates that latest PRT run is passed for the PR label Feb 25, 2026
@LadislavVasina1
LadislavVasina1 merged commit aed2e40 into SatelliteQE:master Feb 27, 2026
13 of 14 checks passed
github-actions Bot pushed a commit that referenced this pull request Feb 27, 2026
jnagare-redhat added a commit that referenced this pull request Mar 2, 2026
Fix virt_who test case to inventory report generation (#20864)

(cherry picked from commit aed2e40)

Co-authored-by: jnagare-redhat <jnagare@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.19.z Auto_Cherry_Picked Automatically cherrypicked PR using GHA CherryPick PR needs CherryPick to previous branches PRT-Passed Indicates that latest PRT run is passed for the PR Stream Introduced in or relating directly to Satellite Stream/Master

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants