Skip to content

Commit ae4d2b9

Browse files
committed
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.
1 parent 94cbdd7 commit ae4d2b9

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

pkgs/client/project.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@
149149
"commands": [
150150
"../../scripts/supabase-start-locked.sh .",
151151
"psql 'postgresql://postgres:postgres@localhost:50522/postgres' -c 'SELECT pgflow_tests.reset_db()'",
152-
"vitest run __tests__/integration/"
152+
"vitest run __tests__/integration/ --poolOptions.threads.singleThread"
153153
],
154154
"parallel": false
155155
}
@@ -174,7 +174,7 @@
174174
"commands": [
175175
"../../scripts/supabase-start-locked.sh .",
176176
"psql 'postgresql://postgres:postgres@localhost:50522/postgres' -c 'SELECT pgflow_tests.reset_db()'",
177-
"vitest run __tests__/"
177+
"vitest run __tests__/ --poolOptions.threads.singleThread"
178178
],
179179
"parallel": false
180180
}

pkgs/edge-worker/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
}
136136
},
137137
"test:unit": {
138-
"dependsOn": ["db:ensure", "^build"],
138+
"dependsOn": ["^build"],
139139
"executor": "nx:run-commands",
140140
"local": true,
141141
"inputs": ["default", "^production"],

0 commit comments

Comments
 (0)