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,24 +3,15 @@ package main
import (
"database/sql"
"net/url"
"os"
"testing"
"github.com/stretchr/testify/require"
)
func postgresTestURL(t *testing.T) *url.URL {
str := os.Getenv("POSTGRES_PORT")
require.NotEmpty(t, str, "missing POSTGRES_PORT environment variable")
u, err := url.Parse(str)
u, err := url.Parse("postgres://postgres:postgres@postgres/dbmate?sslmode=disable")
require.Nil(t, err)
u.Scheme = "postgres"
u.User = url.User("postgres")
u.Path = "/dbmate"
u.RawQuery = "sslmode=disable"
return u
}