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

tests: remove redundant native ssh tests #3104

Merged
merged 6 commits into from
Jan 11, 2020
Merged

Conversation

efiop
Copy link
Contributor

@efiop efiop commented Jan 10, 2020

We already have mocked ones, which are more reliable as they use their
own paramiko server instead of relying on the sshd running on the test
machine. Native tests are also quite flaky and fail sometimes due to
network issues.

  • ❗ 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. 🙏

@efiop efiop force-pushed the ssh_dir_out branch 2 times, most recently from 47c8a6d to 5383af8 Compare January 10, 2020 23:46
@@ -156,14 +156,12 @@ def _remove_file(self, path):
def _remove_dir(self, path):
for root, dirs, files in self.walk(path, topdown=False):
for fname in files:
path = posixpath.join(root, fname)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was a pretty nasty bug 🙁 Added a test

url_info = URLInfo(remote_url)
mkdir_cmd = "mkdir dir-out;cd dir-out;echo 1 > 1.txt; echo 2 > 2.txt"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This actually didn't work because of the bug in remove. That is why you need to use && to ensure that no error occurs. Same complaint as when people don't use set -e \n set -x in their bash scripts 🙂

We already have mocked ones, which are more reliable as they use their
own paramiko server instead of relying on the sshd running on the test
machine. Native tests are also quite flaky and fail sometimes due to
network issues.
@efiop efiop force-pushed the ssh_dir_out branch 3 times, most recently from 85f09b7 to b6955d7 Compare January 11, 2020 02:23
@ghost ghost self-requested a review January 11, 2020 02:31
It is already available in the standard hooks.
@efiop efiop merged commit 5b85db3 into iterative:master Jan 11, 2020
@efiop efiop deleted the ssh_dir_out branch January 11, 2020 03:20
@ghost
Copy link

ghost commented Jan 14, 2020

@efiop , sorry for the late re-review, looks good, tho 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant