-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
test: refactor ssh related functions in test helper classes #3123
Conversation
def get_ssh_url(): | ||
return "ssh://{}@127.0.0.1:22{}".format( | ||
getpass.getuser(), get_local_storagepath() | ||
) |
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 did not find any usage of this, probably, because we are moving away from real server to mocked ssh server? Anyway, I didn't want to change this atm.
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.
@skshetry I think it is still used in tests/func/test_api.py . We are close to getting rid of it, that is true π Let's not tackle it in this PR though.
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, it is still used in
Line 26 in 028d30e
return request.param.get_url() |
I only grepped for the get_ssh_url
/SSH.get_url
and didn't find any. π€¦ββοΈ
# NOTE: On Windows get_local_storagepath() will return an | ||
# ntpath that looks something like `C:\some\path`, which is not | ||
# compatible with SFTP paths [1], so we need to convert it to | ||
# a proper posixpath. | ||
# To do that, we should construct a posixpath that would be | ||
# relative to the server's root. | ||
# In our case our ssh server is running with `c:/` as a root, | ||
# and our URL format requires absolute paths, so the | ||
# resulting path would look like `/some/path`. | ||
# |
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 splitted the comment here as it was getting more than 80chars.
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.
Thanks!
Related to #2878
β Have you followed the guidelines in the Contributing to DVC list?
π Check this box if this PR does not require documentation updates, or if it does and you have created a separate PR in dvc.org with such updates (or at least opened an issue about it in that repo). Please link below to your PR (or issue) in the dvc.org repo.
β Have you checked DeepSource, CodeClimate, and other sanity checks below? We consider their findings recommendatory and don't expect everything to be addressed. Please review them carefully and fix those that actually improve code or fix bugs.
Thank you for the contribution - we'll try to review it as soon as possible. π