awslabs / awslabs/aws-lambda-powershell-runtime

Scenario testing (synthetic deployments into Lambda)

Aperta
#44 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
PowerShell
Stelle
65
Fork
21
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia individuando i test Pester esistenti per lo script layer-build e rivedendo il flusso delle credenziali AWS IAM proposto per GitHub Actions. Usa i SAM templates, il runtime layer e l’hello-world handler descritti nell’issue come punti di ingresso per i test di scenario. Il lavoro è completato quando i casi Lambda specifici della funzionalità vengono invocati correttamente, le assertions hanno esito positivo e gli SAM stacks distribuiti vengono eliminati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
aws, github-actions, powershell
Ambito
ci-cd, cloud, testing
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.