4 ms·
What's the current state of the art for "I know I use AWS for my 9999-server production instance, but how can I test the majority of my services offline on an a
by ramses0 9y ago
What's the current state of the art for "I know I use AWS for my 9999-server production instance, but how can I test the majority of my services offline on an airplane w/o spending $199.99/mo to keep a fleet of test AWS servers/services at the ready"?
Last I looked the "fake-aws", specifically "lambda" supported python, not JS/Node, which was not matching my use-case. Go is now on the radar as a usable programming language for this purpose, but what are the chances of being able to also use it with local test deployments?
- dschep 9y agoYeah, that's probably the worst part of 'serverless computing.' If using the serverless framework, the serverless-offline plugin[0] supports JS/Node but not Python. [0] https://github.com/dherault/serverless-offline https://github.com/dherault/serverless-offline
- jsty 9y agoDo you need to keep them running constantly? The beauty of platforms like AWS, GCP, ... is that provisioning capacity is just an API call away - so could you not have some way of provisioning those resources on demand to run the necessary tests? (If you can't get internet on your plane then you might not be able to run tests, but that's the case with the full test suite on a fair few systems anyway)
- ramses0 9y agoThe services are incredibly useful, incredibly powerful, but from a code + dev hygiene perspective it's safer to be able to completely test your code in isolation prior to deployment. Many people are saying: "Just mock the AWS parts..." or "Provision from amazon on demand...", but there should be "common" mocks, or ideally "toy mocks" which can be used locally in order to verify the production system works how you expect it to, prior to deployment to that production system. Basically, I'm uncomfortable making AWS a hard-dependency if I can't get something like it running locally for a "100 record use case"
- cachesking 9y agoIt would be nice if AWS provided mocks but the reality is that's there is more than one lib for creating stubs and mocks for every language. Additionally, I would assume that AWS want's to steer clear of making those types of decisions for the developer. The "what lib do I use for x" decisions that developers have to make.
- cachesking 9y agoUnit tests are all you should really need. Mock the AWS services and make sure to assert, where you can, the arguments being sent to those services and you should have enough coverage to get the job done.
- deleted 9y ago[deleted]
- brazzledazzle 9y agoI haven't used it yet but I've heard good things about localstack[0]. Originally it was in the Atlassian GitHub organization[1] but they moved it over to its own at some point. 0. https://github.com/localstack/localstack https://github.com/localstack/localstack 1. https://github.com/atlassian/localstack/ https://github.com/atlassian/localstack/
- jonstokes 9y agoI'm using this, and so far it's working just fine: https://github.com/awslabs/aws-sam-local https://github.com/awslabs/aws-sam-local I'm only testing Lambda functions with it, and not really testing APIG + Lambda integrations or anything fancier. I prep the local db, mock a Lambda event, write the mocked event to a JSON file, then use command line options to run the event against AWS SAM local, then get the response and compare it to the expected response.
- inopinatus 9y agoWhen computing on an airplane you may already be in the cloud.