jejacks0n / teaspoon

Teaspoon: Javascript test runner for Rails. Use Selenium, BrowserStack, or PhantomJS.
1.43k stars 243 forks source link

teaspoon with coverage is super slow #404

Closed chaomao closed 9 years ago

chaomao commented 9 years ago

Hi, there I upgrade teaspoon(1.0.2) with istanbul(0.3.19), and found that running 'bundle exec teaspoon' will take 7~8 seconds, however running 'bundle exec teaspoon --coverage=default' will take 120 ~ 130 seconds. I don't know who is taking so much time, is there some log I can find?

jejacks0n commented 9 years ago

It's Istanbul, and the fact that it's not cached. I saw your other comment about using the test env, which doesn't use the development cache. So in dev, files that haven't changed are cached, and that makes requiring those files super fast. It even makes instrumenting them faster. That's point 1, point 2 is that instrumenting takes your files and wraps a ton of addition JavaScript around it so call counts etc. ca be tracked. That's not a super fast process, but the way that's written in teaspoon, it should also (I think) be cached for the next test run. Usually I only generate coverage reports on ci.

Additionally, make sure your dependency files (eg jQuery etc.) are excluded from within your instrumentation/no coverage rules.

chaomao commented 9 years ago

thank you for reply. Is there some way to make it fast? add one issue for istanbul to enable cache?