test: Add test helper for mocking out use of a network mirror as a provider source#38447
Merged
SarahFrench merged 7 commits intomainfrom Apr 28, 2026
Merged
Conversation
…factoring `NewMockHTTPMirrorSource` to pull out reused logic.
…k mirror into `getproviders` package
…r, for tests that need to include use of a network mirror when downloading providers.
…roviderSourceUsingTestHttpServer` This reduces repeated logic and hopefully makes it easier to understand. Co-authored-by: Copilot <[email protected]>
…sources Co-authored-by: Copilot <[email protected]>
SarahFrench
commented
Apr 27, 2026
…d by the test setup before using an endpoint handler Co-authored-by: Copilot <[email protected]>
3 tasks
austinvalle
approved these changes
Apr 27, 2026
Member
austinvalle
left a comment
There was a problem hiding this comment.
LGTM 🎸 - the comments are much appreciated 😅
austinvalle
pushed a commit
that referenced
this pull request
Apr 28, 2026
…ovider source (#38447) * refactor: Add `NewMockHTTPMirrorSource` test helper. This required refactoring `NewMockHTTPMirrorSource` to pull out reused logic. * refactor: Move structs defining expected HTTP responses from a network mirror into `getproviders` package * feat: Add `newHTTPMirrorProviderSourceUsingTestHttpServer` test helper, for tests that need to include use of a network mirror when downloading providers.
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 follows some prep work done in #38446 and the test helper added here is intended to support work in #38395. In that PR I want to add some tests for scenarios where a provider is downloaded from a network mirror. This PR adds the necessary helper!
Note: this PR also adds another 'temporary' test case that uses this new provider source. This is necessary because otherwise we'll get complaints about the function being unused, and also it helps with review here. My plan is to remove both of the temporary test cases in #38395, where I will finally add meaningful tests that use the new mock provider sources I've made:
I've also updated some of the godoc comments on these and related helpers I've authored, as I realised they were imprecise/harder to parse without prior knowledge.
Target Release
1.16.x
Rollback Plan
Changes to Security Controls
Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.
CHANGELOG entry