←back to thread

75 points markusw | 1 comments | | HN request time: 0.202s | source
Show context
whartung ◴[] No.45334732[source]
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.

replies(2): >>45336185 #>>45340787 #
1. majewsky ◴[] No.45340787[source]
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.