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)
| 313 | // or makes the test fail on error. |
| 314 | // Currently using https://hub.docker.com/_/mysql/ |
| 315 | func 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, |