Skip to content

How do I manually configure Shards for execution #5480

Answered by hi-ogawa
mvgiacomello asked this question in Q&A
Discussion options

You must be logged in to vote

I'd like to set maxWorkers=2 so I could run 2 files in parallel, however, I'd like to specifically tell vitest which files are okay to run in parallel as some tests are quite heavy to run together.

I don't think that's currently possible with a single vitest command.
Probably you would need to split to two test commands, something like:

{
  "test:light": "vitest --exclude '**/*.heavy.test.ts' --maxWorkers 2"
  "test:heavy": "vitest '.heavy.test.ts' --maxWorkers 1"
}

Or these two patterns are distinct enough, then you could prepare two configs:

{
  "test:light": "vitest -c vitest.config.light.ts"
  "test:heavy": "vitest -c vitest.config.heavy.ts"
}

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@mvgiacomello
Comment options

@hi-ogawa
Comment options

Answer selected by mvgiacomello
@mvgiacomello
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants