-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed as not planned
Labels
bugDid we break something?Did we break something?p2-mediumMedium priority, should be done, but less importantMedium priority, should be done, but less important
Description
Following test passes:
def test_add_multiple_with_exception(tmp_dir, scm, dvc, mocker):
tmp_dir.gen({"file": "file content", "other": "other file content"})
original_move = dvc.cache.local.tree.move
def raise_move(from_info, to_info, mode=None):
if str(from_info) == "other":
raise Exception
else:
original_move(from_info, to_info, mode)
assert not (tmp_dir / ".gitignore").exists()
mocker.patch.object(dvc.cache.local.tree, "move", side_effect=raise_move)
try:
dvc.add(["file", "other"])
except:
pass
assert (tmp_dir / "file.dvc").exists()
assert (tmp_dir / ".gitignore").exists()
assert (tmp_dir / ".gitignore").read_text() == ''
How it should be?
.gitignore should contain file even though the whole add command failed. As of now, we end up successfully adding file to dvc but it is not ignored. At least we should be informed about potential problems.
efiop
Metadata
Metadata
Assignees
Labels
bugDid we break something?Did we break something?p2-mediumMedium priority, should be done, but less importantMedium priority, should be done, but less important