diff --git a/dvc/commands/experiments/save.py b/dvc/commands/experiments/save.py index 227aa0f90..d81f1579b 100644 --- a/dvc/commands/experiments/save.py +++ b/dvc/commands/experiments/save.py @@ -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 \n" - ) return 0 diff --git a/dvc/repo/experiments/__init__.py b/dvc/repo/experiments/__init__.py index c77f04e08..e351c15c3 100644 --- a/dvc/repo/experiments/__init__.py +++ b/dvc/repo/experiments/__init__.py @@ -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 \n" - ) def new( self, diff --git a/dvc/repo/experiments/executor/base.py b/dvc/repo/experiments/executor/base.py index a9f95c5c4..51da4fdb9 100644 --- a/dvc/repo/experiments/executor/base.py +++ b/dvc/repo/experiments/executor/base.py @@ -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 []: diff --git a/tests/unit/command/test_experiments.py b/tests/unit/command/test_experiments.py index 582b9b45e..76c23daa1 100644 --- a/tests/unit/command/test_experiments.py +++ b/tests/unit/command/test_experiments.py @@ -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 diff --git a/tests/unit/repo/test_scm_context.py b/tests/unit/repo/test_scm_context.py index 52e3b10d6..21978c0a1 100644 --- a/tests/unit/repo/test_scm_context.py +++ b/tests/unit/repo/test_scm_context.py @@ -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