mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-24 15:28:28 +01:00
dvc.stage.cache: fix typo, was using src filesystem to transfer
This was working for LocalFileSystem as they work for any directories/path. It's hard to test this these days, as we don't have remote tests inside dvc, so it was not caught. Potentially fixes #7718.
This commit is contained in:
committed by
Ruslan Kuprieiev
parent
60cbcec399
commit
942a080567
+1
-1
@@ -216,7 +216,7 @@ class StageCache:
|
||||
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")
|
||||
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user