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:
authorWill Chandler <wchandler@gitlab.com>2022-07-07 23:52:32 +0300
committerWill Chandler <wchandler@gitlab.com>2022-07-07 23:52:32 +0300
commit9aac5e46400ec5b04b43c2290b2a76c7965c2e3b (patch)
tree28a488c19b25ec73144057fd646bae7bb4bc87bf /internal/testhelper
parent888f9cc26f2021e455cf2c7c46f2b3d123d06a88 (diff)
parent139c4ec5ca2f050080577b20e3d14a1b16d97145 (diff)
Merge branch 'pks-remove-raw-feature-flags' into 'master'
featureflag: Remove raw feature flags See merge request gitlab-org/gitaly!4675
Diffstat (limited to 'internal/testhelper')
-rw-r--r--internal/testhelper/featureset_test.go15
1 files changed, 6 insertions, 9 deletions
diff --git a/internal/testhelper/featureset_test.go b/internal/testhelper/featureset_test.go
index ddbb8652c..f3311b7d2 100644
--- a/internal/testhelper/featureset_test.go
+++ b/internal/testhelper/featureset_test.go
@@ -171,15 +171,12 @@ func TestNewFeatureSetsWithRubyFlags(t *testing.T) {
}
func TestFeatureSets_Run(t *testing.T) {
- // This test depends on feature flags being default-enabled in the test
- // context, which requires those flags to exist in the ff.All slice. So
- // let's just append them here so we do not need to use a "real"
- // feature flag, as that would require constant change when we remove
- // old feature flags.
- defer func(old []ff.FeatureFlag) {
- ff.All = old
- }(ff.All)
- ff.All = append(ff.All, featureFlagA, featureFlagB)
+ // Define two default-enabled feature flags. Note that with `NewFeatureFlag()`, we
+ // automatically add them to the list of defined feature flags. While this is stateful and
+ // would theoretically also impact other tests, we don't really need to mind that given
+ // that we use test-specific names for the flags here.
+ featureFlagA := ff.NewFeatureFlag("global_feature_flag_a", "", "", true)
+ featureFlagB := ff.NewFeatureFlag("global_feature_flag_b", "", "", true)
var featureFlags [][2]bool
NewFeatureSets(featureFlagB, featureFlagA).Run(t, func(t *testing.T, ctx context.Context) {