Skip to content
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

Merged
merged 1 commit into from
Jan 13, 2020

Conversation

skshetry
Copy link
Member

@skshetry skshetry commented Jan 13, 2020

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. πŸ™

@skshetry skshetry added the refactoring Factoring and re-factoring label Jan 13, 2020
@skshetry skshetry requested review from efiop and a user January 13, 2020 08:47
@skshetry skshetry self-assigned this Jan 13, 2020
@skshetry skshetry marked this pull request as ready for review January 13, 2020 08:47
Comment on lines -117 to -120
def get_ssh_url():
return "ssh://{}@127.0.0.1:22{}".format(
getpass.getuser(), get_local_storagepath()
)
Copy link
Member Author

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.

Copy link
Contributor

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.

Copy link
Member Author

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

return request.param.get_url()

I only grepped for the get_ssh_url/SSH.get_url and didn't find any. πŸ€¦β€β™‚οΈ

Comment on lines +261 to +270
# 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`.
#
Copy link
Member Author

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.

Copy link
Contributor

@efiop efiop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@efiop efiop merged commit 028d30e into iterative:master Jan 13, 2020
@skshetry skshetry deleted the refactor-ssh branch January 13, 2020 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Factoring and re-factoring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants