From 874e254c114b750ad73855bc874576946100a118 Mon Sep 17 00:00:00 2001 From: Samir Boulahtit Date: Fri, 13 Feb 2026 09:49:33 +0100 Subject: [PATCH] fix(ci): use Docker service hostname for PostgreSQL in pytest job 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 --- .gitea/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index a97f5432..6901163a 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -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