awslabs / awslabs/aws-lambda-powershell-runtime

Scenario testing (synthetic deployments into Lambda)

Offen
#44 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
PowerShell
Sterne
65
Forks
21
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne damit, die vorhandenen Pester-Tests für das layer-build-Skript zu finden und den vorgeschlagenen GitHub Actions AWS IAM credential flow zu überprüfen. Verwende die im issue beschriebenen SAM templates, runtime layer und hello-world handler als Einstiegspunkte für Szenariotests. Als abgeschlossen gilt die Aufgabe, wenn funktionsspezifische Lambda-Fälle erfolgreich aufgerufen werden, die Assertions bestehen und bereitgestellte SAM stacks wieder entfernt werden.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
aws, github-actions, powershell
Bereich
ci-cd, cloud, testing
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.