Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change TestNewAPIClientFromFlagsWithHttpProxyEnv to an e2e test #3221

Merged
merged 1 commit into from
Jul 29, 2021

Conversation

thaJeztah
Copy link
Member

relates to #3197

Golang uses a sync.Once when determining the proxy to use. This means
that it's not possible to test the proxy configuration in unit tests,
because the proxy configuration will be "fixated" the first time Golang
detects the proxy configuration.

This patch changes TestNewAPIClientFromFlagsWithHttpProxyEnv to an e2e
test, so that we can verify the CLI picks up the proxy configuration.

@thaJeztah thaJeztah added this to the 21.xx milestone Jul 28, 2021
@thaJeztah thaJeztah force-pushed the move_proxy_test_to_e2e branch 2 times, most recently from f7c0643 to 0019cda Compare July 28, 2021 16:25
@codecov-commenter
Copy link

codecov-commenter commented Jul 28, 2021

Codecov Report

Merging #3221 (0019cda) into master (d9cdbb0) will not change coverage.
The diff coverage is n/a.

❗ Current head 0019cda differs from pull request most recent head 40c6b11. Consider uploading reports for the commit 40c6b11 to get more accurate results

@@           Coverage Diff           @@
##           master    #3221   +/-   ##
=======================================
  Coverage   58.58%   58.58%           
=======================================
  Files         299      299           
  Lines       21502    21502           
=======================================
  Hits        12597    12597           
  Misses       7983     7983           
  Partials      922      922           

@thaJeztah
Copy link
Member Author

@StefanScherer @silvin-lubecki ptal

Golang uses a `sync.Once` when determining the proxy to use. This means
that it's not possible to test the proxy configuration in unit tests,
because the proxy configuration will be "fixated" the first time Golang
detects the proxy configuration.

This patch changes TestNewAPIClientFromFlagsWithHttpProxyEnv to an e2e
test so that we can verify the CLI picks up the proxy configuration.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah force-pushed the move_proxy_test_to_e2e branch from 0019cda to 40c6b11 Compare July 28, 2021 20:33
Copy link
Contributor

@silvin-lubecki silvin-lubecki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@StefanScherer StefanScherer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants