Skip to content

[6.19.z] set the logout redirect setting within the test body - #20874

Merged
Satellite-QE merged 1 commit into
6.19.zfrom
cherry-pick-6.19.z-c18855ae72f65214917e8c4b2fa7d51fbffeba96
Feb 25, 2026
Merged

[6.19.z] set the logout redirect setting within the test body#20874
Satellite-QE merged 1 commit into
6.19.zfrom
cherry-pick-6.19.z-c18855ae72f65214917e8c4b2fa7d51fbffeba96

Conversation

@Satellite-QE

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

Copy link
Copy Markdown
Collaborator

Cherrypick of PR: #20824

Problem Statement

continuation from #20718, it seems that other test tend to override the global setting for the altered test, so it passes when run in isolation but not in batch session in with other tests -- edit: the issue was actually in fixture precedence

Solution

setting is now changed in test body

Related Issues

Summary by Sourcery

Tests:

  • Mark the LDAP logout redirect test to run in a single thread to avoid concurrency-related interference.

Summary by Sourcery

Tests:

  • Adjust the RH-SSO single sign-on LDAP test to set the login_delegation_logout_url setting in the test body and clean it up to avoid cross-test interference.

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

Copy link
Copy Markdown
Collaborator Author

trigger: test-robottelo
pytest: tests/foreman/destructive/test_ldap_authentication.py -k test_single_sign_on_using_rhsso

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

sourcery-ai Bot commented Feb 25, 2026

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

Reviewer's Guide

Adjusts the RH-SSO single sign-on LDAP test to manage the logout redirect setting within the test body instead of via a parametrized fixture, ensuring isolation and proper cleanup of the global setting.

File-Level Changes

Change Details Files
Manage the login_delegation_logout_url setting inside the RH-SSO SSO test for better isolation and cleanup.
  • Remove parametrization over a setting_update fixture for configuring the logout redirect URL.
  • Update the test signature to drop the now-unused setting_update parameter.
  • Fetch the login_delegation_logout_url Setting object via the API at runtime and capture its prior value.
  • Set the setting to LOGIN_DELEGATION_LOGOUT_URL before performing logout and redirect assertions.
  • Wrap the logout and assertion logic in a try/finally to restore the original setting value after the test completes.
tests/foreman/destructive/test_ldap_authentication.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:

  • When fetching the login_delegation_logout_url setting, consider handling the case where search(...)[0] returns an empty list (e.g., by asserting the result is non-empty or raising a clear error) to avoid a bare IndexError if the setting is missing or renamed.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- When fetching the `login_delegation_logout_url` setting, consider handling the case where `search(...)[0]` returns an empty list (e.g., by asserting the result is non-empty or raising a clear error) to avoid a bare `IndexError` if the setting is missing or renamed.

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.

@pondrejk

Copy link
Copy Markdown
Contributor

trigger: test-robottelo
pytest: tests/foreman/destructive/test_ldap_authentication.py -k test_single_sign_on_using_rhsso

@Satellite-QE

Copy link
Copy Markdown
Collaborator Author

PRT Result

Build Number: 14480
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/destructive/test_ldap_authentication.py -k test_single_sign_on_using_rhsso --external-logging
Test Result : ========== 1 passed, 28 deselected, 10 warnings in 1843.61s (0:30:43) ==========

@Satellite-QE Satellite-QE added the PRT-Passed Indicates that latest PRT run is passed for the PR label Feb 25, 2026
@Satellite-QE
Satellite-QE merged commit 00af017 into 6.19.z Feb 25, 2026
22 of 24 checks passed
@Satellite-QE
Satellite-QE deleted the cherry-pick-6.19.z-c18855ae72f65214917e8c4b2fa7d51fbffeba96 branch February 25, 2026 17:52
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 PRT-Passed Indicates that latest PRT run is passed for the PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants