From e25375ca22088a588e9b2783c7efb816b816bd27 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Tue, 1 May 2018 14:17:35 -0700 Subject: [PATCH] schema: skip symlink tests on Windows Change-Id: I7b076d886883ac0ed19df0cc5d3797cfc04b1c75 --- pkg/schema/schema_test.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pkg/schema/schema_test.go b/pkg/schema/schema_test.go index 13895084d..adbdd4b08 100644 --- a/pkg/schema/schema_test.go +++ b/pkg/schema/schema_test.go @@ -24,6 +24,7 @@ import ( "os" "path/filepath" "reflect" + "runtime" "strings" "testing" "time" @@ -79,6 +80,9 @@ func TestSymlink(t *testing.T) { symFile := filepath.Join(td, "test-symlink") if err := os.Symlink("test-target", symFile); err != nil { + if runtime.GOOS == "windows" { + t.Skip("skipping symlink test on Windows") + } t.Fatal(err) } @@ -576,9 +580,15 @@ func TestStaticFileAndStaticSymlink(t *testing.T) { target := "bar" src := filepath.Join(dir, "foo") err = os.Symlink(target, src) + if err != nil { + if runtime.GOOS == "windows" { + t.Skip("skipping symlink test on Windows") + } + t.Fatal(err) + } fi, err = os.Lstat(src) if err != nil { - t.Fatalf("os.Lstat(): %v", err) + t.Fatalf("os.Lstat(): %v", err) } bb = NewCommonFileMap(src, fi)