Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(lambda): bump @typescript-eslint/eslint-plugin from 7.18.0 to 8.8.1 in /lambdas #4168

2 changes: 1 addition & 1 deletion lambdas/functions/ami-housekeeper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@types/aws-lambda": "^8.10.145",
"@types/jest": "^29.5.12",
"@types/node": "^22.5.4",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/eslint-plugin": "^8.8.1",
"@typescript-eslint/parser": "^8.8.0",
"@vercel/ncc": "^0.38.1",
"aws-sdk-client-mock": "^4.0.2",
Expand Down
2 changes: 1 addition & 1 deletion lambdas/functions/ami-housekeeper/src/lambda.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe('Housekeeper ami', () => {
resolve();
});
});
expect(await handler(undefined, context)).resolves;
await expect(handler(undefined, context)).resolves.not.toThrow();
});

it('should not thow only log in error in case of an exception.', async () => {
Expand Down
2 changes: 1 addition & 1 deletion lambdas/functions/control-plane/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@types/aws-lambda": "^8.10.145",
"@types/jest": "^29.5.12",
"@types/node": "^22.5.4",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/eslint-plugin": "^8.8.1",
"@typescript-eslint/parser": "^8.8.0",
"@vercel/ncc": "^0.38.1",
"aws-sdk-client-mock": "^4.0.2",
Expand Down
2 changes: 1 addition & 1 deletion lambdas/functions/control-plane/src/aws/runners.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ describe('create runner with errors', () => {
it('test now error is thrown if an instance is created', async () => {
createFleetMockWithErrors(['NonMappedError'], ['i-123']);

expect(await createRunner(createRunnerConfig(defaultRunnerConfig))).resolves;
await expect(createRunner(createRunnerConfig(defaultRunnerConfig))).resolves.toEqual(['i-123']);
expect(mockEC2Client).toHaveReceivedCommandWith(
CreateFleetCommand,
expectedCreateFleetRequest(defaultExpectedFleetRequestValues),
Expand Down
2 changes: 1 addition & 1 deletion lambdas/functions/control-plane/src/github/octokit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe('Test getOctokit', () => {
mockOctokit.apps.getOrgInstallation.mockRejectedValue(new Error('Error'));
}

expect(await getOctokit('', input.orgLevelRunner, payload)).resolves;
await expect(getOctokit('', input.orgLevelRunner, payload)).resolves.toBeDefined();

if (output.callOrgInstallation) {
expect(mockOctokit.apps.getOrgInstallation).toHaveBeenCalled();
Expand Down
6 changes: 3 additions & 3 deletions lambdas/functions/control-plane/src/lambda.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ describe('Test scale up lambda wrapper.', () => {
resolve();
});
});
expect(await scaleUpHandler(sqsEvent, context)).resolves;
await expect(scaleUpHandler(sqsEvent, context)).resolves.not.toThrow();
});

it('Non scale should resolve.', async () => {
Expand Down Expand Up @@ -206,7 +206,7 @@ describe('Test job retry check wrapper', () => {
resolve();
});
});
expect(await jobRetryCheck(sqsEvent, context)).resolves;
await expect(jobRetryCheck(sqsEvent, context)).resolves.not.toThrow();
});

it('Handle with error should resolve and log only a warning.', async () => {
Expand All @@ -216,7 +216,7 @@ describe('Test job retry check wrapper', () => {
const error = new Error('Error handling retry check.');
mock.mockRejectedValue(error);

expect(await jobRetryCheck(sqsEvent, context)).resolves;
await expect(jobRetryCheck(sqsEvent, context)).resolves.not.toThrow();
expect(logSpyWarn).toHaveBeenCalledWith(expect.stringContaining(error.message), expect.anything());
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ describe('Scale down runners', () => {
expect(listEC2Runners).toHaveBeenCalledWith({
environment: ENVIRONMENT,
});
expect(terminateRunner).not;
expect(mockOctokit.apps.getRepoInstallation).not;
expect(mockOctokit.apps.getRepoInstallation).not;
expect(terminateRunner).not.toHaveBeenCalled();
expect(mockOctokit.apps.getRepoInstallation).not.toHaveBeenCalled();
expect(mockOctokit.apps.getRepoInstallation).not.toHaveBeenCalled();
});

it(`Should terminate runner without idle config ${type} runners.`, async () => {
Expand Down
2 changes: 1 addition & 1 deletion lambdas/functions/gh-agent-syncer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@types/jest": "^29.5.12",
"@types/node": "^22.5.4",
"@types/request": "^2.48.12",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/eslint-plugin": "^8.8.1",
"@typescript-eslint/parser": "^8.8.0",
"@vercel/ncc": "^0.38.1",
"aws-sdk-client-mock": "^4.0.2",
Expand Down
2 changes: 1 addition & 1 deletion lambdas/functions/gh-agent-syncer/src/syncer/syncer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ async function getCachedVersion(s3Client: S3Client, cacheObject: CacheObject): P
const objectTagging = await s3Client.send(command);
const versions = objectTagging.TagSet?.filter((t: Tag) => t.Key === versionKey);
return versions?.length === 1 ? versions[0].Value : undefined;
} catch (e) {
} catch {
logger.debug('No tags found');
return undefined;
}
Expand Down
2 changes: 1 addition & 1 deletion lambdas/functions/termination-watcher/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@types/aws-lambda": "^8.10.145",
"@types/jest": "^29.5.12",
"@types/node": "^22.5.4",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/eslint-plugin": "^8.8.1",
"@typescript-eslint/parser": "^8.8.0",
"@vercel/ncc": "^0.38.1",
"aws-sdk-client-mock": "^4.0.2",
Expand Down
2 changes: 1 addition & 1 deletion lambdas/functions/termination-watcher/src/lambda.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe('Handle sport termination interruption warning', () => {
resolve();
});
});
expect(await interruptionWarning(event, context)).resolves;
await expect(interruptionWarning(event, context)).resolves.not.toThrow();
});

it('should not throw only log in error in case of an exception.', async () => {
Expand Down
1 change: 1 addition & 0 deletions lambdas/functions/termination-watcher/src/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { EventBridgeEvent } from 'aws-lambda';

// eslint-disable-next-line @typescript-eslint/no-empty-object-type
export interface SpotInterruptionWarning<SpotTerminationDetail>
extends EventBridgeEvent<'EC2 Spot Instance Interruption Warning', SpotTerminationDetail> {}

Expand Down
2 changes: 1 addition & 1 deletion lambdas/functions/webhook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@types/express": "^4.17.21",
"@types/jest": "^29.5.12",
"@types/node": "^22.5.4",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/eslint-plugin": "^8.8.1",
"@typescript-eslint/parser": "^8.8.0",
"@vercel/ncc": "0.38.1",
"body-parser": "^1.20.3",
Expand Down
17 changes: 9 additions & 8 deletions lambdas/functions/webhook/src/sqs/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,13 @@ describe('Test sending message to SQS.', () => {
QueueUrl: queueUrl,
MessageBody: JSON.stringify(no_fifo_message),
};

// Act
const result = await sendActionRequest(no_fifo_message);
const result = sendActionRequest(no_fifo_message);

// Assert
expect(mockSQS.sendMessage).toBeCalledWith(sqsMessage);
expect(result).resolves;
expect(mockSQS.sendMessage).toHaveBeenCalledWith(sqsMessage);
await expect(result).resolves.not.toThrow();
});

it('use a fifo queue', async () => {
Expand All @@ -64,11 +65,11 @@ describe('Test sending message to SQS.', () => {
MessageBody: JSON.stringify(fifo_message),
};
// Act
const result = await sendActionRequest(fifo_message);
const result = sendActionRequest(fifo_message);

// Assert
expect(mockSQS.sendMessage).toBeCalledWith({ ...sqsMessage, MessageGroupId: String(message.id) });
expect(result).resolves;
expect(mockSQS.sendMessage).toHaveBeenCalledWith({ ...sqsMessage, MessageGroupId: String(message.id) });
await expect(result).resolves.not.toThrow();
});
});

Expand All @@ -94,11 +95,11 @@ describe('Test sending message to SQS.', () => {
const config = await Config.load();

// Act
const result = await sendWebhookEventToWorkflowJobQueue(message, config);
const result = sendWebhookEventToWorkflowJobQueue(message, config);

// Assert
expect(mockSQS.sendMessage).toHaveBeenCalledWith(sqsMessage);
expect(result).resolves;
await expect(result).resolves.not.toThrow();
});

it('Does not send webhook events to workflow job event copy queue when job queue is not in environment', async () => {
Expand Down
2 changes: 1 addition & 1 deletion lambdas/libs/aws-powertools-util/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@types/express": "^4.17.21",
"@types/jest": "^29.5.12",
"@types/node": "^22.5.4",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/eslint-plugin": "^8.8.1",
"@typescript-eslint/parser": "^8.8.0",
"@vercel/ncc": "0.38.1",
"body-parser": "^1.20.3",
Expand Down
2 changes: 1 addition & 1 deletion lambdas/libs/aws-ssm-util/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@types/express": "^4.17.21",
"@types/jest": "^29.5.12",
"@types/node": "^22.5.4",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/eslint-plugin": "^8.8.1",
"@typescript-eslint/parser": "^8.8.0",
"@vercel/ncc": "0.38.1",
"body-parser": "^1.20.3",
Expand Down
6 changes: 3 additions & 3 deletions lambdas/libs/aws-ssm-util/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ describe('Test getParameter and putParameter', () => {
},
};

mockSSMClient.on(PutParameterCommand).resolves(output);
mockSSMClient.on(PutParameterCommand).rejects(output);

// Act
expect(putParameter(parameterName, parameterValue, true)).rejects;
await expect(putParameter(parameterName, parameterValue, true)).rejects.toThrow();
});

it('Puts parameters and returns success', async () => {
Expand All @@ -75,7 +75,7 @@ describe('Test getParameter and putParameter', () => {
mockSSMClient.on(PutParameterCommand).resolves(output);

// Act
expect(putParameter(parameterName, parameterValue, true)).resolves;
await expect(putParameter(parameterName, parameterValue, true)).resolves.not.toThrow();
});

it('Puts parameters as String', async () => {
Expand Down
Loading