Skip to content

change TestNewAPIClientFromFlagsWithHttpProxyEnv to an e2e test - #3221

Merged
StefanScherer merged 1 commit into
docker:masterfrom
thaJeztah:move_proxy_test_to_e2e
Jul 29, 2021
Merged

StefanScherer merged 1 commit into
docker:masterfrom
thaJeztah:move_proxy_test_to_e2e

Conversation

@thaJeztah

Copy link
Copy Markdown
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

codecov-commenter commented Jul 28, 2021 •

Copy link
Copy Markdown

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
Copy Markdown
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 <github@gone.nl>
@thaJeztah
thaJeztah force-pushed the move_proxy_test_to_e2e branch from 0019cda to 40c6b11 Compare July 28, 2021 20:33

@silvin-lubecki silvin-lubecki 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

@StefanScherer StefanScherer left a comment

Copy link
Copy Markdown
Member

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