Scenario testing (synthetic deployments into Lambda)

Open
#44 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
aws, github-actions, powershell
Domain
ci-cd, cloud, testing

Research direction

Start by locating the existing Pester tests for the layer-build script and reviewing the proposed GitHub Actions AWS IAM credential flow. Use the SAM templates, runtime layer, and hello-world handler described in the issue as the scenario-test entry points. Done means feature-specific Lambda cases invoke successfully, assertions pass, and deployed SAM stacks are torn down.

Written by the indexing model from the issue text.

Description

I'm excited to see unit tests being added here. Given a lot of this runtime's functionality is based on Lambda itself, it would be great if we could get programmatically test runtime features directly within Lambda.

I'm envisioning some Pester tests that:

  • Build the runtime layer (maybe in a BeforeAll{} block - I think we already have tests for the layer-build script?)
  • Iterate over a set of SAM templates (or multiple instantiations of a parameterized template) that:
    • Refer to the runtime layer
    • Deploy a "hello world"-type handler
    • Invoke the lambda, once the deployment finishes
    • Assert that the lambda runs
  • Tear down SAM stacks when done

If we're trying to test specific features (e.g. compressed module handling, I would expect that one of the "test cases" (i.e. instantiations of the SAM template) deploys a Lambda that uses said feature.

I know GHA has a relatively straightforward integration story with AWS IAM - I envision GHA fetching AWS creds before running tests, whereas people testing locally would be able to use whatever AWS CLI creds they have configured.

Dominant language
PowerShell
Stars
65
Forks
21
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from awslabs/aws-lambda-powershell-runtime

All issues in awslabs/aws-lambda-powershell-runtime

Similar issues

More DevOps issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.