Skip to content
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(testing): add disableJestRuntime option to @nx/jest/plugin to speed up target inference #28522

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

jaysoo
Copy link
Member

@jaysoo jaysoo commented Oct 18, 2024

This PR adds a new disableJestRuntime option to @nx/jest/plugin. By setting this to true, the inference plugin will not use jest-config and jest-runtime to retrieve outputs, nor matching spec files when ciTargetName is used. Instead, we'll use our own config loader and glob/matcher to get both values for the inferred targets.

This speeds up computation quite a bit. With a large monorepo (800 projects, 75K files), the computation goes from 2m 41s to 35s, or ~78% time reduction.

NOTE: This has no effect on existing projects and needs to be opted into.

Current Behavior

Expected Behavior

Related Issue(s)

Fixes #

@jaysoo jaysoo requested a review from a team as a code owner October 18, 2024 15:00
@jaysoo jaysoo requested a review from AgentEnder October 18, 2024 15:00
Copy link

vercel bot commented Oct 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview Oct 28, 2024 6:03pm

@jaysoo jaysoo force-pushed the feat/jest-optimize branch 2 times, most recently from ddf7045 to 9dc11b7 Compare October 18, 2024 15:28
@jaysoo jaysoo requested a review from a team as a code owner October 18, 2024 15:28
@jaysoo jaysoo requested a review from leosvelperez October 18, 2024 15:28
@jaysoo jaysoo force-pushed the feat/jest-optimize branch 2 times, most recently from c8a0c69 to 4e3a629 Compare October 18, 2024 16:20
packages/jest/src/plugins/plugin.ts Outdated Show resolved Hide resolved
packages/jest/src/plugins/plugin.ts Outdated Show resolved Hide resolved
packages/jest/src/plugins/plugin.ts Outdated Show resolved Hide resolved
packages/jest/src/plugins/plugin.ts Show resolved Hide resolved
@jaysoo jaysoo force-pushed the feat/jest-optimize branch from 3974055 to cd9ff8b Compare October 28, 2024 17:42
@jaysoo jaysoo merged commit 178d93d into master Oct 31, 2024
6 checks passed
@jaysoo jaysoo deleted the feat/jest-optimize branch October 31, 2024 15:48
Copy link

github-actions bot commented Nov 7, 2024

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants