agiledigital / agiledigital/serverless-sns-sqs-lambda

Automated smoke test

未关闭
#220 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
tech debt
主要语言
TypeScript
星标
85
派生
20
PR 合并指标
30 天内没有已合并 PR

描述

Before I merge a PR I usually do a smoke test which involves:

- Checking out the PR branch
- Building the library
- Deploying the example project to a sandbox AWS environment
- Firing an event though and checking the logs to see if it worked

We can automate this process to make it quicker to merge PRs.

We already have a CI pipeline that runs via github actions and builds/tests the library. We just need to write an integration test step. I have already done a similar thing in one of my personal projects, so that might be a good reference.

In my personal project, when the CI runs, it changes into the directory of the example project and runs the "integration-test" yarn task.
That then calls a bash script: https://github.com/NoxHarmonium/io-ts-serverless-handler/blob/master/packages/io-ts-serverless-handler-example/scripts/integration-test.sh

The main things that the above script does that is nice to have is:
- Has a trap that cleans up the infra if an error occurs
- Generates a stage name from the git commit so that a fresh deployment is run every time
- Some checks for tools/credentials

The hard part would be writing the part of the script that verifies if the deployment is working. My current thinking is:
- Update the example project so that incoming events are dumped to an s3 bucket as JSON files
- Fire an SNS event from the command line, which should then end up in a queue and then picked up by the lambda. Then poll the S3 bucket until the event file appears
- Do a simple check on the event using `jq`

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。