diff options
author | Brian Fitzgerald <[email protected]> | 2018-03-22 22:11:35 -0700 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2018-04-05 08:35:06 +0200 |
commit | 26f34fd59da1ce1885d4f2909c5d9ef9c1726944 (patch) | |
tree | 48326058472adefb48f95113443ba141d3dcfb38 | |
parent | 730b66b6520f263af16f555d1d7be51205a8e51d (diff) | |
download | hugo-26f34fd59da1ce1885d4f2909c5d9ef9c1726944.tar.gz hugo-26f34fd59da1ce1885d4f2909c5d9ef9c1726944.zip |
Fix two tests that are broken on Windows
Put guards around TestPageBundlerCaptureSymlinks and
TestPageBundlerSiteWitSymbolicLinksInContent so that they aren't
run on Windows (they both use symbolic links and the Go library
implementation requires administrator mode on Windows).
-rw-r--r-- | hugolib/page_bundler_capture_test.go | 7 | ||||
-rw-r--r-- | hugolib/page_bundler_test.go | 4 |
2 files changed, 10 insertions, 1 deletions
diff --git a/hugolib/page_bundler_capture_test.go b/hugolib/page_bundler_capture_test.go index 6ef396d29..c07383797 100644 --- a/hugolib/page_bundler_capture_test.go +++ b/hugolib/page_bundler_capture_test.go @@ -22,6 +22,7 @@ import ( jww "github.com/spf13/jwalterweatherman" + "runtime" "strings" "sync" "testing" @@ -82,6 +83,10 @@ func (s *storeFilenames) sortedStr() string { } func TestPageBundlerCaptureSymlinks(t *testing.T) { + if runtime.GOOS == "windows" && os.Getenv("CI") == "" { + t.Skip("Skip TestPageBundlerCaptureSymlinks as os.Symlink needs administrator rights on Windows") + } + assert := require.New(t) ps, workDir := newTestBundleSymbolicSources(t) sourceSpec := source.NewSourceSpec(ps, ps.BaseFs.ContentFs) @@ -92,7 +97,7 @@ func TestPageBundlerCaptureSymlinks(t *testing.T) { assert.NoError(c.capture()) - // Symlik back to content skipped to prevent infinite recursion. + // Symlink back to content skipped to prevent infinite recursion. assert.Equal(uint64(3), logger.LogCountForLevelsGreaterThanorEqualTo(jww.LevelWarn)) expected := ` diff --git a/hugolib/page_bundler_test.go b/hugolib/page_bundler_test.go index 52b5b830d..34e4ef6e4 100644 --- a/hugolib/page_bundler_test.go +++ b/hugolib/page_bundler_test.go @@ -308,6 +308,10 @@ func TestMultilingualDisableLanguage(t *testing.T) { } func TestPageBundlerSiteWitSymbolicLinksInContent(t *testing.T) { + if runtime.GOOS == "windows" && os.Getenv("CI") == "" { + t.Skip("Skip TestPageBundlerSiteWitSymbolicLinksInContent as os.Symlink needs administrator rights on Windows") + } + assert := require.New(t) ps, workDir := newTestBundleSymbolicSources(t) cfg := ps.Cfg |