Hi all
I'm building an application with docker-compose, with a FastApi and postgres container, I want to create tests for the api and dont know whats the best approach for testing requests that use the database. I've considered:
- Having an extra container for a testing database, this seems like a silly overhead for something i only need a fraction of the time
- Spin up a test database container when I need it, time consuming if done manually, but I have no idea how to do it from within another container (and i dont believe postgres can be run in memory)
- Mock database, it feels like this is leaving a hole if the mock database functions differently from the postgres in any way
What do people think the best practice is for something like this?
submitted by /u/Lokipi
[link] [comments]
from Software Development – methodologies, techniques, and tools. Covering Agile, RUP, Waterfall + more! https://ift.tt/3oXeKTa