Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
2 changed files
with
20 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |