15 ms·
You can run tests in MySQL in memory almost as easily. database-autotests: volumes: - mysql-autotests-volume:/var/lib/mysql volumes:
by anticodon 3y ago
You can run tests in MySQL in memory almost as easily.
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.
- deleted 3y ago[deleted]
- Izkata 3y agoNot sure what that is, docker? None of the several dozen projects I'm referring to use it.
- ragnese 3y agoYes, that looks like a docker-compose config. But, it doesn't really matter. The point is that you could run MySQL in a way such that its storage (the actual data files) are on a virtual filesystem running in RAM. 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).