diff options
Diffstat (limited to 'internal/gitaly/service/ref/refs_test.go')
-rw-r--r-- | internal/gitaly/service/ref/refs_test.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/internal/gitaly/service/ref/refs_test.go b/internal/gitaly/service/ref/refs_test.go index aa4e0faff..5f3ec6b38 100644 --- a/internal/gitaly/service/ref/refs_test.go +++ b/internal/gitaly/service/ref/refs_test.go @@ -1212,3 +1212,23 @@ func TestInvalidFindTagRequest(t *testing.T) { }) } } + +func TestNotFoundFindTagRequest(t *testing.T) { + t.Parallel() + testhelper.NewFeatureSets(featureflag.FindTagNotFound).Run(t, testNotFoundFindTagRequest) +} + +func testNotFoundFindTagRequest(t *testing.T, ctx context.Context) { + t.Parallel() + + _, repoProto, _, client := setupRefService(ctx, t) + + rpcRequest := &gitalypb.FindTagRequest{Repository: repoProto, TagName: []byte("not-found")} + + _, err := client.FindTag(ctx, rpcRequest) + if featureflag.FindTagNotFound.IsEnabled(ctx) { + testhelper.RequireGrpcError(t, err, helper.ErrNotFoundf("no tag found")) + return + } + testhelper.RequireGrpcError(t, err, helper.ErrInternalf("no tag found")) +} |