简体   繁体   English

AWS 自动化测试 - SNS SQS Lambda DynamoDB

[英]AWS Automated Testing - SNS SQS Lambda DynamoDB

I have a setup like SNS -> SQS -> Lambda.我有一个像 SNS -> SQS -> Lambda 这样的设置。 The lambda function will save a file to S3 and save an item in DynamoDB lambda 函数会将文件保存到 S3 并在 DynamoDB 中保存一个项目

Now I would like to have an automated test case for it which I'm using Serenity现在我想要一个自动化的测试用例,我正在使用 Serenity

What I'm having so far are到目前为止我所拥有的是

  1. The program test will send a SNS.程序测试会发送一个SNS。
  2. The program test will wait and wait until a file on S3 generated and DynamoDB item is created程序测试会一直等待,直到在 S3 上生成一个文件并创建 DynamoDB 项目
  3. The program will download the file from S3 and verify it程序将从 S3 下载文件并验证它
  4. The program will verify the entry in DynamoDB and verify it程序将验证DynamoDB中的条目并对其进行验证

The problem here is at step #2, I have to keep waiting and waiting in X minutes (the same as time out of the lambda function).这里的问题是在第 2 步,我必须在 X 分钟内继续等待和等待(与 lambda 函数的超时时间相同)。

Please advice me if we have a better approach and a solution to solve the "wait" at step #2.如果我们有更好的方法和解决方案来解决第 2 步中的“等待”,请给我建议。

Thanks,谢谢,

What if the lambda was designed to queue a message when it completes.如果 lambda 被设计为在完成时将消息排队会怎样。 The test and actual consumers could then "listen" for messages on the response queue to know when the output is ready to test.然后,测试和实际使用者可以“监听”响应队列上的消息,以了解输出何时准备好进行测试。

Test could use the SQS long polling API for the response message.测试可以对响应消息使用 SQS 长轮询 API。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM