aws / aws/aws-sam-cli

Run tests in an environment which also includes layers

Open
#900 4 comments 30 reactions 0 assignees View on GitHub
area/layers maintainer/need-response stage/bug-repro type/feature
Dominant language
Python
Stars
6.7k
Forks
1.2k
Avg merge
1d 10h
Merged PRs (30d)
52

Description

### Describe your idea/feature/enhancement

AWS Lambda Layers now make it possible to package a collection of dependencies together and can be shared across multiple Lambda Functions. AWS Lambda Layers can include language specific libraries, which the function will import to use.

This can break unit-tests written for Lambda Functions, as there may be imports that are provided via a Lambda Layer instead of via a build manifest (e.g. `requirements.txt`).

Therefore, we need a way to execute unit-tests within the same environment as when you run `sam local invoke`.

This problem also exists for other CI related checks like linting.

### Additional Details

When you run unit-tests, linters etc, these may depend on additional build dependencies that you only need when running the checks but don't want in the final deploy, for example `py.test`. This would require some way of providing additional dependencies to the docker container that is used when running the checks.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.