integrations: Skips parallelization when not using docker
Previously, databases connected in parallel even when dockertest was
skipped - typically in CI environments. This caused issues on those
environments. This patch resolves that.
@@ -17,11 +17,10 @@ package integration
import (
"fmt"
"log"
+ "os"
"sync"
"time"
- "os"
-
_ "github.com/go-sql-driver/mysql"
"github.com/jmoiron/sqlx"
_ "github.com/lib/pq"
@@ -32,6 +31,13 @@ var resources []*dockertest.Resource
var pool *dockertest.Pool
func BootParallel(fs []func()) {
+ if os.Getenv("TEST_DATABASE_POSTGRESQL") != "" || os.Getenv("TEST_DATABASE_MYSQL") != "" {
+ for _, f := range fs {
+ f()
+ }
+ return
+ }
+
wg := sync.WaitGroup{}
wg.Add(len(fs))
