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

Fixes #28422 - use jest instead of jest-cli #7230

Merged
merged 1 commit into from
Dec 8, 2019

Conversation

amirfefer
Copy link
Member

in foreman core we use jest-cli for testing, but in plugins, we use regular jest
due to moving it to @foreman/env we should keep it unified

@theforeman-bot
Copy link
Member

Issues: #28422

@amirfefer amirfefer changed the title Fixes #28422 - use jest instead jest-cli Fixes #28422 - use jest instead of jest-cli Dec 4, 2019
package.json Outdated Show resolved Hide resolved
@amirfefer
Copy link
Member Author

Removing the no-cache flag reduced the running time significantly

Test Suites: 4 failed, 201 passed, 205 total
Tests:       6 failed, 3 skipped, 819 passed, 828 total
Snapshots:   2 obsolete, 539 passed, 539 total
Time:        81.939s, estimated 190s

VS

Test Suites: 4 failed, 201 passed, 205 total
Tests:       6 failed, 3 skipped, 819 passed, 828 total
Snapshots:   2 obsolete, 539 passed, 539 total
Time:        181.395s

According to jest docs:

Whether to use the cache. Defaults to true. Disable the cache using --no-cache. Note: the cache should only be disabled if you are experiencing caching related problems. On average, disabling the cache makes Jest at least two times slower.

mmoll
mmoll previously approved these changes Dec 5, 2019
@Ron-Lavi
Copy link
Member

Ron-Lavi commented Dec 8, 2019

@amirfefer can you rebase?

@@ -8,7 +8,7 @@
"lint": "./node_modules/.bin/eslint -c .eslintrc webpack/ script/",
"foreman-js:link": "./script/npm_link_foreman_js.sh",
"postlint": "./script/npm_lint_plugins.js",
"test": "node --max_old_space_size=8192 node_modules/.bin/jest --no-cache --config config/jest.config.js",
"test": "jest --config config/jest.config.js",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is absolutely amazing !
with cache:
tests on first run: 160 seconds,
on second time: 80 seconds,
on third time: 40 seconds,
on 4th time: 18 seconds

@mmoll mmoll merged commit 15fed2f into theforeman:develop Dec 8, 2019
@mmoll
Copy link
Contributor

mmoll commented Dec 8, 2019

merged, thanks @amirfefer!

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.

5 participants