Skip to content

Commit

Permalink
make exp run --dry imply --temp
Browse files Browse the repository at this point in the history
  • Loading branch information
dberenbaum committed Sep 8, 2023
1 parent 7e52c23 commit 6d4cd68
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dvc/commands/experiments/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
3 changes: 3 additions & 0 deletions dvc/repo/experiments/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 3 additions & 1 deletion tests/func/experiments/test_experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 6d4cd68

Please sign in to comment.