From 3d6ed4f7344b1d2a71e1250402c538b04a3fbd0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Saugat=20Pachhai=20=28=E0=A4=B8=E0=A5=8C=E0=A4=97=E0=A4=BE?= =?UTF-8?q?=E0=A4=A4=29?= Date: Wed, 18 Aug 2021 14:40:40 +0545 Subject: [PATCH] exp run: pass recursive args to checkout --- dvc/repo/experiments/executor/base.py | 1 + tests/func/experiments/test_experiments.py | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/dvc/repo/experiments/executor/base.py b/dvc/repo/experiments/executor/base.py index 729836f152..126a4409a5 100644 --- a/dvc/repo/experiments/executor/base.py +++ b/dvc/repo/experiments/executor/base.py @@ -348,6 +348,7 @@ def filter_pipeline(stages): quiet=True, allow_missing=True, checkpoint_reset=checkpoint_reset, + recursive=kwargs.get("recursive", False), ) checkpoint_func = partial( diff --git a/tests/func/experiments/test_experiments.py b/tests/func/experiments/test_experiments.py index 5a755f8042..587ff53f18 100644 --- a/tests/func/experiments/test_experiments.py +++ b/tests/func/experiments/test_experiments.py @@ -8,7 +8,7 @@ from dvc.dvcfile import PIPELINE_FILE from dvc.repo.experiments.utils import exp_refs_by_rev -from dvc.utils.serialize import PythonFileCorruptedError +from dvc.utils.serialize import PythonFileCorruptedError, load_yaml from tests.func.test_repro_multistage import COPY_SCRIPT @@ -657,3 +657,12 @@ def test_modified_data_dep(tmp_dir, scm, dvc, workspace, params, target): if workspace: assert (tmp_dir / "metrics.yaml").read_text().strip() == params assert (tmp_dir / "data").read_text().strip() == "modified" + + +def test_exp_run_recursive(tmp_dir, scm, dvc, run_copy_metrics): + tmp_dir.dvc_gen("metric_t.json", "foo: 1") + run_copy_metrics( + "metric_t.json", "metric.json", metrics=["metric.json"], no_exec=True + ) + assert dvc.experiments.run(".", recursive=True) + assert load_yaml(tmp_dir / "metric.json") == {"foo": 1}