721ca8a6e6
Dockerfile in Test * dockerfile * network * const
44 lines
846 B
Go
44 lines
846 B
Go
package test_test
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"queryorchestration/internal/serviceconfig"
|
|
"queryorchestration/internal/test"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestCreateDB(t *testing.T) {
|
|
t.Parallel()
|
|
if testing.Short() {
|
|
t.SkipNow()
|
|
}
|
|
ctx := context.Background()
|
|
|
|
cfg := &serviceconfig.BaseConfig{}
|
|
|
|
net := test.GetNetwork(t, ctx)
|
|
dbcfg := test.CreateDB(t, ctx, cfg, net, &test.CreateDatabaseConfig{NoMigrations: true})
|
|
|
|
assert.NotNil(t, dbcfg)
|
|
assert.Nil(t, cfg.GetDBPool())
|
|
}
|
|
|
|
func TestCreateDBWithMigrations(t *testing.T) {
|
|
t.Parallel()
|
|
if testing.Short() {
|
|
t.SkipNow()
|
|
}
|
|
ctx := context.Background()
|
|
|
|
cfg := &serviceconfig.BaseConfig{}
|
|
|
|
net := test.GetNetwork(t, ctx)
|
|
dbcfg := test.CreateDB(t, ctx, cfg, net, &test.CreateDatabaseConfig{})
|
|
|
|
assert.NotNil(t, dbcfg)
|
|
assert.NotNil(t, cfg.GetDBPool())
|
|
}
|