-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Per-worker setup/teardown #15710
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
base: main
Are you sure you want to change the base?
Per-worker setup/teardown #15710
Conversation
✅ Deploy Preview for jestjs ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
babel-jest
babel-plugin-jest-hoist
babel-preset-jest
create-jest
@jest/diff-sequences
expect
@jest/expect-utils
jest
jest-changed-files
jest-circus
jest-cli
jest-config
@jest/console
@jest/core
@jest/create-cache-key-function
jest-diff
jest-docblock
jest-each
@jest/environment
jest-environment-jsdom
@jest/environment-jsdom-abstract
jest-environment-node
@jest/expect
@jest/fake-timers
@jest/get-type
@jest/globals
jest-haste-map
jest-jasmine2
jest-leak-detector
jest-matcher-utils
jest-message-util
jest-mock
@jest/pattern
jest-phabricator
jest-regex-util
@jest/reporters
jest-resolve
jest-resolve-dependencies
jest-runner
jest-runtime
@jest/schemas
jest-snapshot
@jest/snapshot-utils
@jest/source-map
@jest/test-result
@jest/test-sequencer
@jest/transform
@jest/types
jest-util
jest-validate
jest-watcher
jest-worker
pretty-format
commit: |
…o avoid circular dependencies
cc17aed
to
8415123
Compare
8415123
to
228d7b6
Compare
@cpojer mind taking a look? It's still missing release notes and full documentation. I will add that later. |
This PR is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
Summary
Implements #8708, and also brings us closer to implement #7184.
Instead of modifying anything with the current
globalSetup/Teardown
, the PR adds new optionsglobalSetupPerWorker
andglobalTeardownPerWorker
.If both setup configurations are defined (i.e
globalSetup
andglobalSetupPerWorker
) then both will be executed (the former only once, the latter once per worker).The changes can be largely divided into:
runGlobalHook.ts
fromjest-core
tojest-runner
jest-runner
andjest-worker
I recommend reviewing the PR by going commit by commit.
Test plan
Added multiple e2e tests.
The e2e tests for "per worker" are fairly similar to the "global" ones.
There are also e2e tests for combination of "per worker" and "global" .