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:
Diffstat (limited to 'internal/git2go/featureflags_test.go')
-rw-r--r--internal/git2go/featureflags_test.go72
1 files changed, 0 insertions, 72 deletions
diff --git a/internal/git2go/featureflags_test.go b/internal/git2go/featureflags_test.go
deleted file mode 100644
index db2a35992..000000000
--- a/internal/git2go/featureflags_test.go
+++ /dev/null
@@ -1,72 +0,0 @@
-package git2go
-
-import (
- "context"
- "encoding/gob"
- "testing"
-
- "github.com/stretchr/testify/require"
- "gitlab.com/gitlab-org/gitaly/v16/internal/featureflag"
- "gitlab.com/gitlab-org/gitaly/v16/internal/git/gittest"
- "gitlab.com/gitlab-org/gitaly/v16/internal/git/localrepo"
- "gitlab.com/gitlab-org/gitaly/v16/internal/gitaly/config"
- "gitlab.com/gitlab-org/gitaly/v16/internal/gitaly/storage"
- "gitlab.com/gitlab-org/gitaly/v16/internal/testhelper"
- "gitlab.com/gitlab-org/gitaly/v16/internal/testhelper/testcfg"
-)
-
-func (b *Executor) FeatureFlags(ctx context.Context, repo storage.Repository) ([]FeatureFlag, error) {
- output, err := b.run(ctx, repo, nil, "feature-flags")
- if err != nil {
- return nil, err
- }
-
- var result FeatureFlags
- if err := gob.NewDecoder(output).Decode(&result); err != nil {
- return nil, err
- }
-
- if result.Err != nil {
- return nil, result.Err
- }
-
- return result.Flags, err
-}
-
-var (
- featureA = featureflag.NewFeatureFlag("feature_a", "", "", false)
- featureB = featureflag.NewFeatureFlag("feature_b", "", "", true)
-)
-
-func TestExecutor_explicitFeatureFlags(t *testing.T) {
- testhelper.NewFeatureSets(featureA, featureB).Run(t, testExecutorFeatureFlags)
-}
-
-func testExecutorFeatureFlags(t *testing.T, ctx context.Context) {
- cfg := testcfg.Build(t)
- testcfg.BuildGitalyGit2Go(t, cfg)
-
- repoProto, _ := gittest.CreateRepository(t, ctx, cfg, gittest.CreateRepositoryConfig{
- SkipCreationViaService: true,
- })
-
- repo := localrepo.NewTestRepo(t, cfg, repoProto)
-
- executor := NewExecutor(cfg, gittest.NewCommandFactory(t, cfg), config.NewLocator(cfg), testhelper.SharedLogger(t))
-
- flags, err := executor.FeatureFlags(ctx, repo)
- require.NoError(t, err)
-
- require.Subset(t, flags, []FeatureFlag{
- {
- Name: "feature_a",
- MetadataKey: "gitaly-feature-feature-a",
- Value: featureA.IsEnabled(ctx),
- },
- {
- Name: "feature_b",
- MetadataKey: "gitaly-feature-feature-b",
- Value: featureB.IsEnabled(ctx),
- },
- }, flags)
-}