test: use pkg httptest to avoid port conflict#1144
Merged
Conversation
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## main #1144 +/- ##
=======================================
Coverage 55.14% 55.14%
=======================================
Files 62 62
Lines 6719 6719
=======================================
Hits 3705 3705
Misses 2618 2618
Partials 396 396 ☔ View full report in Codecov by Sentry. |
nashqueue
approved these changes
Aug 16, 2023
5 tasks
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Aug 17, 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
Manav-Aggarwal
pushed a commit
that referenced
this pull request
Sep 6, 2023
## Overview This PR uses pkg `httptest` to avoid port conflict when running tests under `da/test` i.e. `TestLifecycle`, `TestRetrieve`. This allows the tests to pass even if an address is bound to the default port i.e. `127.0.0.1:26658` ## 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
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 uses pkg
httptestto avoid port conflict when running tests underda/testi.e.TestLifecycle,TestRetrieve.This allows the tests to pass even if an address is bound to the default port i.e.
127.0.0.1:26658Checklist