7001ca854c
Queuing Changes and Cfg Testing * staarting * staarting * startedpush * note * save * mocking * removederrs * fixtests * cleanuperrs * newenvsetup * preppingtests * queue * mmovetocfgpassunittests * sortoutconfig * passinginteg * deps * fixtests
42 lines
768 B
Go
42 lines
768 B
Go
package test_test
|
|
|
|
import (
|
|
"context"
|
|
"os"
|
|
"path"
|
|
"queryorchestration/internal/test"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestCreateService(t *testing.T) {
|
|
if testing.Short() {
|
|
t.Skip("Skipping long test in short mode")
|
|
}
|
|
ctx := context.Background()
|
|
|
|
ncfg, ncleanup := test.CreateNetwork(t, ctx)
|
|
defer ncleanup()
|
|
|
|
cfg := test.CreateBaseConfig()
|
|
cfg.BasePath = path.Join(os.Getenv("PWD"), "../..")
|
|
_, dbcleanup := test.CreateDB(t, ctx, &test.CreateDatabaseConfig{
|
|
Network: ncfg,
|
|
Cfg: cfg,
|
|
})
|
|
defer dbcleanup()
|
|
|
|
acfg := &test.ServiceConfig{
|
|
Name: test.QueryService,
|
|
Cfg: cfg,
|
|
Network: ncfg,
|
|
}
|
|
|
|
conn, cleanup := test.CreateService(t, ctx, acfg)
|
|
assert.NotNil(t, conn)
|
|
assert.NotNil(t, cleanup)
|
|
|
|
cleanup()
|
|
}
|