Merge pull request #1523 from efiop/master

stage: don't exclude md5s for deps/outs
This commit is contained in:
Ruslan Kuprieiev
2019-01-24 17:35:15 +02:00
committed by GitHub
2 changed files with 24 additions and 2 deletions
+5 -2
View File
@@ -465,11 +465,14 @@ class Stage(object):
d = self.dumpd()
# NOTE: removing md5 manually in order to not affect md5s in deps/outs
if self.PARAM_MD5 in d.keys():
del d[self.PARAM_MD5]
# NOTE: excluding parameters that don't affect the state of the
# pipeline. Not excluding `OutputLOCAL.PARAM_CACHE`, because if
# it has changed, we might not have that output in our cache.
return dict_md5(d, exclude=[self.PARAM_MD5,
self.PARAM_LOCKED,
return dict_md5(d, exclude=[self.PARAM_LOCKED,
OutputLOCAL.PARAM_METRIC])
def save(self):
+19
View File
@@ -0,0 +1,19 @@
import mock
from unittest import TestCase
from dvc.stage import Stage
class TestStageChecksum(TestCase):
def test(self):
stage = Stage(None)
outs = [{'path': 'a', 'md5': '123456789'}]
deps = [{'path': 'b', 'md5': '987654321'}]
d = {'md5': '123456',
'cmd': 'mycmd',
'outs': outs,
'deps': deps}
with mock.patch.object(stage, 'dumpd', return_value=d):
self.assertEqual(stage._compute_md5(),
'e9521a22111493406ea64a88cda63e0b')