Files
query-orchestration/internal/test/database_test.go
T

44 lines
854 B
Go
Raw Normal View History

package test_test
import (
"context"
2025-03-05 12:05:46 +00:00
"testing"
"queryorchestration/internal/serviceconfig"
"queryorchestration/internal/test"
"github.com/stretchr/testify/assert"
)
func TestCreateDB(t *testing.T) {
2025-04-25 17:02:50 +00:00
t.Parallel()
if testing.Short() {
t.SkipNow()
}
ctx := context.Background()
cfg := &serviceconfig.BaseConfig{}
net := test.DepNetwork.Get(t, ctx)
2025-04-25 17:02:50 +00:00
dbcfg := test.CreateDB(t, ctx, cfg, net, &test.CreateDatabaseConfig{NoMigrations: true})
assert.NotNil(t, dbcfg)
assert.Nil(t, cfg.GetDBPool())
}
2025-01-14 17:28:26 +00:00
func TestCreateDBWithMigrations(t *testing.T) {
2025-04-25 17:02:50 +00:00
t.Parallel()
if testing.Short() {
t.SkipNow()
}
2025-01-14 17:28:26 +00:00
ctx := context.Background()
cfg := &serviceconfig.BaseConfig{}
net := test.DepNetwork.Get(t, ctx)
2025-04-25 17:02:50 +00:00
dbcfg := test.CreateDB(t, ctx, cfg, net, &test.CreateDatabaseConfig{})
2025-01-14 17:28:26 +00:00
assert.NotNil(t, dbcfg)
assert.NotNil(t, cfg.GetDBPool())
2025-01-14 17:28:26 +00:00
}