Closed SpencerCDixon closed 8 years ago
:+1: for bringing this up, we have a larger app that can take ~1 minute just to get initial tests running. Don't have anything to add just yet, but would really love to hear peoples' thoughts.
oh wow I suppose I shouldn't be complaining about 10-15 seconds! I just miss the user experience I had when first developing the app where I could run the npm test run:dev
and it would auto run my tests in like nano seconds.
Another thing that happens somewhat frequently is this error:
It's super odd because if I kill the test server and re-run it will just pass. Sometimes I have to do it 2-3 times to get it to work, other times it's actually a user error and I didn't import something properly.
Curious if this bug is just happening to me or if other people experience this as well
We're currently running into the same issue, which makes TDD a pain. I assume most of the time is spent when karma bundles all JS files. Could it be possible to use all available CPU cores?
@SpencerCDixon I have not seen that error before, unfortunately.
@GerritWanderer that's my guess as well, and not sure as to the answer. Will do some digging today.
@davezuko , @SpencerCDixon , regarding test speeds.
I've done some different hacks for this throughout the ages for a project running ~3000 tests. I do not have time for a PR atm, but I'll sum up the main things I've ended up doing:
devtool: cheap-module-source-map
for sourcemaps in webpack.require('karma-webpack-with-fast-source-maps'),
in plugins and comment out karma-webpack
There are also some micro optimisations you can do:
Regards, Tarjei
thanks @tarjei, I'll give your hacks a try and report if the test speed have improved.
@tarjei awesome tips, thank you. Just replacing the devtool and karma-webpack shaved off about 33% of the test time, will begin integrating these fixes into the starter kit mañana.
I lied, some small perf improvements here: https://github.com/davezuko/react-redux-starter-kit/pull/553.
Will keep this issue open to figure out even more ways of improving test performance.
I would not expext effects of these measures on a code base as small as this one ;-)
I lied, some small perf improvements here: #553 https://github.com/davezuko/react-redux-starter-kit/pull/553.
Will keep this issue open to figure out even more ways of improving test performance.
— Reply to this email directly or view it on GitHub https://github.com/davezuko/react-redux-starter-kit/issues/534#issuecomment-183571690 .
@tarjei I did implement them in a larger code base, probably ~200 tests and >10k LoC and saw a 33% performance improvement there, just on initial build time.
Good to hear :)
That is where I would expect the largest gains to come. IMHO, the actual running of JS tests is usually fast since you usually do not use a DB or other IO.
2016-02-13 19:57 GMT+01:00 David Zukowski notifications@github.com:
@tarjei https://github.com/tarjei I did implement them in a larger code base, probably ~200 tests and >10k LoC and saw a 33% performance improvement there, just on initial build time.
— Reply to this email directly or view it on GitHub https://github.com/davezuko/react-redux-starter-kit/issues/534#issuecomment-183723923 .
Tarjei Huse Mobil: 920 63 413
Yeah @tarjei the actual tests in my project run SUPER fast, it's just the webpack compilation. Thank you for getting something working @davezuko I'm going to adapt your PR to the older version of the starter kit I'm using! Cheers
Ok, well in that case I'll close this for now @SpencerCDixon. Will continue looking for performance improvements going forward.
Karma is running really slow now that my project has grown. I've passed in the debug flag and determined its due to karma-webpack. I was wondering if other people using this starter kit have experienced this problem and found any solutions?
I found this karma-webpack issue
Also this appears to be a fork of karma-webpack that can hot load the webpack. Wondering if anyone has used this instead of the normal karma-webpack