fix: clickhouse tests

pull/479/head^2
Mike Fridman 2023-03-15 08:39:57 -04:00
parent 15ef2bcb6e
commit e2ecb28d00
1 changed files with 9 additions and 6 deletions

View File

@ -1,6 +1,8 @@
package clickhouse_test
import (
"log"
"os"
"path/filepath"
"testing"
"time"
@ -10,6 +12,13 @@ import (
"github.com/pressly/goose/v3/internal/testdb"
)
func TestMain(m *testing.M) {
if err := goose.SetDialect("clickhouse"); err != nil {
log.Fatal(err)
}
os.Exit(m.Run())
}
func TestClickUpDownAll(t *testing.T) {
t.Parallel()
@ -18,8 +27,6 @@ func TestClickUpDownAll(t *testing.T) {
check.NoError(t, err)
t.Cleanup(cleanup)
check.NoError(t, goose.SetDialect("clickhouse"))
/*
This test applies all up migrations, asserts we have all the entries in
the versions table, applies all down migration and asserts we have zero
@ -70,8 +77,6 @@ func TestClickHouseFirstThree(t *testing.T) {
check.NoError(t, err)
t.Cleanup(cleanup)
check.NoError(t, goose.SetDialect("clickhouse"))
err = goose.Up(db, migrationDir)
check.NoError(t, err)
@ -140,8 +145,6 @@ func TestRemoteImportMigration(t *testing.T) {
check.NoError(t, err)
t.Cleanup(cleanup)
check.NoError(t, goose.SetDialect("clickhouse"))
err = goose.Up(db, migrationDir)
check.NoError(t, err)
_, err = goose.GetDBVersion(db)