mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
Merge pull request #1650 from mroutis/fix-1634
stage: always reproduce callback stages
This commit is contained in:
+1
-1
@@ -657,7 +657,7 @@ class Stage(object):
|
||||
else:
|
||||
logger.info("Running command:\n\t{}".format(self.cmd))
|
||||
if not dry:
|
||||
if self._already_cached():
|
||||
if not self.is_callback and self._already_cached():
|
||||
self.checkout()
|
||||
else:
|
||||
self._run()
|
||||
|
||||
@@ -1277,3 +1277,19 @@ class TestReproNoCommit(TestRepro):
|
||||
ret = main(["repro", self.file1_stage, "--no-commit"])
|
||||
self.assertEqual(ret, 0)
|
||||
self.assertEqual(len(os.listdir(self.dvc.cache.local.cache_dir)), 0)
|
||||
|
||||
|
||||
class TestReproAlreadyCached(TestRepro):
|
||||
def test(self):
|
||||
first_out = self.dvc.run(
|
||||
fname="random.dvc",
|
||||
deps=[],
|
||||
outs=["random.txt"],
|
||||
cmd='python -c "{}" > random.txt'.format(
|
||||
"from random import random; print(random())"
|
||||
),
|
||||
).outs[0]
|
||||
|
||||
second_out = self.dvc.reproduce(target="random.dvc")[0].outs[0]
|
||||
|
||||
self.assertNotEqual(first_out.checksum, second_out.checksum)
|
||||
|
||||
Reference in New Issue
Block a user