2025-01-10 19:17:20 +00:00
|
|
|
package test
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
"testing"
|
|
|
|
|
|
2025-03-05 12:05:46 +00:00
|
|
|
"queryorchestration/internal/serviceconfig"
|
|
|
|
|
|
2025-01-10 19:17:20 +00:00
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func TestCreateContainer(t *testing.T) {
|
2025-01-17 12:00:32 +00:00
|
|
|
if testing.Short() {
|
|
|
|
|
t.Skip("Skipping long test in short mode")
|
|
|
|
|
}
|
2025-01-10 19:17:20 +00:00
|
|
|
ctx := context.Background()
|
|
|
|
|
|
|
|
|
|
ncfg, ncleanup := CreateNetwork(t, ctx)
|
|
|
|
|
defer ncleanup()
|
2025-01-31 13:43:55 +00:00
|
|
|
|
2025-02-05 12:52:41 +00:00
|
|
|
cfg := &serviceconfig.BaseConfig{}
|
|
|
|
|
SetCfgProvider(t, cfg)
|
2025-02-03 17:30:50 +00:00
|
|
|
|
|
|
|
|
_, dbcleanup := CreateDB(t, ctx, &CreateDatabaseConfig{
|
|
|
|
|
Network: ncfg,
|
|
|
|
|
Cfg: cfg,
|
2025-01-10 19:17:20 +00:00
|
|
|
})
|
|
|
|
|
defer dbcleanup()
|
|
|
|
|
|
2025-01-31 13:43:55 +00:00
|
|
|
ccfg := &containerConfig{
|
2025-02-03 17:30:50 +00:00
|
|
|
Name: QueryService,
|
|
|
|
|
Cfg: cfg,
|
|
|
|
|
Network: ncfg,
|
2025-01-10 19:17:20 +00:00
|
|
|
}
|
|
|
|
|
|
2025-01-31 13:43:55 +00:00
|
|
|
container, cleanup := createContainer(t, ctx, ccfg)
|
2025-01-10 19:17:20 +00:00
|
|
|
assert.NotNil(t, container)
|
|
|
|
|
assert.NotNil(t, cleanup)
|
|
|
|
|
|
|
|
|
|
cleanup()
|
|
|
|
|
}
|