swift-serverless/aws-lambda-swift-sprinter

Test Lambda invocation with Lambci and LocalStack

Closed this issue · 1 comments

Test Lambda invocation with Lambci and LocalStack
Add an automated test to check that the code works correctly with amazonlinux.

Add commands to test code locally

make build_lambda_local: Build the lambda and copy the artefacts under $(LOCAL_LAMBDA_PATH)

make invoke_lambda_local_once: Invoke the Lambda locally once with Docker and LambCI on port 9001

make start_lambda_local_env: Start the local environment with Docker and LambCI on port 9001

make invoke_lambda_local: Invoke the lambda locally using the endpoint `http://localhost:9001'

Use of Docker Compose
Add command in Makefile to build and test the code locally by using docker-compose on port 9001.

Add commands for local environment

make start_docker_compose_env: Start the docker-compose test environment

make stop_docker_compose_env: Stop the docker-compose test environment

make test_lambda_local_output: Verify the the output of the local invoke is the expected one.

Add the tests to Travis CI

Add tests for each Example

Implemented in #30