Documentation
¶
Overview ¶
Package dbtest gives each test a throwaway database of the dialect CHOK_TEST_DRIVER names: sqlite (the default; a file in t.TempDir, so the production pool layout is exercised), postgres (a fresh schema in the database of CHOK_TEST_PG_DSN) or mysql (a fresh chok_test_<rand> database on the server of CHOK_TEST_MYSQL_DSN). Cleanup drops it. A lane whose DSN is missing fails rather than silently skipping.
choktest.DB wraps it for applications; the batteries' own tests use it directly.
Index ¶
Constants ¶
View Source
const ( DriverEnv = "CHOK_TEST_DRIVER" PGDSNEnv = "CHOK_TEST_PG_DSN" MySQLDSNEnv = "CHOK_TEST_MYSQL_DSN" )
The environment of the database lanes.
Variables ¶
This section is empty.
Functions ¶
func Config ¶
Config returns a db.Config pointing at a fresh database of the lane's dialect, migrate auto, which cleanup drops.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.