▲ | whartung 3 days ago | |
I don’t recall the mechanics but I do know that folks have bundled starting a local instance of PG solely for unit tests. There’s a pre-install step to get PG on the machine, but once there, the testing framework stands it up, and shuts it down. As I recall it was pretty fast. | ||
▲ | majewsky 3 days ago | parent | next [-] | |
This is my version of it: https://pkg.go.dev/github.com/sapcc/go-bits/easypg#WithTestD... The most annoying part of it is that Postgres absolutely detests running as PID 0, which makes running `make check` in Docker containers an unnecessarily frustrating experience. I understand why Postgres rejects PID 0 by default, but I would really like for them to recognize strcmp(getenv("I_AM_IN_DOCKER_AND_I_DONT_CARE"), "true") or something. | ||
▲ | nullzzz 3 days ago | parent | prev [-] | |
This is IMO best done running pg in a container using docker-compose or similar |