3 ms·
"AWS's Serverless Application Model explicitly supports local testing." It doesn't provide any additional capability that was already there. Ie, I could alread
by vp8989 6y ago
"AWS's Serverless Application Model explicitly supports local testing."
It doesn't provide any additional capability that was already there. Ie, I could already run my arbitrary function from the CLI by building a simple wrapper that reads a JSON file and sends it in. Or wrap it in a simple HTTP server.
The debugging story using that tool is worse than how I would already do it pre-SAM and they don't even have documentation for every runtime they officially support:
https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-debugging.html https://docs.aws.amazon.com/serverless-application-model/lat...
It doesn't allow you to test any of the interesting bits, which is what the blog post was alluding to.
- What happens if I have an SQS Lambda with 100 concurrency and a few of the containers get into a bad state? Do the other ones keep going or does the whole thing grind to a halt?
- What happens if I have a Lambda that consumes from 50 Kinesis shards and some of the containers get into a bad state?
- What happens if my Lambda throws an exception, what happens to my SQS message or Kinesis record?
If you outsource the plumbing you can't actually test the system locally you can only test "units" of it and in a lot of cases you either have to do remote tests with print debugging to figure out what's going on or what is more common is blindly assume the plumbing works how you intend, ship it to Prod and then fix problems as they occur.
- rualca 6y ago> It doesn't allow you to run all the other services like DynamoDB, SNS, S3, etc. locally. Sounds like you're mixing up how a test pyramid works. AWS SAM supports running unit tests locally. Your remarks refer to integration tests. Integration tests are expected to be performed on environments that mimic either subsets of the production environment, or the whole production environment. https://docs.aws.amazon.com/whitepapers/latest/serverless-architectures-lambda/integration-testing.html https://docs.aws.amazon.com/whitepapers/latest/serverless-ar...
- spdionis 6y agoWhat about manual tests? You know, just running the app on your machine and check if it works/how it works. You're forced to either share the aws resources with other devs or provision separate resources for each dev which is a big PITA.
- viraptor 6y agoAs long as you use terraform/cloudformation/sam, it should be fairly simple. You deploy everything with your name as a suffix. Most of the resources will be billed on usage only as well, so you don't even pay more than a few cents for testing like that.
- earthboundkid 6y agoIt’s only an “integration” test because you split things up too much. In a monolith, it would all be unit tests against a mock DB.