@@ -40,7 +40,12 @@ async function isPostgresRunning() {
|
||||
describe("postgres", () => {
|
||||
beforeAll(async () => {
|
||||
if (!(await isPostgresRunning())) {
|
||||
// Only attempt to start container if port 5430 is not allocated by CI service
|
||||
try {
|
||||
await $`docker run --rm --name bknd-test-postgres -d -e POSTGRES_PASSWORD=${credentials.password} -e POSTGRES_USER=${credentials.user} -e POSTGRES_DB=${credentials.database} -p ${credentials.port}:5432 postgres:17`;
|
||||
} catch (e) {
|
||||
// Port allocated or docker unavailable; wait for CI service connection
|
||||
}
|
||||
await $waitUntil("Postgres is running", isPostgresRunning);
|
||||
await new Promise((resolve) => setTimeout(resolve, 500));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user