From 96e80b33755c0b5d24894abf8288a463aa38e4b3 Mon Sep 17 00:00:00 2001 From: Malaber Date: Sun, 12 Apr 2026 09:34:05 +0200 Subject: [PATCH] Use per-job network for blackbox services --- .gitlab-ci.yml | 23 ++++++++++++++++++----- AGENTS.md | 2 +- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index feaf8dd..bb90d1c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -35,11 +35,24 @@ rails spec: rails e2e spec: stage: test - image: $CI_REGISTRY_IMAGE/production/commits:$CI_COMMIT_SHA + image: $CI_REGISTRY_IMAGE/test/commits:$CI_COMMIT_SHA services: - name: postgres:16 alias: postgres + - name: $CI_REGISTRY_IMAGE/production/commits:$CI_COMMIT_SHA + alias: app + command: + - bundle + - exec + - rails + - s + - -p + - "3000" + - -b + - 0.0.0.0 variables: + FF_NETWORK_PER_BUILD: "true" + CI_DEBUG_SERVICES: "true" POSTGRES_DB: turniere_blackbox POSTGRES_USER: turniere POSTGRES_PASSWORD: turniere @@ -50,9 +63,9 @@ rails e2e spec: MAILGUN_DOMAIN: blackbox.example.com RAILS_LOG_TO_STDOUT: "1" RAILS_SERVE_STATIC_FILES: "1" - NO_PROXY: postgres,localhost,127.0.0.1 - no_proxy: postgres,localhost,127.0.0.1 - TURNIERE_E2E_BASE_URL: http://127.0.0.1:3000 + NO_PROXY: app,postgres,localhost,127.0.0.1 + no_proxy: app,postgres,localhost,127.0.0.1 + TURNIERE_E2E_BASE_URL: http://app:3000 TURNIERE_E2E_EMAIL: e2e@example.com TURNIERE_E2E_PASSWORD: password123 TURNIERE_E2E_USERNAME: e2e-user @@ -68,4 +81,4 @@ rails e2e spec: - when: always script: - cd /app - - inv blackbox-self + - inv blackbox-service diff --git a/AGENTS.md b/AGENTS.md index a849811..4054ede 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -24,7 +24,7 @@ Examples: - `inv docker-test-http-e2e` The GitLab CI pipeline is expected to use these tasks as well. -In CI, blackbox E2E should run from the production image with Postgres as the sidecar and should avoid Docker Compose inside the job. +In CI, blackbox E2E should prefer the documented GitLab service-to-service model with `FF_NETWORK_PER_BUILD: "true"` when the production image needs to talk to a Postgres sidecar. The normal Rails spec suite is sharded through `inv test-shard ...` and should stay aligned with the CI matrix configuration. Useful GitLab push-option variables for saving CI minutes on public repos: