Skip to content

Maintenance: build Lambda Layers from source during tests #1709

Closed
@dreamorosi

Description

@dreamorosi

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:

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]
Loading

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]
Loading

Acknowledgment

Future readers

Please react with 👍 and your use case to help us understand customer demand.

Metadata

Metadata

Assignees

Labels

automationThis item relates to automationcompletedThis item is complete and has been merged/shippedinternalPRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.)layersItems related to the Lambda Layers pipeline

Type

No type

Projects

Status

Shipped

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions