mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-14 07:18:27 +01:00
* dvc: ignore errors on protect/set_exec (#5335)
Both of these are not fatal and could safely be ignored.
Fixes #5255
(cherry picked from commit 434cd305e9)
* tests: upgrade azurite and enable loose mode
Backport of #5272
Co-authored-by: Ruslan Kuprieiev <[email protected]>
Co-authored-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
co-authored by
Ruslan Kuprieiev
Ruslan Kuprieiev
parent
9638dde4da
commit
7fe0279c20
@@ -2,7 +2,8 @@
|
||||
version: '3.2'
|
||||
services:
|
||||
azurite:
|
||||
image: mcr.microsoft.com/azure-storage/azurite:3.9.0
|
||||
image: mcr.microsoft.com/azure-storage/azurite:3.10.0
|
||||
command: azurite -L -l /data --blobHost 0.0.0.0 --queueHost 0.0.0.0
|
||||
ports:
|
||||
- "10000"
|
||||
oss:
|
||||
|
||||
@@ -65,28 +65,12 @@ def test_is_protected(tmp_dir, dvc, link_name):
|
||||
assert tree.is_protected(foo)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("err", [errno.EPERM, errno.EACCES])
|
||||
def test_protect_ignore_errors(tmp_dir, mocker, err):
|
||||
@pytest.mark.parametrize("err", [errno.EPERM, errno.EACCES, errno.EROFS])
|
||||
def test_protect_ignore_errors(tmp_dir, dvc, mocker, err):
|
||||
tmp_dir.gen("foo", "foo")
|
||||
foo = PathInfo("foo")
|
||||
tree = LocalTree(None, {})
|
||||
|
||||
tree.protect(foo)
|
||||
|
||||
mock_chmod = mocker.patch(
|
||||
"os.chmod", side_effect=OSError(err, "something")
|
||||
)
|
||||
tree.protect(foo)
|
||||
assert mock_chmod.called
|
||||
|
||||
|
||||
def test_protect_ignore_erofs(tmp_dir, mocker):
|
||||
tmp_dir.gen("foo", "foo")
|
||||
foo = PathInfo("foo")
|
||||
tree = LocalTree(None, {})
|
||||
|
||||
mock_chmod = mocker.patch(
|
||||
"os.chmod", side_effect=OSError(errno.EROFS, "read-only fs")
|
||||
)
|
||||
tree.protect(foo)
|
||||
LocalTree(None, {}).protect(PathInfo("foo"))
|
||||
assert mock_chmod.called
|
||||
|
||||
Reference in New Issue
Block a user