-
Notifications
You must be signed in to change notification settings - Fork 177
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(js): update jest to v24; drop --runInBand #3672
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚤
Wow |
Codecov Report
@@ Coverage Diff @@
## edge #3672 +/- ##
==========================================
+ Coverage 28.84% 34.38% +5.54%
==========================================
Files 733 714 -19
Lines 13313 11173 -2140
==========================================
+ Hits 3840 3842 +2
+ Misses 9473 7331 -2142
Continue to review full report at Codecov.
|
Makefile
Outdated
--coverage=$(cover) \ | ||
--watch=$(watch) \ | ||
--updateSnapshot=$(updateSnapshot) | ||
--updateSnapshot=$(updateSnapshot) \ | ||
--no-cache=$(if $(CI),true,false) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With #3683 we should see if this cache removal is really necessary. On my Ubuntu VM (2 cores, 4GB memory) I'm seeing:
- No cache: ~110 seconds
- Cache enabled, cold: ~110 seconds
- Cache enabled, subsequent run: ~75 seconds
- No cache, 2 workers: ~220 seconds
- Cache enabled, cold, 2 workers: ~85 seconds
- Cache enabled, subsequent run, 2 workers: ~60 seconds
Given the speedup from caching (understanding that the numbers above are unscientific), I think Travis caching of the jest cache is definitely worth exploring in this PR or a followup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One downside is that on Travis, you have to spend time downloading the cache. My local jest cache for the monorepo is 143.5MB, but I'm not sure what that size might be contingent upon
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI is green and make test-js CI=true
worked in my testing on macOS, Ubuntu 18.04, and Windows 10. We should see how this shakes out this week and then ping the Jest folks to let them know if the flakiness without --run-in-band is (or isn't) fixed
🚢
overview
make test-js
is taking ~16.5 minutes on Travis. This is causing some builds to time out and fail. There's a forceful workaround: adding using thetravis_wait
util to run this step viatravis_wait make test-js
in.travis.yml
will allow the build to not time out.On my machine, it takes ~1.5 minutes real using
yarn jest --runInBand --coverage
. But, unlike Travis, I have a jest cache built up locally from running this before. When I add--no-cache
and doyarn jest --runInBand --coverage --no-cache
, it takes ~10 minutes. It seems likeRunning coverage on untested files...
accounts for the bulk of that difference. And without--coverage
, runningyarn jest --runInBand --no-cache
takes ~1.25 mins. Also,yarn jest --coverage --no-cache
(parallelization enabled, no cache) takes only ~1 minute!In summary: coverage without parallelization is very slow and is only performant if you have a jest cache already built up. So the options are
--runInBand
see Flaky failure mode when running tests jestjs/jest#1874 )travis_wait
for themake test-js
step so Travis doesn't time out. I confirmed that this works on a test branch build. But feels like a band-aid, themake test-js
step will still take ~16.5 min this wayThis PR takes option 1!
changelog
--runInBand
review requests
For additional context, see #2815 and jestjs/jest#1874
make install-js
to install the new jestmake test-js
should pass on your machine