@@ -33,7 +33,8 @@ const TEST_DATA: scaleUpModule.ActionRequestMessage = {
33
33
installationId : 2 ,
34
34
} ;
35
35
36
- const TEST_DATA_WITHOUT_INSTALL_ID : scaleUpModule . ActionRequestMessage = {
36
+ // installationId 0 means no installationId is set.
37
+ const TEST_DATA_WITH_ZERO_INSTALL_ID : scaleUpModule . ActionRequestMessage = {
37
38
id : 3 ,
38
39
eventType : 'workflow_job' ,
39
40
repositoryName : 'hello-world' ,
@@ -178,7 +179,7 @@ describe('scaleUp with GHES', () => {
178
179
179
180
it ( 'retrieves installation id if not set' , async ( ) => {
180
181
const spy = jest . spyOn ( ghAuth , 'createGithubAuth' ) ;
181
- await scaleUpModule . scaleUp ( 'aws:sqs' , TEST_DATA_WITHOUT_INSTALL_ID ) ;
182
+ await scaleUpModule . scaleUp ( 'aws:sqs' , TEST_DATA_WITH_ZERO_INSTALL_ID ) ;
182
183
expect ( mockOctokit . apps . getRepoInstallation ) . not . toBeCalled ( ) ;
183
184
expect ( spy ) . toHaveBeenNthCalledWith ( 1 , undefined , 'app' , 'https://github.enterprise.something/api/v3' ) ;
184
185
expect ( spy ) . toHaveBeenNthCalledWith (
@@ -278,7 +279,7 @@ describe('scaleUp with GHES', () => {
278
279
279
280
it ( 'retrieves installation id if not set' , async ( ) => {
280
281
const spy = jest . spyOn ( ghAuth , 'createGithubAuth' ) ;
281
- await scaleUpModule . scaleUp ( 'aws:sqs' , TEST_DATA_WITHOUT_INSTALL_ID ) ;
282
+ await scaleUpModule . scaleUp ( 'aws:sqs' , TEST_DATA_WITH_ZERO_INSTALL_ID ) ;
282
283
expect ( mockOctokit . apps . getOrgInstallation ) . not . toBeCalled ( ) ;
283
284
expect ( spy ) . toHaveBeenNthCalledWith ( 1 , undefined , 'app' , 'https://github.enterprise.something/api/v3' ) ;
284
285
expect ( spy ) . toHaveBeenNthCalledWith (
@@ -346,7 +347,7 @@ describe('scaleUp with public GH', () => {
346
347
347
348
it ( 'retrieves installation id if not set' , async ( ) => {
348
349
const spy = jest . spyOn ( ghAuth , 'createGithubAuth' ) ;
349
- await scaleUpModule . scaleUp ( 'aws:sqs' , TEST_DATA_WITHOUT_INSTALL_ID ) ;
350
+ await scaleUpModule . scaleUp ( 'aws:sqs' , TEST_DATA_WITH_ZERO_INSTALL_ID ) ;
350
351
expect ( mockOctokit . apps . getRepoInstallation ) . not . toBeCalled ( ) ;
351
352
expect ( spy ) . toHaveBeenNthCalledWith ( 1 , undefined , 'app' , '' ) ;
352
353
expect ( spy ) . toHaveBeenNthCalledWith ( 2 , TEST_DATA . installationId , 'installation' , '' ) ;
@@ -364,8 +365,8 @@ describe('scaleUp with public GH', () => {
364
365
beforeEach ( ( ) => {
365
366
process . env . ENABLE_ORGANIZATION_RUNNERS = 'true' ;
366
367
expectedRunnerParams = { ...EXPECTED_RUNNER_PARAMS } ;
367
- // eslint-disable-next-line max-len
368
- expectedRunnerParams . runnerServiceConfig = `--url https://github.com/${ TEST_DATA . repositoryOwner } --token 1234abcd ` ;
368
+ expectedRunnerParams . runnerServiceConfig =
369
+ `--url https://github.com/${ TEST_DATA . repositoryOwner } ` + ` --token 1234abcd `;
369
370
} ) ;
370
371
371
372
it ( 'gets the current org level runners' , async ( ) => {
@@ -427,7 +428,7 @@ describe('scaleUp with public GH', () => {
427
428
expectedRunnerParams . runnerType = 'Repo' ;
428
429
expectedRunnerParams . runnerOwner = `${ TEST_DATA . repositoryOwner } /${ TEST_DATA . repositoryName } ` ;
429
430
expectedRunnerParams . runnerServiceConfig =
430
- `--url ` + ` https://github.com/${ TEST_DATA . repositoryOwner } /${ TEST_DATA . repositoryName } ` + `--token 1234abcd ` ;
431
+ `--url https://github.com/${ TEST_DATA . repositoryOwner } /${ TEST_DATA . repositoryName } ` + `--token 1234abcd ` ;
431
432
} ) ;
432
433
433
434
it ( 'gets the current repo level runners' , async ( ) => {
@@ -463,7 +464,7 @@ describe('scaleUp with public GH', () => {
463
464
464
465
it ( 'retrieves installation id if not set' , async ( ) => {
465
466
const spy = jest . spyOn ( ghAuth , 'createGithubAuth' ) ;
466
- await scaleUpModule . scaleUp ( 'aws:sqs' , TEST_DATA_WITHOUT_INSTALL_ID ) ;
467
+ await scaleUpModule . scaleUp ( 'aws:sqs' , TEST_DATA_WITH_ZERO_INSTALL_ID ) ;
467
468
expect ( mockOctokit . apps . getOrgInstallation ) . not . toBeCalled ( ) ;
468
469
expect ( spy ) . toHaveBeenNthCalledWith ( 1 , undefined , 'app' , '' ) ;
469
470
expect ( spy ) . toHaveBeenNthCalledWith ( 2 , TEST_DATA . installationId , 'installation' , '' ) ;
0 commit comments