diff options
Diffstat (limited to 'internal/gitaly/service/repository/fullpath_test.go')
-rw-r--r-- | internal/gitaly/service/repository/fullpath_test.go | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/internal/gitaly/service/repository/fullpath_test.go b/internal/gitaly/service/repository/fullpath_test.go index dea6d131e..1224e30fd 100644 --- a/internal/gitaly/service/repository/fullpath_test.go +++ b/internal/gitaly/service/repository/fullpath_test.go @@ -1,6 +1,7 @@ package repository import ( + "context" "fmt" "os" "path/filepath" @@ -11,6 +12,7 @@ import ( "gitlab.com/gitlab-org/gitaly/v14/internal/gitaly/config" "gitlab.com/gitlab-org/gitaly/v14/internal/helper" "gitlab.com/gitlab-org/gitaly/v14/internal/helper/text" + "gitlab.com/gitlab-org/gitaly/v14/internal/metadata/featureflag" "gitlab.com/gitlab-org/gitaly/v14/internal/testhelper" "gitlab.com/gitlab-org/gitaly/v14/internal/testhelper/testassert" "gitlab.com/gitlab-org/gitaly/v14/proto/go/gitalypb" @@ -19,9 +21,12 @@ import ( func TestSetFullPath(t *testing.T) { t.Parallel() - ctx, cancel := testhelper.Context() - defer cancel() + testhelper.NewFeatureSets([]featureflag.FeatureFlag{ + featureflag.TxFileLocking, + }).Run(t, testSetFullPath) +} +func testSetFullPath(t *testing.T, ctx context.Context) { cfg, client := setupRepositoryServiceWithoutRepo(t) t.Run("missing repository", func(t *testing.T) { @@ -74,8 +79,12 @@ func TestSetFullPath(t *testing.T) { require.Nil(t, response) - expectedErr := fmt.Sprintf("rpc error: code = NotFound desc = setting config: rpc "+ + expectedErr := fmt.Sprintf("rpc error: code = NotFound desc = writing config: rpc "+ "error: code = NotFound desc = GetRepoPath: not a git repository: %q", repoPath) + if featureflag.TxFileLocking.IsEnabled(ctx) { + expectedErr = fmt.Sprintf("rpc error: code = NotFound desc = setting config: rpc "+ + "error: code = NotFound desc = GetRepoPath: not a git repository: %q", repoPath) + } require.EqualError(t, err, expectedErr) }) |