Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Customize these values as needed for testing both local and on github

# Handlers to build
HANDLERS_TO_BUILD=basic-lambda
HANDLERS_TO_BUILD="basic-lambda basic-sqs http-basic-lambda"

HANDLER=basic-lambda

Expand Down
25 changes: 25 additions & 0 deletions scripts/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/sh
# Pre-commit hook to run cargo fmt
#
# To install this hook, run:
# cp scripts/pre-commit .git/hooks/pre-commit
# chmod +x .git/hooks/pre-commit

echo "Running cargo fmt..."

# Run cargo fmt on the entire workspace
cargo fmt --all -- --check

# Check if cargo fmt found any formatting issues
if [ $? -ne 0 ]; then
echo ""
echo "❌ Code formatting issues detected!"
echo "Running 'cargo fmt --all' to fix formatting..."
cargo fmt --all
echo ""
echo "✅ Formatting applied. Please review the changes and commit again."
exit 1
fi

echo "✅ Code formatting is correct!"
exit 0
71 changes: 71 additions & 0 deletions test/dockerized/suites/core.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,77 @@
"transform": "{msg: .msg}"
}
]
},
{
"name": "test_basic_sqs",
"handler": "basic-sqs",
"request": {
"Records": [
{
"messageId": "msg-001",
"receiptHandle": "receipt-001",
"body": "{\"id\":\"user-123\",\"text\":\"Hello from SQS\"}",
"attributes": {
"ApproximateReceiveCount": "1",
"SentTimestamp": "1234567890",
"SenderId": "AIDAI123456789",
"ApproximateFirstReceiveTimestamp": "1234567890"
},
"messageAttributes": {},
"md5OfBody": "abc123",
"eventSource": "aws:sqs",
"eventSourceARN": "arn:aws:sqs:us-east-1:123456789012:test-queue",
"awsRegion": "us-east-1"
}
]
},
"assertions": [
{
"response": null
}
]
},
{
"name": "test_http_basic_lambda",
"handler": "http-basic-lambda",
"request": {
"version": "2.0",
"routeKey": "$default",
"rawPath": "/",
"rawQueryString": "",
"headers": {
"accept": "text/html",
"user-agent": "test-client"
},
"requestContext": {
"accountId": "123456789012",
"apiId": "api-id",
"domainName": "example.com",
"domainPrefix": "api",
"http": {
"method": "GET",
"path": "/",
"protocol": "HTTP/1.1",
"sourceIp": "127.0.0.1",
"userAgent": "test-client"
},
"requestId": "req-001",
"routeKey": "$default",
"stage": "$default",
"time": "01/Jan/2024:00:00:00 +0000",
"timeEpoch": 1704067200000
},
"isBase64Encoded": false
},
"assertions": [
{
"response": {
"statusCode": 200,
"body": "Hello AWS Lambda HTTP request"
},
"transform": "{statusCode: .statusCode, body: .body}"
}
]
}
]
}