mirror of
https://github.com/TECHNOFAB11/dbmate.git
synced 2025-12-12 08:00:04 +01:00
Add docker-compose healthcheck for test dependencies (#12)
This commit is contained in:
parent
c4fc848624
commit
247d7296f8
5 changed files with 33 additions and 32 deletions
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue