From 4b9a4114fea6c00400ffca56f7f99e2a2f5b0fb9 Mon Sep 17 00:00:00 2001 From: Saugat Pachhai Date: Wed, 18 Aug 2021 15:17:33 +0545 Subject: [PATCH] exp run: pass recursive args to checkout (#6458) --- 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 729836f15..126a4409a 100644 --- a/dvc/repo/experiments/executor/base.py +++ b/dvc/repo/experiments/executor/base.py @@ -348,6 +348,7 @@ class BaseExecutor(ABC): 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 5a755f804..587ff53f1 100644 --- a/tests/func/experiments/test_experiments.py +++ b/tests/func/experiments/test_experiments.py @@ -8,7 +8,7 @@ from funcy import first 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}