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

dvc.stage.cache: fix typo, was using src filesystem to transfer #7739

Merged
merged 1 commit into from May 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion dvc/stage/cache.py
Expand Up @@ -216,7 +216,7 @@ def transfer(self, from_odb, to_odb):
from dvc.fs.callbacks import Callback

from_fs = from_odb.fs
to_fs = from_odb.fs
to_fs = to_odb.fs
func = _log_exceptions(fs.generic.copy)
runs = from_fs.path.join(from_odb.fs_path, "runs")

Expand Down
19 changes: 19 additions & 0 deletions dvc/testing/test_run_cache.py
@@ -0,0 +1,19 @@
import shutil

from .tmp_dir import TmpDir


def test_push_pull(tmp_dir, dvc, remote):
tmp_dir.gen("foo", "foo")
stage = dvc.stage.add(
deps=["foo"], outs=["bar"], name="copy-foo-bar", cmd="cp foo bar"
)
dvc.reproduce(stage.addressing)
assert dvc.push(run_cache=True) == 2

stage_cache_dir = TmpDir(dvc.stage_cache.cache_dir)
expected = list(stage_cache_dir.rglob("*"))
shutil.rmtree(stage_cache_dir)

dvc.pull(run_cache=True)
assert list(stage_cache_dir.rglob("*")) == expected