From 46620769346c5e16dc8dfbab21751cb020d23d9a Mon Sep 17 00:00:00 2001 From: mpl Date: Wed, 6 Jan 2016 19:26:08 +0100 Subject: [PATCH] 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 --- pkg/test/dockertest/docker.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/pkg/test/dockertest/docker.go b/pkg/test/dockertest/docker.go index 5137f063f..42ea9dc7d 100644 --- a/pkg/test/dockertest/docker.go +++ b/pkg/test/dockertest/docker.go @@ -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) }) }