Documentation
¶
Overview ¶
Package testmysql supplies connection details for the integration tests.
The tests talk to a real MariaDB rather than a stub because the behaviour they pin down — server-side cancellation, streaming, information_schema timing — only exists on a real server.
Start one with: make db-up
Index ¶
Constants ¶
View Source
const ( DefaultHost = "127.0.0.1" DefaultPort = 13306 DefaultUser = "root" DefaultPassword = "datavase-test" DefaultDatabase = "datavase_test" )
Defaults matching the container started by `make db-up`. The port is deliberately not 3306 so the tests never reach a developer's own MySQL.
View Source
const ( EnvHost = "DATAVASE_TEST_HOST" EnvPort = "DATAVASE_TEST_PORT" EnvUser = "DATAVASE_TEST_USER" EnvPassword = "DATAVASE_TEST_PASSWORD" EnvDatabase = "DATAVASE_TEST_DATABASE" )
Environment variables that override the defaults.
Variables ¶
This section is empty.
Functions ¶
func DataSource ¶
func DataSource(t *testing.T) (*config.DataSource, string)
DataSource returns the test datasource and its password.
It is labelled EnvDev so guard's production rules never apply to test fixtures by accident.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.