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>2020-09-21 13:39:09 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2020-09-22 11:14:26 +0300
commit542161b021db9c7304edc446b153c8d7478f237b (patch)
tree2a5d3bb5e7e783e9fdced56671f75763a443363f
parenta47a6e833185edde8bb907b9930d1a3509850d8c (diff)
operations: Generalize feature flag test helper
Generalize the feature flag test helper currently used to test UserMergeBranch both with the Go and Ruby implementation. This enables easier reuse for UserMergeToRef.
-rw-r--r--internal/gitaly/service/operations/merge_test.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/internal/gitaly/service/operations/merge_test.go b/internal/gitaly/service/operations/merge_test.go
index 691e07a2e..dd4a56fe6 100644
--- a/internal/gitaly/service/operations/merge_test.go
+++ b/internal/gitaly/service/operations/merge_test.go
@@ -25,7 +25,7 @@ var (
mergeBranchHeadBefore = "281d3a76f31c812dbf48abce82ccf6860adedd81"
)
-func testUserMergeBranch(t *testing.T, testcase func(*testing.T, context.Context)) {
+func testWithFeature(t *testing.T, feature featureflag.FeatureFlag, testcase func(*testing.T, context.Context)) {
featureSets, err := testhelper.NewFeatureSets([]featureflag.FeatureFlag{
featureflag.GoUserMergeBranch,
})
@@ -44,7 +44,7 @@ func testUserMergeBranch(t *testing.T, testcase func(*testing.T, context.Context
}
func TestSuccessfulMerge(t *testing.T) {
- testUserMergeBranch(t, testSuccessfulMerge)
+ testWithFeature(t, featureflag.GoUserMergeBranch, testSuccessfulMerge)
}
func testSuccessfulMerge(t *testing.T, ctx context.Context) {
@@ -121,7 +121,7 @@ func testSuccessfulMerge(t *testing.T, ctx context.Context) {
}
func TestAbortedMerge(t *testing.T) {
- testUserMergeBranch(t, testAbortedMerge)
+ testWithFeature(t, featureflag.GoUserMergeBranch, testAbortedMerge)
}
func testAbortedMerge(t *testing.T, ctx context.Context) {
@@ -190,7 +190,7 @@ func testAbortedMerge(t *testing.T, ctx context.Context) {
}
func TestFailedMergeConcurrentUpdate(t *testing.T) {
- testUserMergeBranch(t, testFailedMergeConcurrentUpdate)
+ testWithFeature(t, featureflag.GoUserMergeBranch, testFailedMergeConcurrentUpdate)
}
func testFailedMergeConcurrentUpdate(t *testing.T, ctx context.Context) {
@@ -238,7 +238,7 @@ func testFailedMergeConcurrentUpdate(t *testing.T, ctx context.Context) {
}
func TestFailedMergeDueToHooks(t *testing.T) {
- testUserMergeBranch(t, testFailedMergeDueToHooks)
+ testWithFeature(t, featureflag.GoUserMergeBranch, testFailedMergeDueToHooks)
}
func testFailedMergeDueToHooks(t *testing.T, ctx context.Context) {