-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat!(runner): support concurrent suites #5491
Conversation
✅ Deploy Preview for fastidious-cascaron-4ded94 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
50eb8bf
to
2597cd6
Compare
Hey @hi-ogawa, thanks for implementing it. I'm wondering why "concurrentSuite" is needed? Shouldn't we mimic jest and have all the describe blocks concurrent? Or is it for backward compat only? If people like me want jest behaviour on all describe blocks, could we add a concurrentSuite parameter in vitest.config.ts so it's enabled globally? |
I think I was mostly concerned with back compat, but anyways this PR is just for a starting point of discussion to explore the idea. Depending on what users expect and how Jest has been doing, we'll discuss further what this feature should be. |
@@ -0,0 +1,41 @@ | |||
import { describe, test, vi } from 'vitest' | |||
import { createDefer } from 'vitest/dist/utils.js' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it importing from dist 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I didn't notice but it seems typescript got that one from autocomplete.
I installed @vitest/utils
and it looks okay now.
Description
PoC of running multiple suites concurrently.
In terms of implementation, it looks like it's a matter of setting
Suite.concurrent = true
in some way. My current approach is to have an explicit flagTestOptions.concurrentSuite: boolean
and the idea is based on the analogy:describe("...", { concurrentSuite: true }, ...)
to run neighboring suites concurrentlytest("...", { concurrent: true }, ...)
to run neighboring tests concurrentlyTBD
comparison with Jest?test.concurrent
first whether it is insidedescribe
and they havebefore/after
hooks related bugs.describe.concurrent
to affect all suite/task level concurrency)describe
is waiting for inner concurrenttest
to finish, then inner one is blocked byp-limit
.TODO
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yaml
unless you introduce a new test example.Tests
pnpm test:ci
.Documentation
pnpm run docs
command.Changesets
feat:
,fix:
,perf:
,docs:
, orchore:
.