diff options
Diffstat (limited to 'internal/gitaly/service/objectpool/link_test.go')
-rw-r--r-- | internal/gitaly/service/objectpool/link_test.go | 34 |
1 files changed, 6 insertions, 28 deletions
diff --git a/internal/gitaly/service/objectpool/link_test.go b/internal/gitaly/service/objectpool/link_test.go index bd516a521..9b58be35a 100644 --- a/internal/gitaly/service/objectpool/link_test.go +++ b/internal/gitaly/service/objectpool/link_test.go @@ -1,18 +1,14 @@ package objectpool import ( - "context" "os" "path/filepath" "testing" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "gitlab.com/gitlab-org/gitaly/v14/internal/git" "gitlab.com/gitlab-org/gitaly/v14/internal/git/gittest" "gitlab.com/gitlab-org/gitaly/v14/internal/git/localrepo" - "gitlab.com/gitlab-org/gitaly/v14/internal/gitaly/storage" - "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/testserver" "gitlab.com/gitlab-org/gitaly/v14/proto/go/gitalypb" @@ -20,10 +16,8 @@ import ( ) func TestLink(t *testing.T) { - testhelper.NewFeatureSets(featureflag.LinkRepositoryToObjectPoolNotFound).Run(t, testLink) -} + ctx := testhelper.Context(t) -func testLink(t *testing.T, ctx context.Context) { cfg, repo, _, _, client := setup(ctx, t, testserver.WithDisablePraefect()) localRepo := localrepo.NewTestRepo(t, cfg, repo) @@ -89,10 +83,8 @@ func testLink(t *testing.T, ctx context.Context) { } func TestLinkIdempotent(t *testing.T) { - testhelper.NewFeatureSets(featureflag.LinkRepositoryToObjectPoolNotFound).Run(t, testLinkIdempotent) -} + ctx := testhelper.Context(t) -func testLinkIdempotent(t *testing.T, ctx context.Context) { cfg, repoProto, _, _, client := setup(ctx, t) pool := initObjectPool(t, cfg, cfg.Storages[0]) @@ -141,11 +133,9 @@ func TestLinkNoClobber(t *testing.T) { } func TestLinkNoPool(t *testing.T) { - testhelper.NewFeatureSets(featureflag.LinkRepositoryToObjectPoolNotFound).Run(t, testLinkNoPool) -} + ctx := testhelper.Context(t) -func testLinkNoPool(t *testing.T, ctx context.Context) { - cfg, repo, _, locator, client := setup(ctx, t) + cfg, repo, _, _, client := setup(ctx, t) pool := initObjectPool(t, cfg, cfg.Storages[0]) _, err := client.CreateObjectPool(ctx, &gitalypb.CreateObjectPoolRequest{ @@ -165,18 +155,6 @@ func testLinkNoPool(t *testing.T, ctx context.Context) { } _, err = client.LinkRepositoryToObjectPool(ctx, request) - if featureflag.LinkRepositoryToObjectPoolNotFound.IsEnabled(ctx) { - testhelper.RequireGrpcCode(t, err, codes.NotFound) - require.Error(t, err, "GetRepoPath: not a git repository:") - return - } - - require.NoError(t, err) - - pool = rewrittenObjectPool(ctx, t, cfg, pool) - - poolRepoPath, err := locator.GetRepoPath(pool) - require.NoError(t, err) - - assert.True(t, storage.IsGitDirectory(poolRepoPath)) + testhelper.RequireGrpcCode(t, err, codes.NotFound) + require.Error(t, err, "GetRepoPath: not a git repository:") } |