helpers: Skip TestGetRealPath on Windows when not in CI
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sun, 18 Sep 2016 20:04:32 +0000 (22:04 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sun, 18 Sep 2016 20:04:32 +0000 (22:04 +0200)
`os.Symlink` needs administrator rights on Windows,
and this seems to be the simplest fix while still getting the tests run on Appveyor.

Fixes #2476

helpers/path_test.go

index 9ce61b26972ce65fb313e0a62a15a7ce2f8e8064..cbdcd8da2090f7a57ae3838e7e44d2019b0e8b9a 100644 (file)
@@ -146,6 +146,10 @@ func TestGetRelativePath(t *testing.T) {
 }
 
 func TestGetRealPath(t *testing.T) {
+       if runtime.GOOS == "windows" && os.Getenv("CI") == "" {
+               t.Skip("Skip TestGetRealPath as os.Symlink needs administrator rights on Windows")
+       }
+
        d1, err := ioutil.TempDir("", "d1")
        defer os.Remove(d1)
        fs := afero.NewOsFs()