Re:When to use Bazel?
by hamandcheese on Wednesday September 14, 2022 @12:14AM
(#32833264)
Nice, this seems a lot simpler than I thought. Nice tip on embedded-postgres-binaries (https://github.com/zonkyio/embedded-postgres-binaries).
I posted this gist a while ago: https://gist.github.com/jvolkman/6e61c52d953677f66f32d8f77b1...
That said, this requires one postgres instance for each test, which is pretty heavy. So we keep our tests pretty coarse at the Bazel level (i.e. one Bazel test is actually 10+ Python tests). I've thought about other approaches, such as using a Bazel persistent worker to wrap test execution and manage a single Postgres instance with empty databases created from templates, but never got around to trying anything.