From 5aae934379a514349a4522308a7c02252ab543da Mon Sep 17 00:00:00 2001 From: dberenbaum Date: Wed, 6 Mar 2024 16:46:24 -0500 Subject: [PATCH] test auto push with tmp dir --- tests/func/experiments/test_remote.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/func/experiments/test_remote.py b/tests/func/experiments/test_remote.py index 2f064e4f8..a1fbb9047 100644 --- a/tests/func/experiments/test_remote.py +++ b/tests/func/experiments/test_remote.py @@ -422,3 +422,18 @@ def test_auto_push_misconfigured( with caplog.at_level(logging.WARNING, logger="dvc"): dvc.experiments.run(exp_stage.addressing, params=["foo=2"], name=exp_name) assert "Failed to validate remotes" in caplog.text + + +def test_auto_push_tmp_dir(tmp_dir, scm, dvc, git_upstream, local_remote, exp_stage): + remote = git_upstream.remote + + with dvc.config.edit() as conf: + conf["exp"]["auto_push"] = True + conf["exp"]["git_remote"] = remote + + exp_name = "foo" + dvc.experiments.run( + exp_stage.addressing, params=["foo=2"], name=exp_name, tmp_dir=True + ) + + assert first(dvc.experiments.push(name=exp_name, git_remote=remote)) == "up_to_date"