Move infofile operation to executor and

Currently infofile dump was spread in both executor and queue classes.
put them all into executor to make them more managable. Move all ending
dump operations to the cleanup function, because the collect_result progress
might failed because of git operations, in which can guarantee them to
be run in a `finally` scope.
This commit is contained in:
karajan1001
2022-09-26 16:25:47 +08:00
committed by Gao
parent c2829f4ce8
commit 6bd14b21ef
9 changed files with 61 additions and 56 deletions
+2 -2
View File
@@ -58,7 +58,8 @@ def test_init_git(tmp_dir, scm, cloud, mocker):
username=TEST_SSH_USER,
fs_factory=partial(_ssh_factory, cloud),
)
executor.init_git(scm, rev, mock)
infofile = str((root_url / "foo.run").path)
executor.init_git(scm, rev, mock, infofile=infofile)
assert root_url.path == executor._repo_abspath
fs = cloud._ssh
@@ -116,7 +117,6 @@ def test_reproduce(tmp_dir, scm, dvc, cloud, exp_stage, mocker):
SSHExecutor.reproduce(
info,
rev,
infofile=infofile,
fs_factory=partial(_ssh_factory, cloud),
)
assert mock_execute.called_once()