fix(ci): use Docker service hostname for PostgreSQL in pytest job
Some checks failed
CI / pytest (push) Failing after 36m48s
CI / dependency-scanning (push) Successful in 27s
CI / audit (push) Successful in 9s
CI / ruff (push) Failing after 7s
CI / architecture (push) Failing after 10s
CI / docs (push) Has been skipped

act_runner executes jobs in Docker containers on the same network as
service containers. Use service name (postgres:5432) instead of
localhost with port mapping.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-13 09:49:33 +01:00
parent 8abcea154b
commit 874e254c11

View File

@@ -48,8 +48,6 @@ jobs:
POSTGRES_DB: wizamart_test
POSTGRES_USER: test_user
POSTGRES_PASSWORD: test_password
ports:
- 5433:5432
options: >-
--health-cmd "pg_isready -U test_user -d wizamart_test"
--health-interval 10s
@@ -57,8 +55,10 @@ jobs:
--health-retries 5
env:
TEST_DATABASE_URL: "postgresql://test_user:test_password@localhost:5433/wizamart_test"
DATABASE_URL: "postgresql://test_user:test_password@localhost:5433/wizamart_test"
# act_runner executes jobs in Docker containers on the same network as services,
# so use the service name (postgres) as hostname with the internal port (5432)
TEST_DATABASE_URL: "postgresql://test_user:test_password@postgres:5432/wizamart_test"
DATABASE_URL: "postgresql://test_user:test_password@postgres:5432/wizamart_test"
steps:
- uses: actions/checkout@v4