81e7223560
Text Extraction * bases * go * splitting * structure * movetoasync * movetoasync * settinguptrigger * reorder * storevent * standardisepollingvalidation * unittests * fixlint * fixlint * awscfg * generatesample * followthrough * tests * clena * store * externalidcleanup * clientid * local * baseunittests * putobjecttests * tests
48 lines
971 B
Go
48 lines
971 B
Go
package test_test
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"queryorchestration/internal/serviceconfig"
|
|
"queryorchestration/internal/test"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestCreateDB(t *testing.T) {
|
|
if testing.Short() {
|
|
t.Skip("Skipping long test in short mode")
|
|
}
|
|
ctx := context.Background()
|
|
|
|
cfg := &serviceconfig.BaseConfig{}
|
|
test.SetCfgProvider(t, cfg)
|
|
|
|
dbcfg, cleanup := test.CreateDB(t, ctx, cfg, &test.CreateDatabaseConfig{})
|
|
assert.NotNil(t, dbcfg)
|
|
assert.Nil(t, cfg.GetDBPool())
|
|
assert.NotNil(t, cleanup)
|
|
|
|
cleanup()
|
|
}
|
|
|
|
func TestCreateDBWithMigrations(t *testing.T) {
|
|
if testing.Short() {
|
|
t.Skip("Skipping long test in short mode")
|
|
}
|
|
ctx := context.Background()
|
|
|
|
cfg := &serviceconfig.BaseConfig{}
|
|
test.SetCfgProvider(t, cfg)
|
|
|
|
dbcfg, cleanup := test.CreateDB(t, ctx, cfg, &test.CreateDatabaseConfig{
|
|
RunMigrations: true,
|
|
})
|
|
defer cleanup()
|
|
|
|
assert.NotNil(t, dbcfg)
|
|
assert.NotNil(t, cfg.GetDBPool())
|
|
assert.NotNil(t, cleanup)
|
|
}
|