-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathgitlab_sync_test.go
More file actions
45 lines (41 loc) · 913 Bytes
/
gitlab_sync_test.go
File metadata and controls
45 lines (41 loc) · 913 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package main
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestStartPipeline(t *testing.T) {
testCases := map[string]struct {
branchName string
expectedResult bool
}{
"start client pipeline 1": {
branchName: "master",
expectedResult: true,
},
"start client pipeline 2": {
branchName: "staging",
expectedResult: true,
},
"start client pipeline 3": {
branchName: "production",
expectedResult: true,
},
"start client pipeline 5": {
branchName: "3.1.x",
expectedResult: true,
},
"start client pipeline 6": {
branchName: "pr_1",
expectedResult: true,
},
"do not start client pipeline 1": {
branchName: "other-branch",
expectedResult: false,
},
}
for name, tc := range testCases {
t.Run(name, func(t *testing.T) {
assert.Equal(t, tc.expectedResult, shouldStartPipeline(tc.branchName))
})
}
}