
Ask HN: What do you while the automated tests are running? - jsnk
I work on a Rails app with a fair amount of test coverage with Cucumber. It takes around 30 to 40 minutes to run the entire test suite. While the tests are running, I usually check my email, HN news, Stackoverflow and Reddit. They don&#x27;t seem like the best use of my time. Can you share some things you do that&#x27;s productive?
======
grandalf
My guess is that you're testing AR associations all over the place and that
the business logic in your models is tightly coupled to AR associations. This
has the effect of slowing down testing tremendously.

I try to write code so that stuff that needs to be tested is not tied to AR.
Why should your logic need to wait for AR to fetch records and fire a callback
when the part that is likely to break (that isn't covered by AR's test suite)
is your logic, not the data fetching or callback infrastructure.

------
stevoo
We dont run the entire test suit. Our last night test suit took 159 minutes to
finish.

We automated that in order to run every night. We need a 100% pass rate before
we push to production.

If you just do something you run those specific tests. If something else
breaks due to that, it will be caught ( hopefully ) by the nightly tests.

Imagine having to run the test suite 2 - 3 times a day. Your day would be
wasted !

------
candeira
I use my Ansible runs (which are much shorter, but still take a huge chunk of
the day in agregate) to update my todos and timesheets, doodle ideas... and
also to check email and HN. So it goes.

Of course, my Ansible runs are shorter because I try not to do the full run
every time.

------
lifeisstillgood
Shorten the tests is one thing. A lot of database setups and tear downs? Try
encapsulating each test in a transaction to keep it in memory.

Another thing is reading the docs of the libraries you use - reading around a
subject is an under used and highly valuable activity.

------
chewxy
Actually relevant xkcd: [http://xkcd.com/303/](http://xkcd.com/303/)

------
adamconroy
I start planning my work for the next few hours, scratching down notes /
sketching out an algorithm / design a screen / update my todo list . Although
I have never had to wait more than 5 minutes for tests to run.

------
pherz
I work. Don't let tests dictate your workflow, start them and move onto
something else. The results will wait until you have time to focus on them
again.

------
barefoot
Do BDD tests typically take that long to run?

My unit tests take 1-50ms to run (the majority of them closer to 1ms) and I
can run a decent suite of them in a few seconds.

~~~
jsnk
There's a huge room for improvement in my automation code here and there, but
there are also some hard improvement barriers presented from using selenium
webdriver. In the future, I am thinking about moving all the selenium
webdriver tests to use phantomjs. I am also still using ruby 1.8.7. I hope
that upgrading to ruby 2.0 will have noticeable improvement in speed.

------
georgebashi
You should set up something like Jenkins (or use a hosted solution like
Travis), and keep working. No need to wait around for test results...

------
taproot
Office jousting.

Edit damn! Someone already posted the xkcd.

------
tjr
Try to schedule your tests to run over lunch, or during meetings, or kick them
off at the end of a work day.

------
PhearTheCeal
I run the tests in a VM so that I can keep working on them while the tests are
running.

