mirror of https://github.com/perkeep/perkeep.git
dockertest: use official mysql image
Because orchardup/mysql is deprecated. I had to increase the timeout, because this image takes at least twice as long to start compared with the orchardup one. (tests went from ~5s to ~11s here). Change-Id: I42c485d736c65ce9d93aabf02b1de73e6ac799ff
This commit is contained in:
parent
00f370f38c
commit
4662076934
|
@ -189,12 +189,8 @@ func setupContainer(t *testing.T, image string, port int, timeout time.Duration,
|
|||
}
|
||||
|
||||
const (
|
||||
mongoImage = "mpl7/mongo"
|
||||
// TODO(mpl): there's now an official mysql image at
|
||||
// https://registry.hub.docker.com/_/mysql/ . We should either directly use one from
|
||||
// there or fetch one there anyway to host it at
|
||||
// https://console.developers.google.com/project/camlistore-website
|
||||
mysqlImage = "orchardup/mysql"
|
||||
mongoImage = "mpl7/mongo"
|
||||
mysqlImage = "mysql"
|
||||
MySQLUsername = "root"
|
||||
MySQLPassword = "root"
|
||||
postgresImage = "nornagon/postgres"
|
||||
|
@ -215,9 +211,9 @@ func SetupMongoContainer(t *testing.T) (c ContainerID, ip string) {
|
|||
// 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://index.docker.io/u/orchardup/mysql/
|
||||
// Currently using https://hub.docker.com/_/mysql/
|
||||
func SetupMySQLContainer(t *testing.T, dbname string) (c ContainerID, ip string) {
|
||||
return setupContainer(t, mysqlImage, 3306, 10*time.Second, func() (string, error) {
|
||||
return setupContainer(t, mysqlImage, 3306, 20*time.Second, func() (string, error) {
|
||||
return run("-d", "-e", "MYSQL_ROOT_PASSWORD="+MySQLPassword, "-e", "MYSQL_DATABASE="+dbname, mysqlImage)
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue