Skip to content

set the logout redirect setting within the test body - #20824

Merged
pondrejk merged 1 commit into
SatelliteQE:masterfrom
pondrejk:logout-one-thr
Feb 25, 2026
Merged

set the logout redirect setting within the test body#20824
pondrejk merged 1 commit into
SatelliteQE:masterfrom
pondrejk:logout-one-thr

Conversation

@pondrejk

@pondrejk pondrejk commented Feb 19, 2026

Copy link
Copy Markdown
Contributor

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.

@pondrejk pondrejk self-assigned this Feb 19, 2026
@pondrejk
pondrejk requested a review from a team as a code owner February 19, 2026 09:37
@pondrejk pondrejk added Stream Introduced in or relating directly to Satellite Stream/Master 6.19.z labels Feb 19, 2026
@sourcery-ai

sourcery-ai Bot commented Feb 19, 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 locally within the test, and removes the indirect parametrization that previously modified this setting globally.

File-Level Changes

Change Details Files
Refactor the RH-SSO SSO test to update and restore the login_delegation_logout_url setting within the test instead of using a global, indirect parametrized fixture.
  • Remove the pytest parametrization that indirectly updated the login_delegation_logout_url setting for the test.
  • Adjust the test_single_sign_on_using_rhsso signature to stop depending on the setting_update fixture.
  • Within the test body, fetch the login_delegation_logout_url setting object from the Satellite API and capture its current value.
  • Set login_delegation_logout_url to LOGIN_DELEGATION_LOGOUT_URL before performing the logout flow and asserting the redirect URL.
  • Restore the setting to its original value at the end of the test to avoid side effects on other tests.
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

@pondrejk
pondrejk marked this pull request as draft February 19, 2026 09:37

@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:

  • Consider adding a brief code comment near the @pytest.mark.run_in_one_thread marker explaining why this particular test must be serialized, so future maintainers understand the constraint and are less likely to remove it inadvertently.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider adding a brief code comment near the `@pytest.mark.run_in_one_thread` marker explaining why this particular test must be serialized, so future maintainers understand the constraint and are less likely to remove it inadvertently.

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 pondrejk added the CherryPick PR needs CherryPick to previous branches label Feb 19, 2026
@pondrejk

Copy link
Copy Markdown
Contributor Author

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

1 similar comment
@pondrejk

Copy link
Copy Markdown
Contributor Author

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

@pondrejk
pondrejk marked this pull request as ready for review February 23, 2026 11:56
@pondrejk

Copy link
Copy Markdown
Contributor Author

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

PRT Result

Build Number: 14412
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/destructive/test_ldap_authentication.py -k test_single_sign_on_using_rhsso --external-logging
Test Result : ========== 1 failed, 28 deselected, 14 warnings in 2659.71s (0:44:19) ==========

@Satellite-QE Satellite-QE added the PRT-Failed Indicates that latest PRT run is failed for the PR label Feb 23, 2026
@pondrejk
pondrejk marked this pull request as draft February 23, 2026 15:04
@pondrejk

Copy link
Copy Markdown
Contributor Author

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

@pondrejk pondrejk changed the title run in one thread for logout redirect set the logout redirect setting within the test body Feb 25, 2026
@Satellite-QE

Copy link
Copy Markdown
Collaborator

PRT Result

Build Number: 14474
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 2163.30s (0:36:03) ==========

@Satellite-QE Satellite-QE added PRT-Passed Indicates that latest PRT run is passed for the PR and removed PRT-Failed Indicates that latest PRT run is failed for the PR labels Feb 25, 2026
@pondrejk
pondrejk marked this pull request as ready for review February 25, 2026 15:28

@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 manual save/restore of login_delegation_logout_url would be more robust if wrapped in a try/finally block (or context manager) so the setting is restored even when an assertion or navigation error fails the test.
  • Instead of indexing [0] on module_target_sat.api.Setting().search(...), consider explicitly asserting that exactly one setting is returned or handling the case where no result is found to avoid an opaque index error.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The manual save/restore of `login_delegation_logout_url` would be more robust if wrapped in a `try/finally` block (or context manager) so the setting is restored even when an assertion or navigation error fails the test.
- Instead of indexing `[0]` on `module_target_sat.api.Setting().search(...)`, consider explicitly asserting that exactly one setting is returned or handling the case where no result is found to avoid an opaque index error.

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 pondrejk added the AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing label Feb 25, 2026
@adamlazik1

Copy link
Copy Markdown
Contributor
  • The manual save/restore of login_delegation_logout_url would be more robust if wrapped in a try/finally block (or context manager) so the setting is restored even when an assertion or navigation error fails the test.

This seems like a valid concern.

@Satellite-QE Satellite-QE removed the PRT-Passed Indicates that latest PRT run is passed for the PR label Feb 25, 2026

@adamlazik1 adamlazik1 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.

LGTM

@pondrejk
pondrejk merged commit c18855a into SatelliteQE:master Feb 25, 2026
10 checks passed
github-actions Bot pushed a commit that referenced this pull request Feb 25, 2026
rmynar pushed a commit to rmynar/robottelo that referenced this pull request Apr 29, 2026
Gauravtalreja1 pushed a commit that referenced this pull request May 7, 2026
* check logout redirection (#20718)

(cherry picked from commit 90b1295)

* set the logout redirect setting within the test body (#20824)

---------

Co-authored-by: Peter Ondrejka <pondrejk@users.noreply.github.com>
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 Stream Introduced in or relating directly to Satellite Stream/Master

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants