fix(tests): update database connection strings for CI
Integration Tests / integration-test (push) Failing after 57s
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:
@@ -20,7 +20,11 @@ jobs:
|
||||
POSTGRES_USER: user
|
||||
POSTGRES_PASSWORD: password
|
||||
ports:
|
||||
- 5433:5432
|
||||
# No fixed host port: Docker assigns a free one, avoiding
|
||||
# "port is already allocated" collisions with other jobs on a
|
||||
# shared runner. The assigned port is read below via the
|
||||
# `job.services.postgres.ports` context.
|
||||
- 5432/tcp
|
||||
options: >-
|
||||
--health-cmd="pg_isready -U user"
|
||||
--health-interval=5s
|
||||
@@ -38,4 +42,7 @@ jobs:
|
||||
cache: true
|
||||
|
||||
- name: Run all tests
|
||||
run: make test-ci
|
||||
env:
|
||||
TEST_DB_HOST: 127.0.0.1
|
||||
TEST_DB_PORT: ${{ job.services.postgres.ports['5432'] }}
|
||||
run: make test-ci TEST_DB_HOST="$TEST_DB_HOST" TEST_DB_PORT="$TEST_DB_PORT"
|
||||
|
||||
Reference in New Issue
Block a user