mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
exp: use exp baseline for DVC commands that compare to HEAD during exp run (#5818)
* exp: add util method for getting baseline HEAD during run * exp: use baseline for dvc commands which compare to HEAD during exp run * add test for new util method * update plots diff test mock
This commit is contained in:
@@ -611,3 +611,16 @@ def test_checkout_targets_deps(tmp_dir, scm, dvc, exp_stage):
|
||||
assert (tmp_dir / "foo").exists()
|
||||
assert (tmp_dir / "foo").read_text() == "foo"
|
||||
assert not (tmp_dir / "bar").exists()
|
||||
|
||||
|
||||
@pytest.mark.parametrize("tail", ["", "~1", "^"])
|
||||
def test_fix_exp_head(tmp_dir, scm, tail):
|
||||
from dvc.repo.experiments.base import EXEC_BASELINE
|
||||
from dvc.repo.experiments.utils import fix_exp_head
|
||||
|
||||
head = "HEAD" + tail
|
||||
assert head == fix_exp_head(scm, head)
|
||||
|
||||
scm.set_ref(EXEC_BASELINE, "refs/heads/master")
|
||||
assert EXEC_BASELINE + tail == fix_exp_head(scm, head)
|
||||
assert "foo" + tail == fix_exp_head(scm, "foo" + tail)
|
||||
|
||||
Reference in New Issue
Block a user