test: update mock.Server to use httptest.Server#1145
Merged
Conversation
Manav-Aggarwal
left a comment
Member
There was a problem hiding this comment.
looks good, left a comment.
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## main #1145 +/- ##
==========================================
- Coverage 55.24% 55.23% -0.02%
==========================================
Files 62 62
Lines 6708 6708
==========================================
- Hits 3706 3705 -1
- Misses 2606 2607 +1
Partials 396 396 ☔ View full report in Codecov by Sentry. |
Manav-Aggarwal
approved these changes
Aug 16, 2023
Manav-Aggarwal
approved these changes
Aug 17, 2023
MSevey
approved these changes
Aug 17, 2023
0e4305f to
d76ce4e
Compare
Manav-Aggarwal
pushed a commit
that referenced
this pull request
Sep 6, 2023
## Overview This PR improves upon #1144 by simplifying `mock.Server` to use `httptest` directly, avoiding a duplicate `http.Server`. `Server.Start` doesn't need a listener anymore, and it returns the URL at which the `httptest.Server` is running. ## Checklist <!-- Please complete the checklist to ensure that the PR is ready to be reviewed. IMPORTANT: PRs should be left in Draft until the below checklist is completed. --> - [ ] New and updated code has appropriate documentation - [ ] New and updated code has new and/or updated testing - [ ] Required CI checks are passing - [ ] Visual proof for any user facing features like CLI or documentation updates - [ ] Linked issues closed with keywords
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.
Overview
This PR improves upon #1144 by simplifying
mock.Serverto usehttptestdirectly, avoiding a duplicatehttp.Server.Server.Startdoesn't need a listener anymore, and it returns the URL at which thehttptest.Serveris running.Checklist