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

NX13 migration for angular jest config is very slow in large code base #9291

Closed
Roozenboom opened this issue Mar 11, 2022 · 1 comment · Fixed by #9292
Closed

NX13 migration for angular jest config is very slow in large code base #9291

Roozenboom opened this issue Mar 11, 2022 · 1 comment · Fixed by #9292
Assignees
Labels
outdated scope: angular Issues related to Angular support in Nx type: bug

Comments

@Roozenboom
Copy link
Contributor

Current Behavior

When migrating to NX 13.2 or higher a migration script for the jest-preset-angular is executed. This script updates every project in the workspace that uses this preset in the jest.config.js. In our workspace with 2500 projects this migration runs for 2 hours to finish.

Expected Behavior

The migration for each project is pretty small so i expect that this should take seconds to finish.

Steps to Reproduce

  1. Create workspace with a lot of angular projects that has jest and using the jest-preset-angular config.
  2. Run migration and wait till it is finished

The cause of this slow migration is because await formatFiles(tree) is called inside a for loop for every project
packages/angular/src/migrations/update-13-2-0/update-angular-jest-config.ts Line 28

This issue may not be prioritized if details are not provided to help us reproduce the issue.

Failure Logs

Environment

Roozenboom added a commit to Roozenboom/nx that referenced this issue Mar 11, 2022
Move the formatFiles call outside of the for loop

ISSUES CLOSED: nrwl#9291
@Coly010 Coly010 self-assigned this Mar 11, 2022
@Coly010 Coly010 added the scope: angular Issues related to Angular support in Nx label Mar 11, 2022
Coly010 pushed a commit that referenced this issue Mar 11, 2022
Move the formatFiles call outside of the for loop

ISSUES CLOSED: #9291

Co-authored-by: Richard Roozenboom <richard.roozenboom@rabobank.nl>
@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: angular Issues related to Angular support in Nx type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants