Documentation
¶
Overview ¶
Package dbtest provides a throwaway PostgreSQL container for integration tests. It is imported only from *_test.go files (via each package's TestMain), so its heavy testcontainers/docker dependencies never end up in the noisia binary.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunMain ¶
RunMain starts a throwaway PostgreSQL container, points db.TestConninfo at it, runs the package tests and removes the container afterwards. Each test package calls it from TestMain, so every package gets its own isolated database — which matters because the workloads mutate server-wide state (pg_stat_*, temp files).
Usage in a package's TestMain:
func TestMain(m *testing.M) { os.Exit(dbtest.RunMain(m)) }
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.