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:
Gao
2021-08-19 10:18:51 +09:00
committed by GitHub
co-authored by Peter Rowlands
parent 4b9a4114fe
commit 57899ee86d
4 changed files with 73 additions and 14 deletions
+16 -4
View File
@@ -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,
)