Files
query-orchestration/internal/test/service_test.go
T
Michael McGuinness 62886dbba8 Merged in feature/removejob (pull request #95)
Remove Job

* removejob

* rmjob

* sync

* cleanup

* precommit

* startslow

* startslow

* startslow

* openapi

* clean

* test

* scripts

* littlecleanercmds

* mermaid
2025-03-10 11:03:00 +00:00

49 lines
979 B
Go

package test_test
import (
"context"
"os"
"path"
"testing"
"queryorchestration/internal/serviceconfig"
"queryorchestration/internal/test"
"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 := &serviceconfig.BaseConfig{}
test.SetCfgProvider(t, cfg)
cfg.SetBasePath(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,
Env: map[string]string{
"CLIENT_SYNC_URL": "/i/am/here",
"QUERY_VERSION_SYNC_URL": "/here/there/every/where",
},
}
conn, cleanup := test.CreateService(t, ctx, acfg)
assert.NotNil(t, conn)
assert.NotNil(t, cleanup)
cleanup()
}