Closed danilofuchs closed 9 months ago
There are already two variables:
https://vitest.dev/guide/migration.html#envs
VITEST_WORKER_ID
is incremented for every new worker spawnedVITEST_POOL_ID
is the number of worker (>= minWorkers && <=maxWorkers
)
Clear and concise description of the problem
Our tests rely on a shared database connection, with
--no-isolate
and--no-threads
as they may have side effects.To speed it up, we want to run them in parallel, setting up multiple databases, one for each vitest thread.
Suggested solution
A field inside
ctx.task
that identifies the thread ID, so we can choose a different database.Alternative
Run tests with
--shard
and use an environment variable for each shard.Additional context
No response
Validations