Files
query-orchestration/internal/test/container_test.go
T
Jay Brown 15adaebfcd Merged in feature/serviceconfig-integration (pull request #38)
DRAFT PR : WIP working through ideas for integration

* movearound

* attempttwo

* openapi

* further sanding

* fix

* start on tests

* runthroughsingleconfig

* somechanges

* reflectissue

* removeerrs

* mostlyremovepanic

* removeenv

* noncfgtests

* go

* repo

* fix service config test

* add PWD to all

* test fix

* fix lint

* todo for later

* passingunittests

* alltests

* testlogger

* testloggername

* clean
2025-01-31 13:43:55 +00:00

43 lines
834 B
Go

package test
import (
"context"
"os"
"path"
"queryorchestration/internal/serviceconfig"
"testing"
"github.com/stretchr/testify/assert"
)
func TestCreateContainer(t *testing.T) {
if testing.Short() {
t.Skip("Skipping long test in short mode")
}
ctx := context.Background()
ncfg, ncleanup := CreateNetwork(t, ctx)
defer ncleanup()
t.Setenv("BASE_PATH", path.Join(os.Getenv("PWD"), "../.."))
cfg := &serviceconfig.BaseConfig{}
dbcfg, dbcleanup := CreateDB(t, ctx, &CreateDatabaseConfig{
Network: ncfg,
Cfg: cfg,
RunMigrations: true,
})
defer dbcleanup()
ccfg := &containerConfig{
ServiceName: "queryService",
DB: dbcfg.External,
Network: ncfg,
}
container, cleanup := createContainer(t, ctx, ccfg)
assert.NotNil(t, container)
assert.NotNil(t, cleanup)
cleanup()
}