From ae4d2b9674384bd55ecc7209369a978583d5e7b7 Mon Sep 17 00:00:00 2001 From: jumski <9126+jumski@users.noreply.github.com> Date: Wed, 3 Dec 2025 17:24:42 +0000 Subject: [PATCH] ci: limit test workers and remove db:ensure dependency (#490) # Limit test workers and remove unnecessary dependency This PR makes two changes to improve test reliability and build efficiency: 1. Added `--maxWorkers=1` flag to vitest commands in the client package to prevent test flakiness by running tests sequentially 2. Removed the `db:ensure` dependency from the `test:unit` command in the edge-worker package since unit tests don't require a database connection These changes should help reduce test flakiness and improve build times by removing unnecessary dependencies. --- pkgs/client/project.json | 4 ++-- pkgs/edge-worker/project.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/client/project.json b/pkgs/client/project.json index a41e3ef85..445bf4a10 100644 --- a/pkgs/client/project.json +++ b/pkgs/client/project.json @@ -149,7 +149,7 @@ "commands": [ "../../scripts/supabase-start-locked.sh .", "psql 'postgresql://postgres:postgres@localhost:50522/postgres' -c 'SELECT pgflow_tests.reset_db()'", - "vitest run __tests__/integration/" + "vitest run __tests__/integration/ --poolOptions.threads.singleThread" ], "parallel": false } @@ -174,7 +174,7 @@ "commands": [ "../../scripts/supabase-start-locked.sh .", "psql 'postgresql://postgres:postgres@localhost:50522/postgres' -c 'SELECT pgflow_tests.reset_db()'", - "vitest run __tests__/" + "vitest run __tests__/ --poolOptions.threads.singleThread" ], "parallel": false } diff --git a/pkgs/edge-worker/project.json b/pkgs/edge-worker/project.json index 3bde35098..8f55e68d1 100644 --- a/pkgs/edge-worker/project.json +++ b/pkgs/edge-worker/project.json @@ -135,7 +135,7 @@ } }, "test:unit": { - "dependsOn": ["db:ensure", "^build"], + "dependsOn": ["^build"], "executor": "nx:run-commands", "local": true, "inputs": ["default", "^production"],