Skip to content

Commit 16a9888

Browse files
author
Davide Melfi
committed
chore: adding new tests
1 parent eccc224 commit 16a9888

File tree

2 files changed

+72
-1
lines changed

2 files changed

+72
-1
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Customize these values as needed for testing both local and on github
33

44
# Handlers to build
5-
HANDLERS_TO_BUILD=basic-lambda
5+
HANDLERS_TO_BUILD="basic-lambda basic-sqs http-basic-lambda"
66

77
HANDLER=basic-lambda
88

test/dockerized/suites/core.json

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,77 @@
1414
"transform": "{msg: .msg}"
1515
}
1616
]
17+
},
18+
{
19+
"name": "test_basic_sqs",
20+
"handler": "basic-sqs",
21+
"request": {
22+
"Records": [
23+
{
24+
"messageId": "msg-001",
25+
"receiptHandle": "receipt-001",
26+
"body": "{\"id\":\"user-123\",\"text\":\"Hello from SQS\"}",
27+
"attributes": {
28+
"ApproximateReceiveCount": "1",
29+
"SentTimestamp": "1234567890",
30+
"SenderId": "AIDAI123456789",
31+
"ApproximateFirstReceiveTimestamp": "1234567890"
32+
},
33+
"messageAttributes": {},
34+
"md5OfBody": "abc123",
35+
"eventSource": "aws:sqs",
36+
"eventSourceARN": "arn:aws:sqs:us-east-1:123456789012:test-queue",
37+
"awsRegion": "us-east-1"
38+
}
39+
]
40+
},
41+
"assertions": [
42+
{
43+
"response": null
44+
}
45+
]
46+
},
47+
{
48+
"name": "test_http_basic_lambda",
49+
"handler": "http-basic-lambda",
50+
"request": {
51+
"version": "2.0",
52+
"routeKey": "$default",
53+
"rawPath": "/",
54+
"rawQueryString": "",
55+
"headers": {
56+
"accept": "text/html",
57+
"user-agent": "test-client"
58+
},
59+
"requestContext": {
60+
"accountId": "123456789012",
61+
"apiId": "api-id",
62+
"domainName": "example.com",
63+
"domainPrefix": "api",
64+
"http": {
65+
"method": "GET",
66+
"path": "/",
67+
"protocol": "HTTP/1.1",
68+
"sourceIp": "127.0.0.1",
69+
"userAgent": "test-client"
70+
},
71+
"requestId": "req-001",
72+
"routeKey": "$default",
73+
"stage": "$default",
74+
"time": "01/Jan/2024:00:00:00 +0000",
75+
"timeEpoch": 1704067200000
76+
},
77+
"isBase64Encoded": false
78+
},
79+
"assertions": [
80+
{
81+
"response": {
82+
"statusCode": 200,
83+
"body": "Hello AWS Lambda HTTP request"
84+
},
85+
"transform": "{statusCode: .statusCode, body: .body}"
86+
}
87+
]
1788
}
1889
]
1990
}

0 commit comments

Comments
 (0)