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

49 lines
873 B
Go
Raw Normal View History

package test
import (
"context"
"testing"
2025-03-05 12:05:46 +00:00
"queryorchestration/internal/serviceconfig"
"github.com/docker/go-connections/nat"
"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()
cfg := &serviceconfig.BaseConfig{}
SetCfgProvider(t, cfg)
_, dbcleanup := CreateDB(t, ctx, &CreateDatabaseConfig{
Network: ncfg,
Cfg: cfg,
})
defer dbcleanup()
ccfg := &containerConfig{
Name: QueryService,
Cfg: cfg,
Network: ncfg,
Env: map[string]string{
"EXAMPLE": "value",
},
ExposedPorts: []nat.Port{
nat.Port("8080/tcp"),
},
}
container, cleanup := createContainer(t, ctx, ccfg)
assert.NotNil(t, container)
assert.NotNil(t, cleanup)
cleanup()
}