Skip to content

[6.19.z] update test for enable/disable recommendations (IoP) - #21006

Closed
Satellite-QE wants to merge 2 commits into
6.19.zfrom
cherry-pick-6.19.z-0b9ef3c7985ea87f8fbe6a6e2824edc514b2312e
Closed

[6.19.z] update test for enable/disable recommendations (IoP)#21006
Satellite-QE wants to merge 2 commits into
6.19.zfrom
cherry-pick-6.19.z-0b9ef3c7985ea87f8fbe6a6e2824edc514b2312e

Conversation

@Satellite-QE

@Satellite-QE Satellite-QE commented Mar 12, 2026

Copy link
Copy Markdown
Collaborator

Cherrypick of PR: #20520

Test for disabling/enabling recommendations on IOP.
SAT-38139
SatelliteQE/airgun#2247

Summary by Sourcery

Update IOP recommendations UI test to validate disabling and re-enabling a specific recommendation on RHEL 10.

Tests:

  • Adjust IOP recommendations remediation test to cover disabling and re-enabling a specific recommendation instead of counting enabled/disabled items.
  • Restrict the IOP recommendations test to run on RHEL 10 and update metadata to reference SAT-38139.

@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 Mar 12, 2026
@Satellite-QE

Copy link
Copy Markdown
Collaborator Author

trigger: test-robottelo
airgun: 2247
pytest: tests/foreman/ui/test_rhcloud_iop.py -k "test_iop_recommendations_remediation_type_and_status"

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

sourcery-ai Bot commented Mar 12, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Updates the IOP recommendations UI test to target RHEL 10 only and to explicitly disable and re-enable a specific recommendation, validating its status transitions and new SAT requirement coverage.

File-Level Changes

Change Details Files
Refine the IOP recommendations test flow to validate disabling and re-enabling a specific recommendation instead of only asserting counts of enabled/disabled recommendations.
  • Update the test docstring steps and expected results to describe disabling and re-enabling the specific OpenSSH recommendation rather than generic status count checks.
  • Change the verification metadata to include SAT-38139 alongside the existing SAT-32566.
  • After confirming the recommendation exists and has remediation type 'Playbook', call disable_recommendation with OPENSSH_RECOMMENDATION and assert it appears when filtering by Status='Disabled'.
  • Call enable_recommendation for the specific recommendation name, then filter by Status='Enabled' and search by recommendation name to assert it is enabled again.
tests/foreman/ui/test_rhcloud_iop.py
Adjust test RHEL version targeting for the IOP recommendations test.
  • Change the rhel_ver_match marker from a negative-regex excluding 7 and 8 to a simple '10' selector so the test runs only on RHEL 10.
tests/foreman/ui/test_rhcloud_iop.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 test now mixes the OPENSSH_RECOMMENDATION constant with hard-coded string values like 'Decreased security: OpenSSH config permissions'; consider using the constant (or another shared constant) consistently to avoid brittle string coupling.
  • The RHEL version marker was changed from a regex to the literal '10', which seems less future-proof than the described N-1 selector; consider keeping a pattern-based selector so the test doesn't need updating for each new major RHEL release.
  • After re-enabling the recommendation you call apply_filter('Status', 'Enabled') but ignore its result; wiring this into the subsequent assertions (or asserting on the status directly) would make the test intent clearer and avoid dead code.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The test now mixes the OPENSSH_RECOMMENDATION constant with hard-coded string values like 'Decreased security: OpenSSH config permissions'; consider using the constant (or another shared constant) consistently to avoid brittle string coupling.
- The RHEL version marker was changed from a regex to the literal '10', which seems less future-proof than the described N-1 selector; consider keeping a pattern-based selector so the test doesn't need updating for each new major RHEL release.
- After re-enabling the recommendation you call apply_filter('Status', 'Enabled') but ignore its result; wiring this into the subsequent assertions (or asserting on the status directly) would make the test intent clearer and avoid dead code.

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.

@LadislavVasina1

Copy link
Copy Markdown
Contributor
trigger: test-robottelo
airgun: 2335
pytest: tests/foreman/ui/test_rhcloud_iop.py -k "test_iop_recommendations_remediation_type_and_status"

@ColeHiggins2

Copy link
Copy Markdown
Member

trigger: test-robottelo
airgun: 2335
pytest: tests/foreman/ui/test_rhcloud_iop.py -k "test_iop_recommendations_remediation_type_and_status"
env:
ROBOTTELO_rh_cloud__iop_advisor_engine__image_paths__core_engine: 'quay.io/iop/insights-engine:foreman-3.18'
ROBOTTELO_rh_cloud__iop_advisor_engine__image_paths__core_gateway: 'quay.io/iop/gateway:foreman-3.18'
ROBOTTELO_rh_cloud__iop_advisor_engine__image_paths__core_host_inventory: 'quay.io/iop/host-inventory:foreman-3.18'
ROBOTTELO_rh_cloud__iop_advisor_engine__image_paths__core_host_inventory_frontend: 'quay.io/iop/host-inventory-frontend:foreman-3.18'
ROBOTTELO_rh_cloud__iop_advisor_engine__image_paths__core_ingress: 'quay.io/iop/ingress:foreman-3.18'
ROBOTTELO_rh_cloud__iop_advisor_engine__image_paths__core_kafka: 'quay.io/strimzi/kafka:latest-kafka-3.7.1'
ROBOTTELO_rh_cloud__iop_advisor_engine__image_paths__core_puptoo: 'quay.io/iop/puptoo:foreman-3.18'
ROBOTTELO_rh_cloud__iop_advisor_engine__image_paths__core_yuptoo: 'quay.io/iop/yuptoo:foreman-3.18'
ROBOTTELO_rh_cloud__iop_advisor_engine__image_paths__service_advisor: 'quay.io/iop/advisor-backend:foreman-3.18'
ROBOTTELO_rh_cloud__iop_advisor_engine__image_paths__service_advisor_frontend: 'quay.io/iop/advisor-frontend:foreman-3.18'
ROBOTTELO_rh_cloud__iop_advisor_engine__image_paths__service_remediations: 'quay.io/iop/remediations:foreman-3.18'
ROBOTTELO_rh_cloud__iop_advisor_engine__image_paths__service_vmaas: 'quay.io/iop/vmaas:foreman-3.18'
ROBOTTELO_rh_cloud__iop_advisor_engine__image_paths__service_vulnerability: 'quay.io/iop/vulnerability-engine:foreman-3.18'
ROBOTTELO_rh_cloud__iop_advisor_engine__image_paths__service_vulnerability_frontend: 'quay.io/iop/vulnerability-frontend:foreman-3.18'

@Gauravtalreja1

Copy link
Copy Markdown
Member

@ColeHiggins2 Could you resolve the merge conflicts on this PR?

@JacobCallahan

Copy link
Copy Markdown
Member

Hey @ColeHiggins2, this cherry-pick PR has merge conflicts that need to be resolved before it can be merged. Could you take a look?

* update test for enable disable iop

* Fix failing tests and fixture

* pre-commit

* update pytest marker

* add enable functionality to iop

* update pytest marker

* update test with new entity

* update to rhel 10 for recommendations

(cherry picked from commit 0b9ef3c)
@ColeHiggins2
ColeHiggins2 force-pushed the cherry-pick-6.19.z-0b9ef3c7985ea87f8fbe6a6e2824edc514b2312e branch from f74551a to 2402337 Compare June 5, 2026 02:40
@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 Jul 20, 2026
@github-actions

Copy link
Copy Markdown

This pull request is now being closed after stale warnings.

@github-actions github-actions Bot closed this Jul 27, 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.

5 participants