MCPcopy Index your code
hub / github.com/perkeep/perkeep / SetupMySQLContainer

Function SetupMySQLContainer

pkg/test/dockertest/docker.go:315–319  ·  view source on GitHub ↗

SetupMySQLContainer sets up a real MySQL instance for testing purposes, using a Docker container. It returns the container ID and its IP address, or makes the test fail on error. Currently using https://hub.docker.com/_/mysql/

(t *testing.T, dbname string)

Source from the content-addressed store, hash-verified

313// or makes the test fail on error.
314// Currently using https://hub.docker.com/_/mysql/
315func SetupMySQLContainer(t *testing.T, dbname string) (c ContainerID, ip string) {
316 return setupContainer(t, mysqlImage, 3306, 20*time.Second, func() (string, error) {
317 return run("-d", "-e", "MYSQL_ROOT_PASSWORD="+MySQLPassword, "-e", "MYSQL_DATABASE="+dbname, mysqlImage)
318 })
319}
320
321// SetupPostgreSQLContainer sets up a real PostgreSQL instance for testing purposes,
322// using a Docker container. It returns the container ID and its IP address,

Callers 3

TestMySQLKVFunction · 0.92
TestRollbackFunction · 0.92
newMySQLSortedFunction · 0.92

Calls 2

setupContainerFunction · 0.85
runFunction · 0.70

Tested by 3

TestMySQLKVFunction · 0.74
TestRollbackFunction · 0.74
newMySQLSortedFunction · 0.74