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

36 lines
662 B
Go
Raw Normal View History

package test
import (
"context"
"queryorchestration/internal/database"
"testing"
"github.com/stretchr/testify/assert"
)
func TestCreateContainer(t *testing.T) {
ctx := context.Background()
ncfg, ncleanup := CreateNetwork(t, ctx)
defer ncleanup()
dbcfg, dbcleanup := CreateDB(t, ctx, &CreateDatabaseConfig{
Network: ncfg,
Migrations: &database.MigrationConfig{
BasePath: "../..",
},
})
defer dbcleanup()
cfg := &containerConfig{
ServiceName: "queryService",
DB: dbcfg.External,
Network: ncfg,
}
container, cleanup := createContainer(t, ctx, cfg)
assert.NotNil(t, container)
assert.NotNil(t, cleanup)
cleanup()
}