fix(ci): use Docker service hostname for PostgreSQL in pytest job
Some checks failed
Some checks failed
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user