set the logout redirect setting within the test body - #20824
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdjusts 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
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Consider adding a brief code comment near the
@pytest.mark.run_in_one_threadmarker 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.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
trigger: test-robottelo |
1 similar comment
|
trigger: test-robottelo |
|
trigger: test-robottelo |
|
PRT Result |
39e0745 to
4c06ca7
Compare
|
trigger: test-robottelo |
|
PRT Result |
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The manual save/restore of
login_delegation_logout_urlwould be more robust if wrapped in atry/finallyblock (or context manager) so the setting is restored even when an assertion or navigation error fails the test. - Instead of indexing
[0]onmodule_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.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This seems like a valid concern. |
4c06ca7 to
0e631a2
Compare
(cherry picked from commit c18855a)
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: