<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div style="-webkit-text-size-adjust: auto;">I'd try it with no internets and catch any stupid test touching api's, then look at factories, </div><div style="-webkit-text-size-adjust: auto;"><br></div><div style="-webkit-text-size-adjust: auto;">if it's using factory girl you've got some opportunities <a href="http://robots.thoughtbot.com/use-factory-girls-build-stubbed-for-a-faster-test">http://robots.thoughtbot.com/use-factory-girls-build-stubbed-for-a-faster-test</a> </div><div style="-webkit-text-size-adjust: auto;"><br></div><div><span style="-webkit-text-size-adjust: auto;">If it's using devise, reduce the stretch in your test helper; </span><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);"><span class="no">Devise</span><span class="o" style="font-weight: bold;">.</span><span class="n">stretches</span> <span class="o" style="font-weight: bold;">=</span> <span class="mi">1</span></span></div><div><br></div><div><span style="-webkit-text-size-adjust: auto;">Where is the most time going to model, controller or integration? Is it disproportionate?</span></div><div><br><span style="-webkit-text-size-adjust: auto;">J.</span><div style="-webkit-text-size-adjust: auto;"><br></div><div style="-webkit-text-size-adjust: auto;">Sent from my iPad</div></div><div style="-webkit-text-size-adjust: auto;"><br>On 4 Dec 2013, at 17:43, Jon Leighton <<a href="mailto:j@jonathanleighton.com">j@jonathanleighton.com</a>> wrote:<br><br></div><blockquote type="cite" style="-webkit-text-size-adjust: auto;"><div><span>Hello there,</span><br><span></span><br><span>On 04/12/13 22:20, Mr Jaba wrote:</span><br><blockquote type="cite"><span>I've recently taken ownership of a new project with a large test suite</span><br></blockquote><blockquote type="cite"><span>(2000ish tests), and the overall run time is around 30 minutes which is</span><br></blockquote><blockquote type="cite"><span>certainly less than ideal! </span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>Now I know the general approach to "Fast Rails Tests" but taking the</span><br></blockquote><blockquote type="cite"><span>time to refactor the whole test suite is a bit too much right now. I'm</span><br></blockquote><blockquote type="cite"><span>wondering if anyone has experience of transforming a test suite of this</span><br></blockquote><blockquote type="cite"><span>magnitude to something a bit speedier? If so how did you go about it?</span><br></blockquote><blockquote type="cite"><span>What tips, tricks and techniques can you share? </span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>A bit more info:</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>- Test::Unit tests, moving to Minitest</span><br></blockquote><blockquote type="cite"><span>- Rails 3.2.16</span><br></blockquote><blockquote type="cite"><span>- Running parallel_tests shaved 5 mins off the time</span><br></blockquote><blockquote type="cite"><span>- Using Spring to reduce Rails load time. </span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>Any advice gratefully received!</span><br></blockquote><span></span><br><span>I think you need to provide some more information :) What's making it</span><br><span>take so long - the sheer number of tests or what the tests are doing? Do</span><br><span>you have certain types of tests that are taking a large portion of the</span><br><span>time (e.g. Capybara tests?) Are you using factories? In my experience</span><br><span>factories are an easy cause of a slow test suite.</span><br><span></span><br><span>One thing to think about is whether you can break up your test suite.</span><br><span>For example in the application I work on, we have unit/integration tests</span><br><span>which run in about 25 seconds on my machine. I frequently run these</span><br><span>during development and they often alert me to problems. But I rarely run</span><br><span>the full set of capybara tests which takes several minutes - I let the</span><br><span>CI do that and run failing tests individually where necessary. This</span><br><span>achieves a decent balance of fast feedback for development without</span><br><span>throwing away the safety net of proper full-stack tests.</span><br><span></span><br><span>Jon</span><br><span>_______________________________________________</span><br><span>Chat mailing list</span><br><span><a href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a></span><br><span><a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a></span><br></div></blockquote></body></html>