Add docker-compose healthcheck for test dependencies (#12)

This commit is contained in:
Adrian Macneil 2017-04-23 20:46:27 -07:00 committed by GitHub
parent c4fc848624
commit 247d7296f8
5 changed files with 33 additions and 32 deletions

View file

@ -3,23 +3,15 @@ package main
import (
"database/sql"
"net/url"
"os"
"testing"
"github.com/stretchr/testify/require"
)
func mySQLTestURL(t *testing.T) *url.URL {
str := os.Getenv("MYSQL_PORT")
require.NotEmpty(t, str, "missing MYSQL_PORT environment variable")
u, err := url.Parse(str)
u, err := url.Parse("mysql://root:root@mysql:3306/dbmate")
require.Nil(t, err)
u.Scheme = "mysql"
u.User = url.UserPassword("root", "root")
u.Path = "/dbmate"
return u
}