Skip to content

Commit 516ae36

Browse files
authored
chore(layers): remove schema parsing from layer canary (#3171)
1 parent fd64eeb commit 516ae36

File tree

2 files changed

+0
-28
lines changed

2 files changed

+0
-28
lines changed

layers/tests/e2e/layerPublisher.class.test.functionCode.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,11 @@ import { AppConfigProvider } from '@aws-lambda-powertools/parameters/appconfig';
88
import { DynamoDBProvider } from '@aws-lambda-powertools/parameters/dynamodb';
99
import { SecretsProvider } from '@aws-lambda-powertools/parameters/secrets';
1010
import { SSMProvider } from '@aws-lambda-powertools/parameters/ssm';
11-
import { EventBridgeSchema } from '@aws-lambda-powertools/parser/schemas';
1211
import { Tracer } from '@aws-lambda-powertools/tracer';
1312
import { AppConfigDataClient } from '@aws-sdk/client-appconfigdata';
1413
import { DynamoDBClient } from '@aws-sdk/client-dynamodb';
1514
import { SecretsManagerClient } from '@aws-sdk/client-secrets-manager';
1615
import { SSMClient } from '@aws-sdk/client-ssm';
17-
import { z } from 'zod';
1816

1917
const logger = new Logger({
2018
logLevel: 'DEBUG',
@@ -50,10 +48,6 @@ new DynamoDBProvider({ tableName: 'foo', awsSdkV3Client: ddbClient });
5048
// Instantiating the BatchProcessor will confirm that the utility can be used
5149
new BatchProcessor(EventType.SQS);
5250

53-
const testSchema = z.object({ instance_id: z.string(), state: z.string() });
54-
55-
const testEventSchema = EventBridgeSchema.extend({ detail: testSchema });
56-
5751
const layerPath = process.env.LAYERS_PATH || '/opt/nodejs/node_modules';
5852
const expectedVersion = process.env.POWERTOOLS_PACKAGE_VERSION || '0.0.0';
5953

@@ -122,7 +116,4 @@ export const handler = async (event: unknown): Promise<void> => {
122116
// the presence of a log will indicate that the logger is working
123117
// while the content of the log will indicate that the tracer is working
124118
logger.debug('subsegment', { subsegment: subsegment.format() });
125-
126-
// Check that the parser is working
127-
testEventSchema.parse(event);
128119
};

layers/tests/e2e/layerPublisher.test.ts

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {
1313
import { TestNodejsFunction } from '@aws-lambda-powertools/testing-utils/resources/lambda';
1414
import { App } from 'aws-cdk-lib';
1515
import { LayerVersion } from 'aws-cdk-lib/aws-lambda';
16-
import type { EventBridgeEvent } from 'aws-lambda';
1716
import packageJson from '../../package.json';
1817
import { LayerPublisherStack } from '../../src/layer-publisher-stack';
1918
import {
@@ -133,24 +132,6 @@ describe('Layers E2E tests', () => {
133132
functionName: testStack.findAndGetStackOutputValue(
134133
`test${outputFormat}Fn`
135134
),
136-
// Uses an EventBridge event payload to test parser functionality
137-
payload: {
138-
version: '0',
139-
id: '6a7e8feb-b491-4cf7-a9f1-bf3703467718',
140-
'detail-type': 'EC2 Instance State-change Notification',
141-
source: 'aws.ec2',
142-
account: '111122223333',
143-
time: '2017-12-22T18:43:48Z',
144-
region: 'us-west-1',
145-
resources: [
146-
'arn:aws:ec2:us-west-1:123456789012:instance/i-1234567890abcdef0',
147-
],
148-
detail: {
149-
instance_id: 'i-1234567890abcdef0',
150-
state: 'terminated',
151-
},
152-
'replay-name': 'replay_archive',
153-
} satisfies EventBridgeEvent<string, unknown>,
154135
})
155136
);
156137
}

0 commit comments

Comments
 (0)