Example #1
0
def test_ssh_dir_out(dvc_repo):
    if not _should_test_ssh():
        pytest.skip()

    # Set up remote and cache
    remote_url = get_ssh_url()
    assert main(["remote", "add", "upstream", remote_url]) == 0

    cache_url = get_ssh_url()
    assert main(["remote", "add", "sshcache", cache_url]) == 0
    assert main(["config", "cache.ssh", "sshcache"]) == 0

    # Recreating to reread configs
    repo = DvcRepo(dvc_repo.root_dir)

    url_info = URLInfo(remote_url)
    mkdir_cmd = "mkdir dir-out;cd dir-out;echo 1 > 1.txt; echo 2 > 2.txt"
    repo.run(
        cmd="ssh {netloc} 'cd {path};{cmd}'".format(netloc=url_info.netloc,
                                                    path=url_info.path,
                                                    cmd=mkdir_cmd),
        outs=[(url_info / "dir-out").url],
        deps=["foo"],  # add a fake dep to not consider this a callback
    )

    repo.reproduce("dir-out.dvc")
    repo.reproduce("dir-out.dvc", force=True)
Example #2
0
 def should_test(self):
     return _should_test_ssh()