Skip to content

Commit

Permalink
test(metastore): split prepareStore
Browse files Browse the repository at this point in the history
  • Loading branch information
lianxmfor committed Nov 12, 2021
1 parent 22ad68b commit 8881b0d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions internal/database/metadatav2/postgres/database_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,18 @@ import (
"sort"
"testing"

"github.com/oom-ai/oomstore/internal/database/metadatav2"
"github.com/oom-ai/oomstore/internal/database/metadatav2/postgres"
"github.com/oom-ai/oomstore/internal/database/test/runtime_pg"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

func prepareStore(t *testing.T) (context.Context, *postgres.DB) {
func prepareStore(t *testing.T) (context.Context, metadatav2.Store) {
return prepareDB(t)
}

func prepareDB(t *testing.T) (context.Context, *postgres.DB) {
ctx := context.Background()
opt := runtime_pg.PostgresDbOpt
pg, err := postgres.OpenDB(
Expand All @@ -37,7 +42,7 @@ func prepareStore(t *testing.T) (context.Context, *postgres.DB) {
}

func TestCreateDatabase(t *testing.T) {
ctx, store := prepareStore(t)
ctx, store := prepareDB(t)
defer store.Close()

var tables []string
Expand Down

0 comments on commit 8881b0d

Please sign in to comment.