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

43 lines
836 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()
cfg := &serviceconfig.BaseConfig{}
SetCfgProvider(t, cfg)
net := DepNetwork.Get(t, ctx)
_ = CreateDB(t, ctx, cfg, net, &CreateDatabaseConfig{})
ccfg := &containerConfig{
Name: string(QueryAPIName),
DownstreamQueues: QueryAPI.DownstreamQueues,
Cfg: cfg,
ExposedPorts: []nat.Port{
nat.Port("8080/tcp"),
},
}
container, cleanup := createContainer(t, ctx, net, ccfg)
assert.NotNil(t, container)
assert.NotNil(t, cleanup)
2025-03-19 11:54:14 +00:00
PrintContainerLogs(t, ctx, container)
cleanup()
}