Skip to content

Commit c777eae

Browse files
committed
Rebase
fix: terraform error fix: terraform error fix: test and linter runner labels can be a subset runner labels can be a subset Update readme, add check_riun and workflow_job scenario's improve logging, revert change in default example review comments Rebase fix: terraform error fix: terraform error fix: test and linter runner labels can be a subset runner labels can be a subset Update readme, add check_riun and workflow_job scenario's improve logging, revert change in default example review comments
1 parent f51e37f commit c777eae

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

modules/runners/lambdas/runners/src/scale-runners/scale-up.test.ts

+8-7
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ const TEST_DATA: scaleUpModule.ActionRequestMessage = {
3737
installationId: 2,
3838
};
3939

40-
const TEST_DATA_WITHOUT_INSTALL_ID: scaleUpModule.ActionRequestMessage = {
40+
// installationId 0 means no installationId is set.
41+
const TEST_DATA_WITH_ZERO_INSTALL_ID: scaleUpModule.ActionRequestMessage = {
4142
id: 3,
4243
eventType: 'workflow_job',
4344
repositoryName: 'hello-world',
@@ -191,7 +192,7 @@ describe('scaleUp with GHES', () => {
191192

192193
it('retrieves installation id if not set', async () => {
193194
const spy = jest.spyOn(ghAuth, 'createGithubAuth');
194-
await scaleUpModule.scaleUp('aws:sqs', TEST_DATA_WITHOUT_INSTALL_ID);
195+
await scaleUpModule.scaleUp('aws:sqs', TEST_DATA_WITH_ZERO_INSTALL_ID);
195196
expect(mockOctokit.apps.getRepoInstallation).not.toBeCalled();
196197
expect(spy).toHaveBeenNthCalledWith(1, undefined, 'app', 'https://github.enterprise.something/api/v3');
197198
expect(spy).toHaveBeenNthCalledWith(
@@ -300,7 +301,7 @@ describe('scaleUp with GHES', () => {
300301

301302
it('retrieves installation id if not set', async () => {
302303
const spy = jest.spyOn(ghAuth, 'createGithubAuth');
303-
await scaleUpModule.scaleUp('aws:sqs', TEST_DATA_WITHOUT_INSTALL_ID);
304+
await scaleUpModule.scaleUp('aws:sqs', TEST_DATA_WITH_ZERO_INSTALL_ID);
304305
expect(mockOctokit.apps.getOrgInstallation).not.toBeCalled();
305306
expect(spy).toHaveBeenNthCalledWith(1, undefined, 'app', 'https://github.enterprise.something/api/v3');
306307
expect(spy).toHaveBeenNthCalledWith(
@@ -368,7 +369,7 @@ describe('scaleUp with public GH', () => {
368369

369370
it('retrieves installation id if not set', async () => {
370371
const spy = jest.spyOn(ghAuth, 'createGithubAuth');
371-
await scaleUpModule.scaleUp('aws:sqs', TEST_DATA_WITHOUT_INSTALL_ID);
372+
await scaleUpModule.scaleUp('aws:sqs', TEST_DATA_WITH_ZERO_INSTALL_ID);
372373
expect(mockOctokit.apps.getRepoInstallation).not.toBeCalled();
373374
expect(spy).toHaveBeenNthCalledWith(1, undefined, 'app', '');
374375
expect(spy).toHaveBeenNthCalledWith(2, TEST_DATA.installationId, 'installation', '');
@@ -387,7 +388,7 @@ describe('scaleUp with public GH', () => {
387388
process.env.ENABLE_ORGANIZATION_RUNNERS = 'true';
388389
expectedRunnerParams = { ...EXPECTED_RUNNER_PARAMS };
389390
expectedRunnerParams.runnerServiceConfig =
390-
`--url https://github.com/${TEST_DATA.repositoryOwner} ` + '--token 1234abcd ';
391+
`--url https://github.com/${TEST_DATA.repositoryOwner} ` + `--token 1234abcd `;
391392
});
392393

393394
it('gets the current org level runners', async () => {
@@ -449,7 +450,7 @@ describe('scaleUp with public GH', () => {
449450
expectedRunnerParams.runnerType = 'Repo';
450451
expectedRunnerParams.runnerOwner = `${TEST_DATA.repositoryOwner}/${TEST_DATA.repositoryName}`;
451452
expectedRunnerParams.runnerServiceConfig =
452-
`--url ` + `https://github.com/${TEST_DATA.repositoryOwner}/${TEST_DATA.repositoryName} ` + `--token 1234abcd `;
453+
`--url https://github.com/${TEST_DATA.repositoryOwner}/${TEST_DATA.repositoryName} ` + `--token 1234abcd `;
453454
});
454455

455456
it('gets the current repo level runners', async () => {
@@ -485,7 +486,7 @@ describe('scaleUp with public GH', () => {
485486

486487
it('retrieves installation id if not set', async () => {
487488
const spy = jest.spyOn(ghAuth, 'createGithubAuth');
488-
await scaleUpModule.scaleUp('aws:sqs', TEST_DATA_WITHOUT_INSTALL_ID);
489+
await scaleUpModule.scaleUp('aws:sqs', TEST_DATA_WITH_ZERO_INSTALL_ID);
489490
expect(mockOctokit.apps.getOrgInstallation).not.toBeCalled();
490491
expect(spy).toHaveBeenNthCalledWith(1, undefined, 'app', '');
491492
expect(spy).toHaveBeenNthCalledWith(2, TEST_DATA.installationId, 'installation', '');

0 commit comments

Comments
 (0)