-
Notifications
You must be signed in to change notification settings - Fork 10.3k
test: Enable mocking http provider sources in tests #38206
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
Changes from all commits
e3b53a0
cccc1d5
280dec8
19dbd3f
f33fdab
599f483
912da62
90acaad
afe30aa
4a58b79
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,6 +30,7 @@ func installFromHTTPURL(ctx context.Context, meta getproviders.PackageMeta, targ | |
| // When we're installing from an HTTP URL we expect the URL to refer to | ||
| // a zip file. We'll fetch that into a temporary file here and then | ||
| // delegate to installFromLocalArchive below to actually extract it. | ||
|
|
||
| httpGetter := getter.HttpGetter{ | ||
| Client: httpclient.New(), | ||
| Netrc: true, | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These changes are necessary to enable TLS using the self-signed cert from the httptest.Server made in the test setup. The client needs to be configured with Only the mock provider source implements the ClientReturningSource interface, so only mock provider sources will lead to this method receiving a non-nil client. For end users of Terraform the incoming |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is here to illustrate using the new helpers. My plan is to delete it in a subsequent PR that makes use of the new helpers while implementing new features.
I'm happy to remove them in this PR before merging, once they're no longer needed for reference by the reviewer.