You never use DB-specific features? We use postgres' JSONB column type which precludes using something like sqlite in tests.
database-autotests:
volumes:
- mysql-autotests-volume:/var/lib/mysql
volumes:
mysql-autotests-volume:
driver_opts:
type: tmpfs
o: "size=2G,mode=777"
device: tmpfs
It's also very fast and allows to test the code on the same database, especially if you have something MySQL-specific.It's a nice way to do it, IMO, because I prefer testing against a real DB instance in my projects anyway (rather than pretending that a unit test against a fake 'FooRepository' interface proves anything at all).