From 09db71f95e5961ddbc0679921471d1df11e2c09b Mon Sep 17 00:00:00 2001 From: Francisco Solla Date: Mon, 17 Aug 2026 11:56:15 -0300 Subject: [PATCH] =?UTF-8?q?fix(ci=20OPS50):=20push=20workflow=20(ci.yml)?= =?UTF-8?q?=20ganha=20o=20mesmo=20fix=20do=20PR=20workflow=20=E2=80=94=20.?= =?UTF-8?q?env.test.local=20com=20a=20URL=20do=20servi=C3=A7o=20(vitest/pl?= =?UTF-8?q?aywright=20recarregam=20.env.test=20por=20cima)=20e=20VITEST=5F?= =?UTF-8?q?MAX=5FWORKERS=3D4=20no=20int?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .forgejo/workflows/ci.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index c5009da6..4893bfd7 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -46,6 +46,12 @@ jobs: int: runs-on: ubuntu-latest timeout-minutes: 25 + env: + # Self-hosted runner has 8 CPUs; vitest forks ≈ CPUs and each fork holds + # a Payload pool (max 10) → overflows the service Postgres' 100 clients + # ("too many clients already"). 4 forks stay well under. GitHub's 2–4 + # vCPU runners keep the CPU-relative default (no env). + VITEST_MAX_WORKERS: 4 services: postgres: image: postgres:17-alpine @@ -73,6 +79,10 @@ jobs: set -euo pipefail DB_HOST=$(awk '$2 == "00000000" {a=$3; print strtonum("0x" substr(a,7,2)) "." strtonum("0x" substr(a,5,2)) "." strtonum("0x" substr(a,3,2)) "." strtonum("0x" substr(a,1,2)); exit}' /proc/net/route) echo "DATABASE_URL=postgresql://teqo:teqo@${DB_HOST}:5433/teqo_test" >> "$GITHUB_ENV" + # vitest re-loads .env.test over the process env, so the service URL + # must win through the .env.test.local layer (same mechanism + # `pnpm worktree next` uses). OPS50. + echo "DATABASE_URL=postgresql://teqo:teqo@${DB_HOST}:5433/teqo_test" > .env.test.local - run: pnpm migrate - run: pnpm db:seed:minimal - run: pnpm test:int @@ -163,6 +173,10 @@ jobs: DB_HOST=$(awk '$2 == "00000000" {a=$3; print strtonum("0x" substr(a,7,2)) "." strtonum("0x" substr(a,5,2)) "." strtonum("0x" substr(a,3,2)) "." strtonum("0x" substr(a,1,2)); exit}' /proc/net/route) DB_PORT=${{ matrix.shard == 1 && '5435' || '5436' }} echo "DATABASE_URL=postgresql://teqo:teqo@${DB_HOST}:${DB_PORT}/teqo_test" >> "$GITHUB_ENV" + # playwright re-loads .env.test over the process env, so the service + # URL must win through the .env.test.local layer (same mechanism + # `pnpm worktree next` uses). OPS50. + echo "DATABASE_URL=postgresql://teqo:teqo@${DB_HOST}:${DB_PORT}/teqo_test" > .env.test.local - run: pnpm migrate - run: pnpm db:seed:minimal - name: Build for e2e