-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat(cli): add custom dns resolver option #587
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
3c29a04
feat(cli): add custom dns resolver option
khanhnt2 f2eff60
fix: correct clippy lints
PsypherPunk 437068f
refactor: update resolvers to be Option
PsypherPunk c0b0d5a
feat(cli): include resolver in config.
PsypherPunk 8fd1f6e
refactor: change resolver chain
PsypherPunk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
Oops, something went wrong.
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.
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.
I think we try to avoid network tests so you can test on machines without the internet, in this case mocking the test output 🤔
But I think for the things which require this (Homebrew requires no networked tests) we have our own different tests specific to it
Although generally I regualrly make the argument that you cannot test a network CLI tool without some kind of network 😂 so approved!
Uh oh!
There was an error while loading. Please reload this page.
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.
Yep, I mulled this one over for a while: the only thing I could think would be to wrap the
Resolver
in a "New Type" which could capture the config. sent to it an expose that. That way, we could:a. better test that each branch of
get_resolver
results in the right DNS resolvers being referenced (and should mitigate the need to actually make DNS requests in the tests).b. potentially derive a
StructOpt
from_os_str
for it and create it upstream inOpts
, isolating a bit more from the parsing code.…but that seemed a bit much after a hefty
rebase
😁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.
I'm aware in PyTest that you can add "tags" to tests, so you could create tests like "pytest --tag online" to test the online features
that way we can keep it to testing offline for locally and online for CI etc....
Not sure if cargo supports that, and again it isn't really a good solution :(
Jeeze, testing networking tools is hard!