Skip to content

update test for enable/disable recommendations (IoP) - #20520

Merged
jnagare-redhat merged 8 commits into
SatelliteQE:masterfrom
ColeHiggins2:update-test-for-enable-disable-iop
Mar 12, 2026
Merged

update test for enable/disable recommendations (IoP)#20520
jnagare-redhat merged 8 commits into
SatelliteQE:masterfrom
ColeHiggins2:update-test-for-enable-disable-iop

Conversation

@ColeHiggins2

@ColeHiggins2 ColeHiggins2 commented Dec 16, 2025

Copy link
Copy Markdown
Member

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 supported RHEL versions.

Enhancements:

  • Adjust RHEL version matching for the IOP recommendations test to use the N-1 selector.

Tests:

  • Change the IOP recommendations test to disable and re-enable a specific recommendation instead of only checking enabled/disabled counts.
  • Update test metadata and verification tags to include the new SAT requirement.

@ColeHiggins2 ColeHiggins2 self-assigned this Dec 16, 2025
@ColeHiggins2 ColeHiggins2 added No-CherryPick PR doesnt need CherryPick to previous branches Stream Introduced in or relating directly to Satellite Stream/Master labels Dec 16, 2025
@ColeHiggins2
ColeHiggins2 marked this pull request as draft December 16, 2025 22:52

@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 there - I've reviewed your changes - here's some feedback:

  • In the final assertion, consider using the existing OPENSSH_RECOMMENDATION constant instead of the hard-coded string 'Decreased security: OpenSSH config permissions' to avoid duplication and keep the test resilient to future text changes.
  • Since you touched the surrounding comment, this is a good place to fix the typo recommnedationsrecommendations for clarity.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In the final assertion, consider using the existing `OPENSSH_RECOMMENDATION` constant instead of the hard-coded string `'Decreased security: OpenSSH config permissions'` to avoid duplication and keep the test resilient to future text changes.
- Since you touched the surrounding comment, this is a good place to fix the typo `recommnedations``recommendations` for clarity.

## Individual Comments

### Comment 1
<location> `tests/foreman/ui/test_rhcloud_iop.py:344-349` </location>
<code_context>

-        # Verify that Disabled recommnedations are 0
+        # Disable recommendation
+        session.recommendationstab.disable_recommendation_for_system(
+            recommendation_name=OPENSSH_RECOMMENDATION, hostname=rhel_insights_vm.hostname
+        )
+        # Verify that the disabled recommendation is filtered
         result = session.recommendationstab.apply_filter("Status", "Disabled")
-        assert 'No recommendations' in result[0]['Name']
+        assert 'Decreased security: OpenSSH config permissions' in result[0]['Name']
</code_context>

<issue_to_address>
**suggestion (testing):** Make the assertion on the disabled recommendations more robust than relying on the first list element

This assertion still assumes the expected recommendation is at `result[0]`. If multiple disabled recommendations are returned or ordering changes, the test may fail or give a false sense of correctness. Instead, assert that at least one item in `result` has the expected name, e.g. `assert any('Decreased security: OpenSSH config permissions' in r['Name'] for r in result)`, and optionally assert `len(result) > 0` to document the expectation that something is returned.
</issue_to_address>

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.

Comment thread tests/foreman/ui/test_rhcloud_iop.py Outdated
Comment on lines +344 to +349
session.recommendationstab.disable_recommendation_for_system(
recommendation_name=OPENSSH_RECOMMENDATION, hostname=rhel_insights_vm.hostname
)
# Verify that the disabled recommendation is filtered
result = session.recommendationstab.apply_filter("Status", "Disabled")
assert 'No recommendations' in result[0]['Name']
assert 'Decreased security: OpenSSH config permissions' in result[0]['Name']

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.

suggestion (testing): Make the assertion on the disabled recommendations more robust than relying on the first list element

This assertion still assumes the expected recommendation is at result[0]. If multiple disabled recommendations are returned or ordering changes, the test may fail or give a false sense of correctness. Instead, assert that at least one item in result has the expected name, e.g. assert any('Decreased security: OpenSSH config permissions' in r['Name'] for r in result), and optionally assert len(result) > 0 to document the expectation that something is returned.

@ColeHiggins2
ColeHiggins2 force-pushed the update-test-for-enable-disable-iop branch from d44222e to c5ff1d7 Compare December 19, 2025 16:40
@ColeHiggins2
ColeHiggins2 marked this pull request as ready for review December 19, 2025 23:05
@ColeHiggins2

Copy link
Copy Markdown
Member Author

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

@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 found 1 issue, and left some high level feedback:

  • The recommendation name 'Decreased security: OpenSSH config permissions' is hard-coded multiple times; consider using the existing OPENSSH_RECOMMENDATION constant (or another shared constant) to avoid duplication and keep the test resilient to name changes.
  • Before indexing result[0] after applying filters, consider asserting that result is not empty to avoid potential index errors if the UI returns no rows.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The recommendation name `'Decreased security: OpenSSH config permissions'` is hard-coded multiple times; consider using the existing `OPENSSH_RECOMMENDATION` constant (or another shared constant) to avoid duplication and keep the test resilient to name changes.
- Before indexing `result[0]` after applying filters, consider asserting that `result` is not empty to avoid potential index errors if the UI returns no rows.

## Individual Comments

### Comment 1
<location> `tests/foreman/ui/test_rhcloud_iop.py:344-345` </location>
<code_context>
-        assert 'No recommendations' in result[0]['Name']
+        assert 'Decreased security: OpenSSH config permissions' in result[0]['Name']
+
+        session.recommendationstab.enable_recommendation(
+            recommendation_name='Decreased security: OpenSSH config permissions'
+        )
+
</code_context>

<issue_to_address>
**suggestion:** Use the same recommendation identifier consistently (e.g. the `OPENSSH_RECOMMENDATION` constant) when enabling/disabling.

The disable path uses `OPENSSH_RECOMMENDATION`, but the enable path uses the raw string `'Decreased security: OpenSSH config permissions'`. If the constant changes, the test could disable one recommendation and try to enable another. Please use `OPENSSH_RECOMMENDATION` consistently (including in assertions), or derive the string from a single shared source.

Suggested implementation:

```python
        # Verify that the disabled recommendation is filtered
        result = session.recommendationstab.apply_filter("Status", "Disabled")
        assert OPENSSH_RECOMMENDATION in result[0]['Name']

```

Search the rest of `tests/foreman/ui/test_rhcloud_iop.py` for any other hard-coded instances of `'Decreased security: OpenSSH config permissions'` and replace them with `OPENSSH_RECOMMENDATION` to keep the identifier consistent everywhere (including any other assertions or enable/disable calls).
</issue_to_address>

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.

@ColeHiggins2

Copy link
Copy Markdown
Member Author

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

3 similar comments
@ColeHiggins2

Copy link
Copy Markdown
Member Author

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

@ColeHiggins2

Copy link
Copy Markdown
Member Author

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

@ColeHiggins2

Copy link
Copy Markdown
Member Author

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

@ColeHiggins2
ColeHiggins2 marked this pull request as draft January 14, 2026 18:46
@ColeHiggins2

Copy link
Copy Markdown
Member Author

moving to draft state until we get updated images in stage

@jnagare-redhat

Copy link
Copy Markdown
Contributor

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

1 similar comment
@ColeHiggins2

Copy link
Copy Markdown
Member Author

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

@ColeHiggins2
ColeHiggins2 force-pushed the update-test-for-enable-disable-iop branch from 8cbf806 to b660a46 Compare February 11, 2026 20:03
@ColeHiggins2

Copy link
Copy Markdown
Member Author

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

@ColeHiggins2

Copy link
Copy Markdown
Member Author

trigger: test-robottelo
airgun: 2247
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'

3 similar comments
@ColeHiggins2

Copy link
Copy Markdown
Member Author

trigger: test-robottelo
airgun: 2247
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'

@ColeHiggins2

Copy link
Copy Markdown
Member Author

trigger: test-robottelo
airgun: 2247
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'

@ColeHiggins2

Copy link
Copy Markdown
Member Author

trigger: test-robottelo
airgun: 2247
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'

@ColeHiggins2 ColeHiggins2 added CherryPick PR needs CherryPick to previous branches AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing 6.19.z and removed No-CherryPick PR doesnt need CherryPick to previous branches labels Feb 16, 2026
@ColeHiggins2

Copy link
Copy Markdown
Member Author

trigger: test-robottelo
airgun: 2247
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'

1 similar comment
@ColeHiggins2

Copy link
Copy Markdown
Member Author

trigger: test-robottelo
airgun: 2247
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'

@ColeHiggins2
ColeHiggins2 force-pushed the update-test-for-enable-disable-iop branch from 37a5bbb to 79e6291 Compare February 19, 2026 20:14
@ColeHiggins2
ColeHiggins2 marked this pull request as ready for review February 19, 2026 20:20
@sourcery-ai

sourcery-ai Bot commented Feb 19, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Updates the IOP recommendations UI test to validate enabling/disabling a specific recommendation, adjusts the RHEL version marker, and aligns test metadata and expectations with the new behavior.

File-Level Changes

Change Details Files
Repurpose the IOP recommendations test to cover disabling and re-enabling a specific recommendation instead of only counting enabled/disabled items.
  • Change rhel_ver_match marker from a regex for excluding RHEL 7/8 to the shorthand 'N-1' marker
  • Update the test docstring steps and expected results to describe disabling and re-enabling a recommendation instead of checking counts of enabled/disabled recommendations
  • Include SAT-38139 in the :Verifies: metadata and remove :CaseImportance:
  • Replace checks that count enabled/disabled recommendations with UI actions that disable the target recommendation, filter by Disabled status, then re-enable it and confirm it appears enabled by name
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 recommendation name is sometimes taken from OPENSSH_RECOMMENDATION and sometimes hardcoded as 'Decreased security: OpenSSH config permissions'; consider using a single source (e.g., the constant) for the name in disable_recommendation, enable_recommendation, and assertions to avoid drift if the text changes.
  • After re-enabling the recommendation, the initial apply_filter("Status", "Enabled") call is not used and is immediately followed by another apply_filter; either assert on the first result or remove it (or add a clarifying comment) if it is only needed to reset filters.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The recommendation name is sometimes taken from `OPENSSH_RECOMMENDATION` and sometimes hardcoded as `'Decreased security: OpenSSH config permissions'`; consider using a single source (e.g., the constant) for the name in `disable_recommendation`, `enable_recommendation`, and assertions to avoid drift if the text changes.
- After re-enabling the recommendation, the initial `apply_filter("Status", "Enabled")` call is not used and is immediately followed by another `apply_filter`; either assert on the first result or remove it (or add a clarifying comment) if it is only needed to reset filters.

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.

@ColeHiggins2
ColeHiggins2 force-pushed the update-test-for-enable-disable-iop branch from 79e6291 to 531146d Compare February 25, 2026 20:00
@LadislavVasina1

Copy link
Copy Markdown
Contributor
trigger: test-robottelo
pytest: tests/foreman/ui/test_rhcloud_iop.py
airgun: 2247

@Satellite-QE

Copy link
Copy Markdown
Collaborator

PRT Result

Build Number: 14486
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/ui/test_rhcloud_iop.py --external-logging
Test Result : =========== 1 failed, 13 passed, 148 warnings in 12357.76s (3:25:57) ===========

@Satellite-QE Satellite-QE added the PRT-Failed Indicates that latest PRT run is failed for the PR label Feb 26, 2026
@LadislavVasina1

Copy link
Copy Markdown
Contributor

Only 1 test test_iop_recommendations_remediation_type_and_status[rhel10-ipv4-local] failed with:

selenium.common.exceptions.NoSuchElementException: Message: Could not find an element Locator(by='xpath', locator='.//*[contains(@data-ouia-component-type,"Dropdown") and @data-ouia-component-id="actions"]'); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception

@ColeHiggins2
ColeHiggins2 force-pushed the update-test-for-enable-disable-iop branch from 531146d to 124ab14 Compare March 3, 2026 21:03
@LadislavVasina1

Copy link
Copy Markdown
Contributor
trigger: test-robottelo
pytest: tests/foreman/ui/test_rhcloud_iop.py
airgun: 2247

@Satellite-QE

Copy link
Copy Markdown
Collaborator

PRT Result

Build Number: 14594
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/ui/test_rhcloud_iop.py --external-logging
Test Result : =========== 4 failed, 10 passed, 134 warnings in 8357.34s (2:19:17) ============

@jeremylenz jeremylenz changed the title update test for enable disable iop update test for enable/disable recommendations (IoP) Mar 4, 2026
@jeremylenz

Copy link
Copy Markdown
Contributor

The PR is not about disable/enable IoP itself. I changed the PR title 😇

@ColeHiggins2

Copy link
Copy Markdown
Member Author

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

@ColeHiggins2

Copy link
Copy Markdown
Member Author

 colehiggins  (e) robo312  ~  projects  robottelo  2  pytest tests/foreman/ui/test_rhcloud_iop.py::test_iop_recommendations_remediation_type_and_status
============================================================================================================== test session starts ==============================================================================================================
collected 1 item

tests/foreman/ui/test_rhcloud_iop.py .
=================================================================================================== 1 passed, 7 warnings in 619.58s (0:10:19) ===================================================================================================

@ColeHiggins2

Copy link
Copy Markdown
Member Author

Test passing locally, Going to ask that we merge it in since PRT is failing but passing in jenkins

@jnagare-redhat
jnagare-redhat merged commit 0b9ef3c into SatelliteQE:master Mar 12, 2026
9 of 10 checks passed
github-actions Bot pushed a commit that referenced this pull request Mar 12, 2026
* 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 added a commit to ColeHiggins2/robottelo that referenced this pull request Mar 16, 2026
* 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 added a commit that referenced this pull request Jun 5, 2026
* 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.19.z AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing CherryPick PR needs CherryPick to previous branches PRT-Failed Indicates that latest PRT run is failed 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