@@ -79,7 +79,7 @@ test.serial('Verify token and repository access (group_access 40)', async t => {
7979 t . true ( gitlab . isDone ( ) ) ;
8080} ) ;
8181
82- test . serial ( 'Verify token and repository access and custom URL' , async t => {
82+ test . serial ( 'Verify token and repository access and custom URL with prefix ' , async t => {
8383 const owner = 'test_user' ;
8484 const repo = 'test_repo' ;
8585 process . env . GL_TOKEN = 'gitlab_token' ;
@@ -101,6 +101,23 @@ test.serial('Verify token and repository access and custom URL', async t => {
101101 t . deepEqual ( t . context . log . args [ 0 ] , [ 'Verify GitLab authentication (%s)' , 'https://othertesturl.com:9090/prefix' ] ) ;
102102} ) ;
103103
104+ test . serial ( 'Verify token and repository access and custom URL without prefix' , async t => {
105+ const owner = 'test_user' ;
106+ const repo = 'test_repo' ;
107+ process . env . GL_TOKEN = 'gitlab_token' ;
108+ const gitlabUrl = 'https://othertesturl.com:9090' ;
109+ const gitlab = authenticate ( { gitlabUrl} )
110+ . get ( `/projects/${ owner } %2F${ repo } ` )
111+ . reply ( 200 , { permissions : { project_access : { access_level : 40 } } } ) ;
112+
113+ await t . notThrows (
114+ verify ( { gitlabUrl
} , { repositoryUrl :
`[email protected] :${ owner } /${ repo } .git` } , t . context . logger ) 115+ ) ;
116+
117+ t . true ( gitlab . isDone ( ) ) ;
118+ t . deepEqual ( t . context . log . args [ 0 ] , [ 'Verify GitLab authentication (%s)' , 'https://othertesturl.com:9090/api/v4' ] ) ;
119+ } ) ;
120+
104121test . serial ( 'Verify token and repository access with subgroup git URL' , async t => {
105122 const repoUri = 'orga/subgroup/test_user/test_repo' ;
106123 process . env . GL_TOKEN = 'gitlab_token' ;
@@ -160,7 +177,7 @@ test.serial('Verify token and repository access with empty gitlabApiPathPrefix',
160177 ) ;
161178
162179 t . true ( gitlab . isDone ( ) ) ;
163- t . deepEqual ( t . context . log . args [ 0 ] , [ 'Verify GitLab authentication (%s)' , 'https://othertesturl.com:9090/ ' ] ) ;
180+ t . deepEqual ( t . context . log . args [ 0 ] , [ 'Verify GitLab authentication (%s)' , 'https://othertesturl.com:9090' ] ) ;
164181} ) ;
165182
166183test . serial ( 'Verify token and repository with environment variables' , async t => {
0 commit comments