News for hackers. Stuff that matters.
Re:ORMs Are Backwards by candu on Wednesday September 04, 2019 @09:11AM (#20876827)
For database testing, I often use a "ramdisk", or in-memory filesystem: sudo mount -t ramfs -o size=512m ramfs /path/to/mount/point, initdb, pg_ctl start. (There's a bit more bookkeeping to generate passwords, store them to /path/to/mount/point/.pgpass, etc.) You can tear it down afterwards with pg_ctl stop, sudo umount /path/to/mount/point. I'll put the necessary commands in start / stop scripts, then call those from within the beforeAll / afterAll hooks of whatever testing framework I'm using.

It's definitely slower than mocking, and therefore not really suitable for unit tests - but it's great for repeatable, isolated integration tests (continuous or otherwise).

Re:ORMs Are Backwards by bayesian_horse on Thursday September 05, 2019 @01:28AM (#20884088)
Sounds like a job for docker or CI systems.