Skip to content

Run tests in an environment which also includes layers #900

Open
@billyshambrook

Description

@billyshambrook

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions