3
0

upd(tests): skip migrations in short mode, add t.Skip to crm

This commit is contained in:
Tit Petric
2018-10-29 10:56:18 +01:00
parent ca7075dd38
commit 9a8bef927d
4 changed files with 23 additions and 7 deletions
+6 -1
View File
@@ -11,8 +11,13 @@ import (
)
func TestMigrations(t *testing.T) {
if testing.Short() {
t.Skip("skipping test in short mode.")
return
}
args := []string{
// "--rm",
"--rm",
"-e", "MYSQL_ROOT_PASSWORD=root",
"-e", "MYSQL_DATABASE=test",
}
+6 -1
View File
@@ -11,8 +11,13 @@ import (
)
func TestMigrations(t *testing.T) {
if testing.Short() {
t.Skip("skipping test in short mode.")
return
}
args := []string{
// "--rm",
"--rm",
"-e", "MYSQL_ROOT_PASSWORD=root",
"-e", "MYSQL_DATABASE=test",
}
+5 -4
View File
@@ -9,6 +9,11 @@ import (
)
func TestMain(m *testing.M) {
if testing.Short() {
t.Skip("skipping test in short mode.")
return
}
// @todo this is a very optimistic initialization, make it more robust
godotenv.Load("../../.env")
@@ -22,10 +27,6 @@ func TestMain(m *testing.M) {
flag.StringVar(&dsn, p("db-dsn"), "crust:crust@tcp(db1:3306)/crust?collation=utf8mb4_general_ci", "DSN for database connection")
flag.Parse()
if testing.Short() {
return
}
factory.Database.Add("default", dsn)
db := factory.Database.MustGet()
+6 -1
View File
@@ -11,8 +11,13 @@ import (
)
func TestMigrations(t *testing.T) {
if testing.Short() {
t.Skip("skipping test in short mode.")
return
}
args := []string{
// "--rm",
"--rm",
"-e", "MYSQL_ROOT_PASSWORD=root",
"-e", "MYSQL_DATABASE=test",
}