From ca586bf3fe9ad6743b2600fe4d7adda6a4c94849 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Sat, 16 Jul 2022 10:31:20 +0200 Subject: [PATCH] Windows: Skip "inaccessible path" test For some reason, on Windows, creating a directory with zero permissions still allows creating a file in there. Just skip that part of the test. The Explorer's properties panel of the directory also shows "Read Only (only applies to files)", so at least that seems consistent. --- internal/manager/api_impl/meta_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/internal/manager/api_impl/meta_test.go b/internal/manager/api_impl/meta_test.go index 968b04c0..d21251be 100644 --- a/internal/manager/api_impl/meta_test.go +++ b/internal/manager/api_impl/meta_test.go @@ -7,6 +7,7 @@ import ( "net/http" "os" "path/filepath" + "runtime" "testing" "git.blender.org/flamenco/internal/manager/config" @@ -98,7 +99,12 @@ func TestCheckSharedStoragePath(t *testing.T) { } // Test inaccessible path. - { + // For some reason, this doesn't work on Windows, and creating a file in + // that directory is still allowed. The Explorer's properties panel of the + // directory also shows "Read Only (only applies to files)", so at least + // that seems consistent. + // FIXME: find another way to test with unwritable directories on Windows. + if runtime.GOOS != "windows" { parentPath := filepath.Join(mf.tempdir, "deep") testPath := filepath.Join(parentPath, "nesting") if err := os.Mkdir(parentPath, fs.ModePerm); !assert.NoError(t, err) {