@@ -31,7 +31,7 @@ class TestBitbucketServerRepositoryProvider {
31
31
verified : true ,
32
32
description : "" ,
33
33
icon : "" ,
34
- host : "bitbucket.gitpod-self-hosted .com" ,
34
+ host : "bitbucket.gitpod-dev .com" ,
35
35
oauth : {
36
36
callBackUrl : "" ,
37
37
clientId : "not-used" ,
@@ -84,51 +84,72 @@ class TestBitbucketServerRepositoryProvider {
84
84
}
85
85
86
86
@test async test_getRepo_ok ( ) {
87
- const result = await this . service . getRepo ( this . user , "JLDEC " , "jldec-repo-march-30 " ) ;
87
+ const result = await this . service . getRepo ( this . user , "TES " , "2k-repos-1076 " ) ;
88
88
expect ( result ) . to . deep . include ( {
89
- webUrl : "https://bitbucket.gitpod-self-hosted .com/projects/JLDEC /repos/jldec-repo-march-30 " ,
90
- cloneUrl : "https://bitbucket.gitpod-self-hosted .com/scm/jldec/jldec-repo-march-30 .git" ,
89
+ webUrl : "https://bitbucket.gitpod-dev .com/projects/TES /repos/2k-repos-1076 " ,
90
+ cloneUrl : "https://bitbucket.gitpod-dev .com/scm/tes/2k-repos-1076 .git" ,
91
91
} ) ;
92
92
}
93
93
94
94
@test async test_getBranch_ok ( ) {
95
- const result = await this . service . getBranch ( this . user , "JLDEC " , "jldec-repo-march-30 " , "main " ) ;
95
+ const result = await this . service . getBranch ( this . user , "TES " , "2k-repos-0 " , "frozen/master " ) ;
96
96
expect ( result ) . to . deep . include ( {
97
- name : "main" ,
97
+ name : "frozen/master" ,
98
+ commit : {
99
+ author : "Admin" ,
100
+ authorAvatarUrl : "https://secure.gravatar.com/avatar/30cfcf1a839db721063f3c812558bf1e.jpg?s=64&d=mm" ,
101
+ authorDate : "2024-09-20T14:21:19.000Z" ,
102
+ commitMessage : "a test push" ,
103
+ sha : "fb6e71e9a26215a37fd940253e3f996224fbfb2a" ,
104
+ } ,
98
105
} ) ;
99
106
}
100
107
101
108
@test async test_getBranches_ok ( ) {
102
- const result = await this . service . getBranches ( this . user , "JLDEC " , "jldec-repo-march-30 " ) ;
109
+ const result = await this . service . getBranches ( this . user , "TES " , "2k-repos-0 " ) ;
103
110
expect ( result . length ) . to . be . gte ( 1 ) ;
104
111
expect ( result [ 0 ] ) . to . deep . include ( {
105
- name : "main " ,
112
+ name : "master " ,
106
113
} ) ;
107
114
}
108
115
109
116
@test async test_getBranches_ok_2 ( ) {
110
- try {
111
- await this . service . getBranches ( this . user , "mil" , "gitpod-large-image" ) ;
112
- expect . fail ( "this should not happen while 'mil/gitpod-large-image' has NO default branch configured." ) ;
113
- } catch ( error ) {
114
- expect ( error . message ) . to . include (
115
- "refs/heads/master is set as the default branch, but this branch does not exist" ,
116
- ) ;
117
- }
117
+ const response = await this . service . getBranches ( this . user , "TES" , "2k-repos-1076" ) ;
118
+ expect ( response . length ) . to . eq ( 0 ) ;
119
+ }
120
+
121
+ @test async test_getCommitHistory_ok ( ) {
122
+ const revision = "2781809c095c8cf53c60a524499a9a74649ab506" ;
123
+ const result = await this . service . getCommitHistory ( this . user , "filip" , "spring-petclinic" , revision , 100 ) ;
124
+ // the unwritten rule is that the revision is not included in the result
125
+ // where needed, the caller can add it to the result artificially
126
+ // see for example getCommitHistoryForContext in src/prebuilds/incremental-workspace-service.ts
127
+ expect ( result ) . to . not . deep . include ( revision ) ;
128
+ expect ( result . length ) . to . equal ( 16 ) ;
118
129
}
119
130
120
131
@test async test_getCommitInfo_ok ( ) {
121
- const result = await this . service . getCommitInfo ( this . user , "JLDEC" , "jldec-repo-march-30" , "test" ) ;
122
- expect ( result ) . to . deep . include ( {
123
- author : "Alex Tugarev" ,
124
- } ) ;
132
+ const result = await this . service . getCommitInfo (
133
+ this . user ,
134
+ "TES" ,
135
+ "2k-repos-0" ,
136
+ "fb6e71e9a26215a37fd940253e3f996224fbfb2a" ,
137
+ ) ;
138
+ expect ( result ) . to . not . be . undefined ;
139
+ expect ( result ?. author ) . to . equal ( "Admin" ) ;
140
+ }
141
+
142
+ @test async test_getCommitInfo_ok_2 ( ) {
143
+ const result = await this . service . getCommitInfo ( this . user , "TES" , "2k-repos-0" , "frozen/master" ) ;
144
+ expect ( result ) . to . not . be . undefined ;
145
+ expect ( result ?. author ) . to . equal ( "Admin" ) ;
125
146
}
126
147
127
148
@test async test_getUserRepos_ok ( ) {
128
149
const result = await this . service . getUserRepos ( this . user ) ;
129
- expect ( result ) . to . contain ( {
130
- url : "https://7990-alextugarev-bbs-6v0gqcpgvj7.ws-eu102.gitpod.io /scm/~alex.tugarev/user.repo .git" ,
131
- name : "user.repo " ,
150
+ expect ( result ) . to . deep . include ( {
151
+ url : "https://bitbucket.gitpod-dev.com /scm/tes/2k-repos-1076 .git" ,
152
+ name : "2k-repos-1076 " ,
132
153
} ) ;
133
154
}
134
155
}
0 commit comments