Skip to content

Commit

Permalink
fix: clickhouse tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mfridman committed Mar 15, 2023
1 parent 15ef2bc commit e2ecb28
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions tests/clickhouse/clickhouse_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package clickhouse_test

import (
"log"
"os"
"path/filepath"
"testing"
"time"
Expand All @@ -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()

Expand All @@ -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
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit e2ecb28

Please sign in to comment.