@@ -46,8 +46,8 @@ describe('cli Configuration', () => {
4646 project : 'auto'
4747 } ;
4848
49- const cliClient = new TicsCli ( Mode . CLIENT ) ;
50- const cliDiagnostic = new TicsCli ( Mode . DIAGNOSTIC ) ;
49+ const cliClient = new TicsCli ( Mode . CLIENT , 'repoName' ) ;
50+ const cliDiagnostic = new TicsCli ( Mode . DIAGNOSTIC , 'repoName' ) ;
5151
5252 expect ( cliClient ) . toMatchObject ( { ...expectCli , project : 'auto' , calc : 'GATE' } ) ;
5353 expect ( cliDiagnostic ) . toMatchObject ( { ...expectCli , project : 'auto' } ) ;
@@ -58,8 +58,8 @@ describe('cli Configuration', () => {
5858 project : 'project'
5959 } ;
6060
61- const cliClient = new TicsCli ( Mode . CLIENT ) ;
62- const cliDiagnostic = new TicsCli ( Mode . DIAGNOSTIC ) ;
61+ const cliClient = new TicsCli ( Mode . CLIENT , 'repoName' ) ;
62+ const cliDiagnostic = new TicsCli ( Mode . DIAGNOSTIC , 'repoName' ) ;
6363
6464 expect ( cliClient ) . toMatchObject ( { ...expectCli , project : 'project' , calc : 'GATE' } ) ;
6565 expect ( cliDiagnostic ) . toMatchObject ( { ...expectCli , project : 'project' } ) ;
@@ -71,21 +71,32 @@ describe('cli Configuration', () => {
7171 branchdir : 'dir'
7272 } ;
7373
74- const cliServer = new TicsCli ( Mode . QSERVER ) ;
74+ const cliServer = new TicsCli ( Mode . QSERVER , 'repoName' ) ;
7575
7676 expect ( cliServer ) . toMatchObject ( { ...expectCli , branchdir : 'dir' , project : 'project' } ) ;
7777 } ) ;
7878
79- it ( 'should throw error if mode is qserver, project is auto and GITHUB_WORKSPACE is not available ' , ( ) => {
79+ it ( 'should use repository name when mode is qserver and project is auto ' , ( ) => {
8080 values = {
81- project : 'auto'
81+ project : 'auto' ,
82+ branchdir : 'dir'
8283 } ;
8384
85+ const cliServer = new TicsCli ( Mode . QSERVER , 'repoName' ) ;
86+
87+ expect ( cliServer ) . toMatchObject ( { ...expectCli , branchdir : 'dir' , project : 'repoName' } ) ;
88+ } ) ;
89+
90+ it ( 'should throw error if mode is qserver, branchdir is not given and GITHUB_WORKSPACE is not available' , ( ) => {
8491 const GITHUB_WORKSPACE = process . env . GITHUB_WORKSPACE ;
8592 delete process . env . GITHUB_WORKSPACE ;
93+ values = {
94+ branchdir : ''
95+ } ;
96+
8697 let error : any ;
8798 try {
88- new TicsCli ( Mode . QSERVER ) ;
99+ new TicsCli ( Mode . QSERVER , 'repoName' ) ;
89100 } catch ( err ) {
90101 error = err ;
91102 }
@@ -100,7 +111,7 @@ describe('cli Configuration', () => {
100111 project : 'project'
101112 } ;
102113 process . env . GITHUB_WORKSPACE = '/workspace/project' ;
103- const cliServer = new TicsCli ( Mode . QSERVER ) ;
114+ const cliServer = new TicsCli ( Mode . QSERVER , 'repoName' ) ;
104115
105116 expect ( cliServer ) . toMatchObject ( { project : 'project' , branchdir : '/workspace/project' } ) ;
106117 } ) ;
@@ -113,7 +124,7 @@ describe('cli Configuration', () => {
113124
114125 let error : any ;
115126 try {
116- new TicsCli ( Mode . QSERVER ) ;
127+ new TicsCli ( Mode . QSERVER , 'repoName' ) ;
117128 } catch ( err ) {
118129 error = err ;
119130 }
@@ -137,7 +148,7 @@ describe('cli Configuration', () => {
137148 additionalFlags : '-log 9'
138149 } ;
139150
140- const cliServer = new TicsCli ( Mode . QSERVER ) ;
151+ const cliServer = new TicsCli ( Mode . QSERVER , 'repoName' ) ;
141152
142153 expect ( cliServer ) . toMatchObject ( {
143154 project : 'project' ,
@@ -173,7 +184,7 @@ describe('cli Configuration', () => {
173184 additionalFlags : '-log 9'
174185 } ;
175186
176- const cliClient = new TicsCli ( Mode . CLIENT ) ;
187+ const cliClient = new TicsCli ( Mode . CLIENT , 'repoName' ) ;
177188
178189 expect ( cliClient ) . toMatchObject ( {
179190 project : 'project' ,
@@ -208,7 +219,7 @@ describe('cli Configuration', () => {
208219 additionalFlags : '-log 9'
209220 } ;
210221
211- const cliDiagnostic = new TicsCli ( Mode . DIAGNOSTIC ) ;
222+ const cliDiagnostic = new TicsCli ( Mode . DIAGNOSTIC , 'repoName' ) ;
212223
213224 expect ( cliDiagnostic ) . toMatchObject ( {
214225 project : 'project' ,
0 commit comments