stage: cache: use lockfiles (#3713)

* stage: cache: use lockfiles

* reorganize

* Reorganize, use fill_from_lock to load stage cache

* load params from build cache

* adjust tests

Co-authored-by: Saugat Pachhai <[email protected]>
This commit is contained in:
Ruslan Kuprieiev
2020-05-01 15:23:11 +03:00
committed by GitHub
co-authored by Saugat Pachhai
parent 22c60dd608
commit 827c994e74
8 changed files with 85 additions and 74 deletions
+5 -3
View File
@@ -1,4 +1,3 @@
import os
from collections import OrderedDict
from operator import itemgetter
from textwrap import dedent
@@ -175,8 +174,11 @@ def test_params_dump(tmp_dir, dvc, run_head):
assert not dvc.reproduce(stage.addressing)
(tmp_dir / PIPELINE_LOCK).unlink()
# XXX: temporary workaround due to lack of params support in build cache
remove(os.path.join(dvc.cache.local.cache_dir, "stages"))
assert dvc.reproduce(stage.addressing) == [stage]
assert_eq_lockfile(initial_content, read_lock_file())
# remove build-cache and check if the same structure is built
for item in [dvc.stage_cache.cache_dir, PIPELINE_LOCK]:
remove(item)
assert dvc.reproduce(stage.addressing) == [stage]
assert_eq_lockfile(initial_content, read_lock_file())