Description
Summary
Currently the LayerPublisher
construct that we use to deploy Lambda Layers during integration tests and new releases always defaults to installing the Powertools utilities from npmjs.com. This means that we don't have any way to testing the code that we haven't released in Lambda Layers.
This issue proposes to introduce a way to run the integration tests for the layers
workspace using Powertools utilities that are build from source rather than downloaded from npmjs.com (see "Solution" section below for visual representation of the proposal).
This will allow us to easily test changes that we make to:
- the utilities & their exports/build process
- the way we package & deploy layers
- test behaviors that are present only in Layers
Without the change above we have no way of covering these cases unless we make a release first.
Why is this needed?
Up until now our Lambda Layers usage was fairly straightforward as it involved only our core utilities (Tracer, Metrics, Logger) which always shipped with their own dependencies.
In the past couple of weeks alone however the complexity has increased significantly due to separate work streams that involve deploying unpublished versions:
- chore(maintenance): bump dependencies & drop nodejs14x #1687
- refactor(commons): aws sdk util + identity check #1708
For this reason we should have a way to run integration tests for the layer
workspace using Powertools utilities built from source rather then the ones from the last published release.
Which area does this relate to?
Automation
Solution
Visual representation of current process:
graph TB
A[Run layers e2e tests] --> B[Create tmp/nodejs folder]
B --> C[Download utilities from registry]
C --> D[Create zip archive]
D --> E[Deploy Layers]
E --> F[Run tests in a function that uses Layer]
Visual representation of proposed process:
graph TD
A[Run layers e2e tests] --> B[Create tmp/nodejs folder]
B --> C[Build utilities from source]
C --> D[Install built utilities from tar.gz]
D --> E[Create zip archive]
E --> F[Deploy Layers]
F --> G[Run tests in a function that uses Layer]
Acknowledgment
- This request meets Powertools for AWS Lambda (TypeScript) Tenets
- Should this be considered in other Powertools for AWS Lambda languages? i.e. Python, Java, and .NET
Future readers
Please react with 👍 and your use case to help us understand customer demand.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status