Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2020-09-08 16:21:56 +0300
committerKamil Trzcinski <ayufan@ayufan.eu>2020-09-08 16:21:56 +0300
commit00d1ddcc89a9a79dcd8008302bba6d1a927bb6ca (patch)
treed2a513f2f43e50670be3b3d3ca5d37f3828033c8 /internal/serving/disk
parent44eb753a0bb379ab5c09b7eef8d68f89b881835e (diff)
Fix `symlink` specs on OSX
The fix is a little unconventional: - we treat the absolute paths as local to `rootPath` - this actually makes sense, given that this VFS should only work in this context
Diffstat (limited to 'internal/serving/disk')
-rw-r--r--internal/serving/disk/symlink/path_test.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/internal/serving/disk/symlink/path_test.go b/internal/serving/disk/symlink/path_test.go
index 6b0a41f3..c802a410 100644
--- a/internal/serving/disk/symlink/path_test.go
+++ b/internal/serving/disk/symlink/path_test.go
@@ -26,6 +26,10 @@ func tmpDir(t *testing.T) (vfs.Root, string, func()) {
tmpDir, err := ioutil.TempDir("", "symlink_tests")
require.NoError(t, err)
+ // On some systems `/tmp` can be a symlink
+ tmpDir, err = filepath.EvalSymlinks(tmpDir)
+ require.NoError(t, err)
+
root, err := fs.Root(context.Background(), tmpDir)
require.NoError(t, err)
@@ -70,7 +74,7 @@ var EvalSymlinksTests = []EvalSymlinksTest{
{"test/link2/..", "test"},
{"test/dir/link3", "."},
{"test/link2/link3/test", "test"},
- {"test/linkabs", "../.."},
+ {"test/linkabs", "."},
{"test/link4/..", "test"},
{"src/versions/current/modules/test", "src/pool/test"},
}