mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-27 23:09:28 +01:00
Remove all of the experiments in the workspace (#6394)
* Remove all of the experiments in the workspace fix #5676 1. remove all the experiments in workspace 2. add tests for it * Only remove baseline ones * Add a new arguments --all * Update dvc/repo/experiments/remove.py Co-authored-by: Peter Rowlands (변기호) <[email protected]> * Rename and shortcut for these commands * Solve the issue from removing a changing list. * Update dvc/repo/experiments/remove.py Co-authored-by: Peter Rowlands (변기호) <[email protected]> * Update dvc/repo/experiments/remove.py Co-authored-by: Peter Rowlands (변기호) <[email protected]> * delete workspace option Co-authored-by: Peter Rowlands (변기호) <[email protected]>
This commit is contained in:
@@ -252,13 +252,25 @@ def test_experiments_pull(dvc, scm, mocker):
|
||||
)
|
||||
|
||||
|
||||
def test_experiments_remove(dvc, scm, mocker):
|
||||
cli_args = parse_args(["experiments", "remove", "--queue"])
|
||||
@pytest.mark.parametrize(
|
||||
"queue,clear_all",
|
||||
[(True, False), (False, True)],
|
||||
)
|
||||
def test_experiments_remove(dvc, scm, mocker, queue, clear_all):
|
||||
if queue:
|
||||
args = "--queue"
|
||||
if clear_all:
|
||||
args = "--all"
|
||||
cli_args = parse_args(["experiments", "remove", args])
|
||||
assert cli_args.func == CmdExperimentsRemove
|
||||
|
||||
cmd = cli_args.func(cli_args)
|
||||
m = mocker.patch("dvc.repo.experiments.remove.remove", return_value={})
|
||||
|
||||
assert cmd.run() == 0
|
||||
|
||||
m.assert_called_once_with(cmd.repo, exp_names=[], queue=True)
|
||||
m.assert_called_once_with(
|
||||
cmd.repo,
|
||||
exp_names=[],
|
||||
queue=queue,
|
||||
clear_all=clear_all,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user