@@ -29,6 +29,12 @@ func TestGitHubContexts(t *testing.T) {
29
29
WorkspaceRoot : "/workspace/gitpod" ,
30
30
ExpectedBranch : "main" ,
31
31
},
32
+ {
33
+ Name : "open branch" ,
34
+ ContextURL : "github.com/gitpod-io/gitpod-test-repo/integration-test-1" ,
35
+ WorkspaceRoot : "/workspace/gitpod-test-repo" ,
36
+ ExpectedBranch : "integration-test-1" ,
37
+ },
32
38
{
33
39
Name : "open issue" ,
34
40
ContextURL : "github.com/gitpod-io/gitpod-test-repo/issues/88" ,
@@ -45,6 +51,36 @@ func TestGitHubContexts(t *testing.T) {
45
51
runContextTests (t , tests )
46
52
}
47
53
54
+ func TestGitLabContexts (t * testing.T ) {
55
+ tests := []ContextTest {
56
+ {
57
+ Name : "open repository" ,
58
+ ContextURL : "gitlab.com/AlexTugarev/gp-test" ,
59
+ WorkspaceRoot : "/workspace/gp-test" ,
60
+ ExpectedBranch : "main" ,
61
+ },
62
+ {
63
+ Name : "open branch" ,
64
+ ContextURL : "gitlab.com/AlexTugarev/gp-test/tree/wip" ,
65
+ WorkspaceRoot : "/workspace/gp-test" ,
66
+ ExpectedBranch : "wip" ,
67
+ },
68
+ {
69
+ Name : "open issue" ,
70
+ ContextURL : "gitlab.com/AlexTugarev/gp-test/issues/1" ,
71
+ WorkspaceRoot : "/workspace/gp-test" ,
72
+ ExpectedBranch : "main" ,
73
+ },
74
+ {
75
+ Name : "open tag" ,
76
+ ContextURL : "gitlab.com/AlexTugarev/gp-test/merge_requests/2" ,
77
+ WorkspaceRoot : "/workspace/gp-test" ,
78
+ ExpectedBranch : "HEAD" ,
79
+ },
80
+ }
81
+ runContextTests (t , tests )
82
+ }
83
+
48
84
func runContextTests (t * testing.T , tests []ContextTest ) {
49
85
for _ , test := range tests {
50
86
t .Run (test .ContextURL , func (t * testing.T ) {
0 commit comments