[6.19.z] docs links test improvements - #20876
Merged
Merged
Conversation
Contributor
Author
|
trigger: test-robottelo |
Collaborator
|
PRT Result |
Contributor
Reviewer's GuideRefactors the documentation links E2E test to be page-parametrized, reuse a shared UI session per module, and simplify Non-GA documentation URL handling by removing the explicit html-single redirect logic while preserving link validation behavior. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- The
sessionfixture name is quite generic and can be confused withrequests.Sessionor pytest internals; consider renaming it to something more specific likeui_sessionto make call sites clearer and avoid accidental shadowing.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `session` fixture name is quite generic and can be confused with `requests.Session` or pytest internals; consider renaming it to something more specific like `ui_session` to make call sites clearer and avoid accidental shadowing.
## Individual Comments
### Comment 1
<location path="tests/foreman/ui/test_documentation_links.py" line_range="96-98" />
<code_context>
- 'https://docs.redhat.com', settings.robottelo.stage_docs_url
- )
- link = link.replace('html', 'html-single')
- if requests.get(link, verify=False).status_code != 200:
- pages_with_broken_links[page].append(link)
- logger.info(f"Following link on {page} page seems broken: \n {link}")
- assert not pages_with_broken_links, (
- f"There are Satellite pages with broken documentation links. \n {print(pages_with_broken_links)}"
</code_context>
<issue_to_address>
**suggestion (testing):** Add a timeout to `requests.get` calls to reduce flakiness and hanging tests
This test now performs one `requests.get` per link and page, so if the docs host is slow or unresponsive, the test can hang and become flaky. Please add a bounded timeout (e.g. `timeout=10`) to these calls so the test fails quickly and predictably when docs are unavailable, without changing its functional intent.
Suggested implementation:
```python
if requests.get(link, verify=False, timeout=10).status_code != 200:
```
If there are other `requests.get` calls in this test file (or related documentation-link tests) that perform similar external checks, you may want to add `timeout=10` to those as well for consistency and to avoid other potential hangs.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
pondrejk
approved these changes
Mar 2, 2026
pondrejk
enabled auto-merge (squash)
March 3, 2026 09:01
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cherrypick of #20797 into 6.19 branch - I am creating this pull request ahead of merging the initial PR in order to trigger PRT tests that cannot pass on the original branch because the documentation for version 6.20(stream) does not yet exist.
Improvements to test_positive_documentation_links:
Summary by Sourcery
Tests: