exp: make run/save less noisy

This commit is contained in:
dberenbaum
2023-08-18 00:31:52 +03:00
committed by Ruslan Kuprieiev
parent 1805edbd32
commit 057b0112ea
5 changed files with 6 additions and 15 deletions
-4
View File
@@ -27,10 +27,6 @@ class CmdExperimentsSave(CmdBase):
else:
name = self.repo.experiments.get_exact_name([ref])[ref]
ui.write(f"Experiment has been saved as: {name}")
ui.write(
"\nTo promote an experiment to a Git branch run:\n\n"
"\tdvc exp branch <exp> <branch>\n"
)
return 0
-4
View File
@@ -210,10 +210,6 @@ class Experiments:
)
else:
ui.write("Experiment results have been applied to your workspace.")
ui.write(
"\nTo promote an experiment to a Git branch run:\n\n"
"\tdvc exp branch <exp> <branch>\n"
)
def new(
self,
+1 -3
View File
@@ -129,7 +129,6 @@ class BaseExecutor(ABC):
PACKED_ARGS_FILE = "repro.dat"
WARN_UNTRACKED = False
QUIET = False
INFOFILE_EXT = ".run"
DEFAULT_LOCATION: str = "workspace"
@@ -602,8 +601,7 @@ class BaseExecutor(ABC):
info.status = TaskStatus.RUNNING
if infofile is not None:
info.dump_json(infofile)
if cls.QUIET:
dvc.scm_context.quiet = cls.QUIET
dvc.scm_context.quiet = True
old_cwd = os.getcwd()
for path in copy_paths or []:
+1 -1
View File
@@ -418,7 +418,7 @@ def test_experiments_remove_invalid(dvc, scm, mocker, capsys, caplog):
)
def test_experiments_save(dvc, scm, mocker):
def test_experiments_save(dvc, scm, mocker, caplog):
cli_args = parse_args(["exp", "save", "--name", "exp-name", "--force"])
assert cli_args.func == CmdExperimentsSave
+4 -3
View File
@@ -100,13 +100,14 @@ def test_scm_context_on_no_files_to_track(caplog, scm_context, autostage, quiet)
assert not caplog.text
def test_scm_context_remind_to_track(caplog, scm_context):
with scm_context() as context:
@pytest.mark.parametrize("quiet", [True, False])
def test_scm_context_remind_to_track(caplog, scm_context, quiet):
with scm_context(quiet=quiet) as context:
context.track_file("foo")
context.track_file("lorem ipsum")
assert context.files_to_track == {"foo", "lorem ipsum"}
if isinstance(scm_context.scm, NoSCM):
if quiet or isinstance(scm_context.scm, NoSCM):
assert not caplog.text
else:
assert "To track the changes with git, run:" in caplog.text