Conversation
Contributor
Author
|
Locally, the tests pass since I can freely bind to ports 80 and 443. In CI however, those ports are restricted. I might be able to use |
36965fc to
ce0cfed
Compare
c00472e to
3bdf231
Compare
Contributor
Author
|
Rather than elevate privileges in CI, which felt wrong and proved to be rather difficult without moving to self-hosted containers, I opted to adjust the tests to allow server creation and request failures while still testing for a default port using a jasmine spy. With the adjustments, coverage dropped and so a rewritten test was added back to take care of it. |
samarsault
pushed a commit
that referenced
this pull request
Mar 3, 2023
Bumps [@percy/core](https://github.com/percy/cli/tree/HEAD/packages/core) from 1.0.0-beta.67 to 1.0.0-beta.68. - [Release notes](https://github.com/percy/cli/releases) - [Commits](https://github.com/percy/cli/commits/v1.0.0-beta.68/packages/core) --- updated-dependencies: - dependency-name: "@percy/core" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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.
What is this?
With
new URL(), the default port is never included in the resulting object, even when explicitly defined.In the
@percy/clientproxy, the proxy address' port is passed along to the(net|tls).connectmethod. With the above in mind, this results in an empty string being passed along. Since theportoption is a required argument of the method, this causes connections to immediately close, showing only a vague error.This PR adds a small
portutil which will return a default port if one isn't specified, port 443 for HTTPS requests or port 80 otherwise. This util is then used in the two places where a URL port is referenced.Fixes #402