mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-04 23:09:44 +01:00
Currently, we iterate over targets manually in CLI, which results in a complicated code and a DAG collection/check overhead. With this PR we collect the DAG once, figure out all the needed targets within it and just reproduce them in one pass.
36 lines
923 B
Python
36 lines
923 B
Python
from dvc.cli import parse_args
|
|
from dvc.command.repro import CmdRepro
|
|
|
|
default_arguments = {
|
|
"all_pipelines": False,
|
|
"downstream": False,
|
|
"dry": False,
|
|
"force": False,
|
|
"run_cache": True,
|
|
"interactive": False,
|
|
"no_commit": False,
|
|
"pipeline": False,
|
|
"single_item": False,
|
|
"recursive": False,
|
|
"force_downstream": False,
|
|
"pull": False,
|
|
"glob": False,
|
|
"targets": [],
|
|
}
|
|
|
|
|
|
def test_default_arguments(dvc, mocker):
|
|
cmd = CmdRepro(parse_args(["repro"]))
|
|
mocker.patch.object(cmd.repo, "reproduce")
|
|
cmd.run()
|
|
cmd.repo.reproduce.assert_called_with(**default_arguments)
|
|
|
|
|
|
def test_downstream(dvc, mocker):
|
|
cmd = CmdRepro(parse_args(["repro", "--downstream"]))
|
|
mocker.patch.object(cmd.repo, "reproduce")
|
|
cmd.run()
|
|
arguments = default_arguments.copy()
|
|
arguments.update({"downstream": True})
|
|
cmd.repo.reproduce.assert_called_with(**arguments)
|