Merged in update/ci (pull request #127)

added CI

* onlywherenecessary

* export

* dockersocketoverride

* disablecleanup

* networkfromenv

* fullsuite

* ci

* dockerhost

* name

* network

* buildfirst

* rm

* caches

* additionalcaches

* additionalcaches

* cachenix

* nix

* requiredprofile

* nonixcache

* nobuild

* moremem

* rmgomodules

* buildfirst

* faster

* clean
This commit is contained in:
Michael McGuinness
2025-05-08 16:04:45 +00:00
parent e84454b46f
commit c4c0b9bd32
15 changed files with 416 additions and 334 deletions
+7
View File
@@ -3,6 +3,7 @@ package test
import (
"fmt"
"strconv"
"sync"
"testing"
db "queryorchestration/internal/database"
@@ -23,6 +24,8 @@ const (
dbPort = 5432
)
var dbLock sync.Mutex
func CreateDB(t testing.TB, cfg serviceconfig.ConfigProvider, network string, dcfg *CreateDatabaseConfig) testcontainers.Container {
port, err := nat.NewPort("tcp", strconv.Itoa(dbPort))
require.NoError(t, err)
@@ -56,6 +59,8 @@ func CreateDB(t testing.TB, cfg serviceconfig.ConfigProvider, network string, dc
},
}
dbLock.Lock()
container, err := testcontainers.GenericContainer(t.Context(), testcontainers.GenericContainerRequest{
ContainerRequest: req,
Started: true,
@@ -68,6 +73,8 @@ func CreateDB(t testing.TB, cfg serviceconfig.ConfigProvider, network string, dc
mappedPort, err := container.MappedPort(t.Context(), port)
require.NoError(t, err)
dbLock.Unlock()
cfg.SetDBHost(host)
cfg.SetDBPort(mappedPort.Int())