81e7223560
Text Extraction * bases * go * splitting * structure * movetoasync * movetoasync * settinguptrigger * reorder * storevent * standardisepollingvalidation * unittests * fixlint * fixlint * awscfg * generatesample * followthrough * tests * clena * store * externalidcleanup * clientid * local * baseunittests * putobjecttests * tests
48 lines
930 B
Go
48 lines
930 B
Go
package test
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"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, cfg, &CreateDatabaseConfig{
|
|
Network: ncfg,
|
|
})
|
|
defer dbcleanup()
|
|
|
|
ccfg := &containerConfig{
|
|
Name: string(QueryAPIName),
|
|
DownstreamQueues: QueryAPI.DownstreamQueues,
|
|
Cfg: cfg,
|
|
Network: ncfg,
|
|
ExposedPorts: []nat.Port{
|
|
nat.Port("8080/tcp"),
|
|
},
|
|
}
|
|
|
|
container, cleanup := createContainer(t, ctx, ccfg)
|
|
assert.NotNil(t, container)
|
|
assert.NotNil(t, cleanup)
|
|
|
|
PrintContainerLogs(t, ctx, container)
|
|
|
|
cleanup()
|
|
}
|