Skip to content

Commit

Permalink
tests: further exclude windows from symlink tests
Browse files Browse the repository at this point in the history
os.Symlink returns a nil error in some cases (when permissions allow), but
still does not behave as expected.  Skip Windows altogether from some of these
tests for the time being.
  • Loading branch information
willnorris committed Sep 15, 2020
1 parent 3f04833 commit 760cf5d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions pkg/blobserver/diskpacked/diskpacked_test.go
Expand Up @@ -345,6 +345,9 @@ func TestBadDir(t *testing.T) {
}

func TestWriteError(t *testing.T) {
if runtime.GOOS == "windows" {
t.Skip("skipping symlink test on Windows")
}
dir, err := ioutil.TempDir("", "diskpacked-test")
if err != nil {
t.Fatal(err)
Expand All @@ -355,9 +358,6 @@ func TestWriteError(t *testing.T) {
t.Logf("diskpacked test dir is %q", dir)
fn := filepath.Join(dir, "pack-00000.blobs")
if err := os.Symlink("/non existing file", fn); err != nil {
if runtime.GOOS == "windows" {
t.Skip("skipping symlink test on Windows")
}
t.Fatal(err)
}
s, err := newStorage(dir, 1, jsonconfig.Obj{"type": "memory"})
Expand Down
7 changes: 4 additions & 3 deletions pkg/test/integration/non-utf8_test.go
Expand Up @@ -88,6 +88,10 @@ func TestNonUTF8FileName(t *testing.T) {
// not utf8, that we do no panic in the process and that the results
// are correct.
func TestNonUTF8SymlinkTarget(t *testing.T) {
if runtime.GOOS == "windows" {
t.Skip("skipping symlink test on Windows")
}

srcDir, cleanup := tempDir(t)
defer cleanup()

Expand All @@ -109,9 +113,6 @@ func TestNonUTF8SymlinkTarget(t *testing.T) {

err = os.Symlink(string(base), filepath.Join(srcDir, "link"))
if err != nil {
if runtime.GOOS == "windows" {
t.Skip("skipping symlink test on Windows")
}
t.Fatalf("os.Symlink(): %v", err)
}

Expand Down

0 comments on commit 760cf5d

Please sign in to comment.