mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-01 23:08:43 +01:00
exp: make run/save less noisy
This commit is contained in:
committed by
Ruslan Kuprieiev
parent
1805edbd32
commit
057b0112ea
@@ -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
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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 []:
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user