mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-07 07:18:27 +01:00
* repro: support regex/foreach-group to run at once Fixes #4912 Fixes #4886 Fixes #4958 * Use `tree.isdir` rather than `os.path.isdir` * Use glob rather than regex * Update dvc/command/repro.py * s/regex/glob * disable glob on `collect_granular` There's no need for a glob here * add tests for `collect` and `collect_granular`
36 lines
972 B
Python
36 lines
972 B
Python
from dvc.cli import parse_args
|
|
from dvc.command.repro import CmdRepro
|
|
from dvc.dvcfile import PIPELINE_FILE
|
|
|
|
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,
|
|
}
|
|
|
|
|
|
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(PIPELINE_FILE, **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(PIPELINE_FILE, **arguments)
|