App::Prove 3.06 brings some great productivity improvements!
March 10, 2010 § 2 Comments
I don’t know how I overlooked this, but App::Prove 3.06 brings some excellent changes that are a massive help to productivity. At work, our test suite can take up to 10 minutes to run (on bad days) which isn’t huge, but when I’m trying to use TDD I find that this is just too slow to be usable. I was discussing this in #catalyst last night, and amongst other great information (some future blog posts lined up, stay tuned!), ijw mentioned that
prove --state might be something of interest to me
However, my man entry for prove doesn’t even have a –state option, but looking at App::Prove on CPAN shows that this is a killer feature. Here’s how it works
–state allows you to log the status of App::Prove between runs, and do some interesting things with them. Essentially, state tracking captures the order that tests are ran, and the result of running them. The “failed” state is of most interesting to me, which runs only the tests that failed in the last run. So, in the cases that we introduce a bug somewhere, I can run all the tests, then repeatedly run the failing tests until they all pass.
Another option I’ve just noticed now is the -j option, which allows you to run multiple tests in parallel. Me and rafl have been talking about a forking test harness, which is just a little bit beyond what -j does. -j, like make -j, allows you to specify parallel test execution. If you’re sensible, and your tests don’t interact with the world, this should allow you to run lots of tests together. Sadly, our tests do touch the world, so we can’t do this just yet.