fix(tests): update database connection strings for CI
Integration Tests / integration-test (push) Failing after 57s

* Use dynamic host and port for Postgres in tests
* Add helper functions for test database host and port
This commit is contained in:
2026-09-18 21:07:28 +02:00
parent 21ce966d82
commit 63a7494982
7 changed files with 71 additions and 21 deletions
+2 -1
View File
@@ -3,6 +3,7 @@ package integration
import (
"context"
"database/sql"
"fmt"
"testing"
_ "github.com/lib/pq"
@@ -47,7 +48,7 @@ func TestRLSTenantIsolation(t *testing.T) {
}
runtimeDB, err := sql.Open("postgres",
"user=test_broker_runtime password=test-pass dbname=broker_test host=127.0.0.1 port=5433 sslmode=disable options='-c search_path=broker,public'")
fmt.Sprintf("user=test_broker_runtime password=test-pass dbname=broker_test host=%s port=%d sslmode=disable options='-c search_path=broker,public'", testDBHost(), testDBPort()))
require.NoError(t, err)
defer runtimeDB.Close()
require.NoError(t, runtimeDB.Ping())