← Back to context

Comment by ams92

12 days ago

With containerization it’s very quick to spin up test dependencies as well as part of your CICD. Why mock calls to a datastore when it’s super easy to spin up an ephemeral postgresql instance to test on?

> Why mock calls to a datastore when it’s super easy to spin up an ephemeral postgresql instance to test on?

It's actually super hard to get Postgres to fail, which is what you will be most interested in testing. Granted, you would probably use stubbing for that instead.

Because you have 40000 tests, and an in memory object means they can run in seconds. And the real thing runs in minutes.