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

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSami Hiltunen <shiltunen@gitlab.com>2021-02-02 14:44:26 +0300
committerSami Hiltunen <shiltunen@gitlab.com>2021-02-02 14:44:26 +0300
commitf747aef48c410f5177e9e3c3446132870dc74cd7 (patch)
treed4c47890826c321fa669eb2536a79034e699e690
parent09737ad4cd3774508d682ac23cfee8cd8d4a1156 (diff)
evaluate repo path's symlinks in UserUpdateBranch tests
macOS' default temporary directory is under '/var/...'. '/var' is a symlink to '/private/var'. UserUpdateBranch tests compare the full path with symlinks evaluated to a path that does not have the symlinks expanded, causing the test to fail on macOS. This commit evaluates the symlinks prior to comparing the two paths to fix this.
-rw-r--r--internal/gitaly/service/operations/update_branches_test.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/internal/gitaly/service/operations/update_branches_test.go b/internal/gitaly/service/operations/update_branches_test.go
index f31641202..859889748 100644
--- a/internal/gitaly/service/operations/update_branches_test.go
+++ b/internal/gitaly/service/operations/update_branches_test.go
@@ -4,6 +4,7 @@ import (
"context"
"crypto/sha1"
"fmt"
+ "path/filepath"
"testing"
"github.com/stretchr/testify/require"
@@ -233,6 +234,13 @@ func testFailedUserUpdateBranchDueToHooks(t *testing.T, ctx context.Context) {
testRepo, testRepoPath, cleanupFn := testhelper.NewTestRepo(t)
defer cleanupFn()
+ // macOS' default tmp directory is under /var/... but /var itself is a symlink
+ // to /private/var. The repository path in the environment variables has its symlinked
+ // evaluated, causing the comparison to fail, thus we evaluate them here already so the
+ // assertion later works.
+ testRepoPath, err := filepath.EvalSymlinks(testRepoPath)
+ require.NoError(t, err)
+
serverSocketPath, stop := runOperationServiceServer(t)
defer stop()