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

chore(rollup-plugin): speed up and reduce memory usage in tests #4534

Merged
merged 1 commit into from
Sep 9, 2024

Conversation

cardoso
Copy link
Contributor

@cardoso cardoso commented Sep 9, 2024

Details

This PR makes a few tweaks to tests in @lwc/rollup-plugin.

It improve overall execution time from ~3.78s to ~1.44s (-62%) in my local environment.

It also reduces memory usage significantly in some tests.

This makes development while running tests in watch mode a bit more pleasant.

Before

 ✓ resolver  (13 tests) 2843ms 530 MB heap used
 ✓ compilerConfig  (6 tests) 1920ms 102 MB heap used
 ✓ apiVersion  (5 tests) 1669ms 261 MB heap used
 ✓ enableStaticContentOptimization  (4 tests) 1266ms 205 MB heap used
 ✓ warnings  (1 test) 497ms 97 MB heap used
 ✓ integrations  (1 test) 466ms 98 MB heap used
 ✓ rootDir  (2 tests) 19ms 34 MB heap used

 Test Files  7 passed (7)
      Tests  32 passed (32)
   Start at  05:29:27
   Duration  3.78s (transform 422ms, setup 0ms, collect 4.45s, tests 8.68s, environment 1ms, prepare 399ms)

After

 ✓ resolver  (13 tests) 190ms 50 MB heap used
 ✓ compilerConfig  (6 tests) 164ms 51 MB heap used
 ✓ apiVersion  (5 tests) 64ms 35 MB heap used
 ✓ enableStaticContentOptimization  (4 tests) 64ms 40 MB heap used
 ✓ warnings  (1 test) 49ms 36 MB heap used
 ✓ integrations  (1 test) 39ms 35 MB heap used
 ✓ rootDir  (2 tests) 20ms 37 MB heap used

 Test Files  7 passed (7)
      Tests  32 passed (32)
   Start at  05:26:25
   Duration  1.44s (transform 413ms, setup 0ms, collect 4.19s, tests 590ms, environment 1ms, prepare 362ms)

Does this pull request introduce a breaking change?

  • 😮‍💨 No, it does not introduce a breaking change.

Does this pull request introduce an observable change?

  • 🤞 No, it does not introduce an observable change.

GUS work item

@cardoso cardoso requested a review from a team as a code owner September 9, 2024 08:38
@cardoso cardoso changed the title test(@lwc/rollup-plugin): speed up execution and reduce memory usage test(@lwc/rollup-plugin): speed up and reduce memory usage Sep 9, 2024
@cardoso cardoso changed the title test(@lwc/rollup-plugin): speed up and reduce memory usage chore(rollup-plugin): speed up and reduce memory usage in tests Sep 9, 2024
@nolanlawson
Copy link
Collaborator

Nice, so the main improvement here is external: ['lwc'] which means we don't test Rollup's ability to bundle lwc itself (probably useless to test...)

LGTM, thank you!

@nolanlawson
Copy link
Collaborator

/nucleus test

@nolanlawson nolanlawson merged commit 19b1e44 into salesforce:master Sep 9, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants