diff --git a/dvc/commands/experiments/run.py b/dvc/commands/experiments/run.py index dd8c90cd3e..090cae3134 100644 --- a/dvc/commands/experiments/run.py +++ b/dvc/commands/experiments/run.py @@ -26,7 +26,7 @@ def run(self): def add_parser(experiments_subparsers, parent_parser): - EXPERIMENTS_RUN_HELP = "Run or resume an experiment." + EXPERIMENTS_RUN_HELP = "Run an experiment." experiments_run_parser = experiments_subparsers.add_parser( "run", parents=[parent_parser], diff --git a/dvc/repo/experiments/run.py b/dvc/repo/experiments/run.py index d3c7149479..1dd3c42b89 100644 --- a/dvc/repo/experiments/run.py +++ b/dvc/repo/experiments/run.py @@ -30,6 +30,9 @@ def run( # noqa: C901, PLR0912 Returns a dict mapping new experiment SHAs to the results of `repro` for that experiment. """ + if kwargs.get("dry"): + tmp_dir = True + if run_all: return repo.experiments.reproduce_celery(jobs=jobs) diff --git a/tests/func/experiments/test_experiments.py b/tests/func/experiments/test_experiments.py index 1c487306c9..29259ac3e2 100644 --- a/tests/func/experiments/test_experiments.py +++ b/tests/func/experiments/test_experiments.py @@ -676,10 +676,12 @@ def test_experiment_unchanged(tmp_dir, scm, dvc, exp_stage): assert len(dvc.experiments.ls()[scm.get_rev()]) == 2 -def test_experiment_run_dry(tmp_dir, scm, dvc, exp_stage): +def test_experiment_run_dry(tmp_dir, scm, dvc, exp_stage, mocker): + repro = mocker.spy(dvc.experiments, "reproduce_one") dvc.experiments.run(exp_stage.addressing, dry=True) assert len(dvc.experiments.ls()["master"]) == 0 + assert repro.call_args.kwargs["tmp_dir"] is True def test_clean(tmp_dir, scm, dvc, mocker):