experiments: support exp run --checkpoint for baseline commits (#4701)

* handle untracked files when `git reset --hard` in experiments workspace

* error on checkpoint branch already exists

* terminate stage process on checkpoint errors

* update tests

* cleanup error message
This commit is contained in:
Peter Rowlands (변기호)
2020-10-13 23:10:08 +03:00
committed by GitHub
parent 3e011d70d5
commit cc8d0ef43f
6 changed files with 44 additions and 18 deletions
+1 -1
View File
@@ -1302,4 +1302,4 @@ def test_repro_when_cmd_changes(tmp_dir, dvc, run_copy, mocker):
stage.addressing: ["changed checksum"]
}
assert dvc.reproduce(stage.addressing)[0] == stage
m.assert_called_once_with(stage, checkpoint=False)
m.assert_called_once_with(stage, checkpoint_func=None)
+1 -1
View File
@@ -286,7 +286,7 @@ def test_repro_when_cmd_changes(tmp_dir, dvc, run_copy, mocker):
assert dvc.status([target]) == {target: ["changed command"]}
assert dvc.reproduce(target)[0] == stage
m.assert_called_once_with(stage, checkpoint=False)
m.assert_called_once_with(stage, checkpoint_func=None)
def test_repro_when_new_deps_is_added_in_dvcfile(tmp_dir, dvc, run_copy):
+1 -1
View File
@@ -288,4 +288,4 @@ def test_stage_run_checkpoint(tmp_dir, dvc, mocker, checkpoint):
else:
callback = None
run_stage(stage, checkpoint_func=callback)
mock_cmd_run.assert_called_with(stage, checkpoint=checkpoint)
mock_cmd_run.assert_called_with(stage, checkpoint_func=callback)