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:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2022-12-19 13:04:07 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2022-12-20 15:34:21 +0300
commit4736d2f10b927168795aae8d7fcbc30a563efdcc (patch)
tree50af0f005c8c09a577695bd10f16e95a7c68b050
parent11acb91a062e08f9d6d741005010d1a8185b0b69 (diff)
localrepo: Verify errors returned by `Path()` in tests
Fully verify errors returned by `Path()` in some of our testcases instead of only verifying the gRPC error code.
-rw-r--r--internal/git/localrepo/paths_test.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/git/localrepo/paths_test.go b/internal/git/localrepo/paths_test.go
index d5a38e25e..974110f13 100644
--- a/internal/git/localrepo/paths_test.go
+++ b/internal/git/localrepo/paths_test.go
@@ -10,7 +10,7 @@ import (
"gitlab.com/gitlab-org/gitaly/v15/internal/git/localrepo"
"gitlab.com/gitlab-org/gitaly/v15/internal/git/quarantine"
"gitlab.com/gitlab-org/gitaly/v15/internal/gitaly/config"
- "gitlab.com/gitlab-org/gitaly/v15/internal/helper"
+ "gitlab.com/gitlab-org/gitaly/v15/internal/structerr"
"gitlab.com/gitlab-org/gitaly/v15/internal/testhelper"
"gitlab.com/gitlab-org/gitaly/v15/internal/testhelper/testcfg"
"gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb"
@@ -43,7 +43,7 @@ func TestRepo_Path(t *testing.T) {
require.NoError(t, os.RemoveAll(repoPath))
_, err := repo.Path()
- require.Equal(t, codes.NotFound, helper.GrpcCode(err))
+ require.Equal(t, structerr.NewNotFound("GetRepoPath: not a git repository: %q", repoPath), err)
})
t.Run("non-git repository", func(t *testing.T) {
@@ -58,7 +58,7 @@ func TestRepo_Path(t *testing.T) {
require.NoError(t, os.MkdirAll(repoPath, 0o777))
_, err := repo.Path()
- require.Equal(t, codes.NotFound, helper.GrpcCode(err))
+ require.Equal(t, structerr.NewNotFound("GetRepoPath: not a git repository: %q", repoPath), err)
})
}