exp save: Track top level files

This commit is contained in:
David de la Iglesia Castro
2023-03-31 19:23:40 +02:00
parent 7c8e6e3156
commit 24e10e0278
2 changed files with 29 additions and 0 deletions
+20
View File
@@ -116,3 +116,23 @@ def test_exp_save_include_untracked_warning(tmp_dir, dvc, scm, mocker):
dvc.experiments.save(name="exp", include_untracked=["new_dir"])
assert not logger.warning.called
def test_untracked_top_level_files_are_included_in_exp(tmp_dir, scm, dvc):
(tmp_dir / "dvc.yaml").dump(
{
"metrics": ["metrics.json"],
"params": ["params.yaml"],
"plots": ["plots.csv"],
}
)
stage = dvc.stage.add(
cmd="touch metrics.json && touch params.yaml && touch plots.csv",
name="top-level",
)
scm.add_commit(["dvc.yaml"], message="add dvc.yaml")
dvc.reproduce(stage.addressing)
exp = dvc.experiments.save()
fs = scm.get_fs(exp)
for file in ["metrics.json", "params.yaml", "plots.csv"]:
assert fs.exists(file)