Skip to content

[6.19.z] Fix failing errata ui tests - #20897

Closed
Satellite-QE wants to merge 1 commit into
6.19.zfrom
cherry-pick-6.19.z-6e909f9d4799764d265c40902457cb929c59f6d2
Closed

[6.19.z] Fix failing errata ui tests#20897
Satellite-QE wants to merge 1 commit into
6.19.zfrom
cherry-pick-6.19.z-6e909f9d4799764d265c40902457cb929c59f6d2

Conversation

@Satellite-QE

@Satellite-QE Satellite-QE commented Feb 26, 2026

Copy link
Copy Markdown
Collaborator

Cherrypick of PR: #20840

Problem Statement

Some Errata UI tests failing due to content hosts page removal

Solution

Remove/fix parts of test that use content hosts page

Related Issues

https://issues.redhat.com/browse/SAT-42273

PRT test Cases example

trigger: test-robottelo
pytest: tests/foreman/ui/test_errata.py -k "positive_check_errata or positive_content_host_previous_env or positive_errata_search_type or positive_filtered_errata_status_installable_param"

PRT usage reference link: https://github.com/SatelliteQE/robottelo/wiki/Robottelo-Pull-Request-Testing-(PRT)-Process#usage-examples

Summary by Sourcery

Adjust errata UI tests to avoid removed content hosts page and ensure errata applicability is reflected after package installation tasks complete.

Bug Fixes:

  • Remove reliance on the deprecated content hosts page in errata UI tests that caused failures.
  • Ensure errata-related tests wait for and verify bulk applicability generation tasks after yum installs to avoid timing-related failures.

Enhancements:

  • Tag affected errata UI tests with the no_containers marker and standardize timestamp formatting using the shared time format constant.

Summary by Sourcery

Stabilize errata UI tests by ensuring repository metadata and errata applicability are updated and verifiable after package installation.

Bug Fixes:

  • Update errata UI tests to run repository refresh on content hosts after yum installations to prevent stale subscription state from causing failures.
  • Make errata tests wait for and assert the presence of bulk applicability generation tasks after installs to avoid timing-related flakiness.

Enhancements:

  • Standardize errata test timestamps using the shared time format constant for consistent task search filtering.
  • Extend errata search-by-type test to use the Satellite target fixture required for task-based applicability verification.

Tests:

  • Harden multiple errata-related UI tests to rely on task-based applicability confirmation instead of implicit assumptions after package installation.

* fix failing errata tests

* add subscription-manager repo command to fix failing test

* remove no containers mark

* remove no_containers from test_positive_errata_search_type

(cherry picked from commit 6e909f9)
@Satellite-QE Satellite-QE added 6.19.z Auto_Cherry_Picked Automatically cherrypicked PR using GHA No-CherryPick PR doesnt need CherryPick to previous branches labels Feb 26, 2026
@Satellite-QE

Copy link
Copy Markdown
Collaborator Author
trigger: test-robottelo
pytest: tests/foreman/ui/test_errata.py -k "positive_check_errata or positive_content_host_previous_env or positive_errata_search_type or positive_filtered_errata_status_installable_param"

@Satellite-QE Satellite-QE added the AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing label Feb 26, 2026
@sourcery-ai

sourcery-ai Bot commented Feb 26, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Adjust errata UI tests to avoid timing issues and dependencies on removed content hosts functionality by waiting for applicability tasks, standardizing timestamps, and ensuring repos are refreshed after package installs.

File-Level Changes

Change Details Files
Ensure errata applicability updates are triggered and completed after yum package installations before asserting UI state.
  • Capture an install timestamp using the shared TIMESTAMP_FMT right before running yum installs in errata-related tests.
  • Wait for bulk applicability generation tasks on the Satellite using module_target_sat.wait_for_tasks filtered by host and started_at >= install_timestamp.
  • Assert that at least one applicability task is found for the affected host before proceeding with UI validations.
tests/foreman/ui/test_errata.py
Improve robustness of errata UI tests by refreshing repository metadata and extending fixtures used.
  • Run subscription-manager repos after yum install commands to ensure content/repo metadata is fully updated on the client before checking errata in the UI.
  • Add module_target_sat fixture to test_positive_errata_search_type so it can query Satellite tasks.
  • Update existing timestamp logic in test_positive_check_errata_counts_by_type_on_host_details_page and test_positive_filtered_errata_status_installable_param to use TIMESTAMP_FMT rather than raw datetime objects.
tests/foreman/ui/test_errata.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 logic to capture install_timestamp, run yum install/subscription-manager repos, and wait for applicability tasks is repeated across multiple tests; consider extracting this into a shared helper or fixture to reduce duplication and keep the tests easier to maintain.
  • The search_query string for wait_for_tasks (e.g., 'Bulk generate applicability for host {hostname} and started_at >= "{install_timestamp}"') is duplicated and somewhat brittle; introducing a small builder/helper or constant for this query would make future changes less error-prone.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The logic to capture `install_timestamp`, run `yum install`/`subscription-manager repos`, and wait for applicability tasks is repeated across multiple tests; consider extracting this into a shared helper or fixture to reduce duplication and keep the tests easier to maintain.
- The `search_query` string for `wait_for_tasks` (e.g., `'Bulk generate applicability for host {hostname} and started_at >= "{install_timestamp}"'`) is duplicated and somewhat brittle; introducing a small builder/helper or constant for this query would make future changes less error-prone.

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.

@github-actions

Copy link
Copy Markdown

This pull request has not been updated in the past 45 days.

@github-actions github-actions Bot added the Stale Stale issue or Pull Request label Apr 13, 2026
@github-actions

Copy link
Copy Markdown

This pull request is now being closed after stale warnings.

@github-actions github-actions Bot closed this Apr 20, 2026
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 AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing No-CherryPick PR doesnt need CherryPick to previous branches Stale Stale issue or Pull Request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants