New ask Hacker News story: Ask HN: How do you write integration tests for complex pipelines?

Ask HN: How do you write integration tests for complex pipelines?
2 by dondraper36 | 1 comments on Hacker News.
Apart from obvious unit tests and some mocks (no love for mocks, honestly speaking), there comes a point when you need to make sure that the end-to-end logic is correct in your application while it interacts with other services, the database, etc. To be more specific, let's say there is a service that has a few endpoints with tricky behaviors. For example, creating a resource might require: * Making a call to service A * Creating new records in table X * Creating new records in table Y ... * Making a call to service B You get the idea. Even writing mocks for such cases is tiresome, not to mention that it might say nothing about the real interactions in the wild. My current approach is using dockertest (I use Go for this project and Postgres), spinning PG in a Docker container and, well, testing each endpoint method completely. Having said that, I would be interested in knowing how other people write such tests, how granular they are, what exactly is tested. Probably, you can recommend some nice resources on integration testing you know of and find illuminating.

Comments