Hacker News new | ask | show | jobs
by surfer7837 1711 days ago
I prefer mocking my AWS calls, so much more lightweight and means exert developer doesn’t have to install local stack
2 comments

Interesting! Staying lightweight and zero-dependency is certainly a good argument. Out of curiosity - which programming language(s) are you / your team developing in? Do you have a notion of how much (%) of your time, approximately, goes into maintaining the mocks - does it scale / pay off over time?
We use Typescript and jest for the mocks. Probably about 10%, they’re very simple mocks, all they do is return success and in a few unit tests we make them return failure and then test how our app responds.

I can’t really say if it pays off but it has caught some issues, would like to expand them more and implement more logic in then to check arguments etc but haven’t been able to yet.

This article is similar to what we’ve done

https://dev.to/elthrasher/mocking-aws-with-jest-and-typescri...

We also have a pipeline that does e2 work tests and canary releases to hopefully limit the blast radius. If we encounter >10 errors in a 1 minute period we roll back and the team are alerted

Well if they use https://github.com/spulec/moto they don't have to maintain the mocks
Do you mock for local dev too?
I do. But I also primarily use JVM which means either high quality mocks are already available or it's easy to mock them out using Mockito or creating a fake implementation if I want.