mirror of
https://github.com/TECHNOFAB11/dbmate.git
synced 2025-12-12 16:10:03 +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,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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue