test: support an external proxy#266
Open
richm wants to merge 1 commit intolinux-system-roles:mainfrom
Open
Conversation
Reviewer's GuideAdds support for using an externally specified HTTP(S) proxy during tests by parsing the SR_RHC_EXTERNAL_PROXY environment variable into a structured fact and wiring it through all role invocations, plus small fixes to test assertions and proxy-related test flow. 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:
- The
SR_RHC_EXTERNAL_PROXYenvironment variable is looked up and its length checked multiple times (including inside the block and again in the finalset_fact); consider centralizing this into a single fact or variable to avoid redundant lookups and make the control flow easier to follow. - The
lineinfiletask that addshttp_proxy/https_proxyto/root/.bashrcdoes not constrain matches with aregexp, so reruns can create duplicate export lines; consider using aregexpto update existing lines in place and keep the file idempotent.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `SR_RHC_EXTERNAL_PROXY` environment variable is looked up and its length checked multiple times (including inside the block and again in the final `set_fact`); consider centralizing this into a single fact or variable to avoid redundant lookups and make the control flow easier to follow.
- The `lineinfile` task that adds `http_proxy`/`https_proxy` to `/root/.bashrc` does not constrain matches with a `regexp`, so reruns can create duplicate export lines; consider using a `regexp` to update existing lines in place and keep the file idempotent.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
71c4a2c to
46a0bb7
Compare
Contributor
Author
|
[citest] |
46a0bb7 to
d946be8
Compare
Contributor
Author
|
[citest] |
This PR allows to specify an external global proxy for testing purposes. The format of `SR_RHC_EXTERNAL_PROXY` is scheme://hostname.port e.g. `http://my.hostname.com:3128` Signed-off-by: Rich Megginson <rmeggins@redhat.com>
d946be8 to
19927f6
Compare
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.
This PR allows to specify an external global proxy for testing purposes.
The format of
SR_RHC_EXTERNAL_PROXYis scheme://hostname.port e.g.http://my.hostname.com:3128Signed-off-by: Rich Megginson rmeggins@redhat.com
Summary by Sourcery
Add support in the test playbooks for using an externally provided proxy via environment configuration.
New Features:
Enhancements: