grosser/parallel_tests — pull request #202 by jawwad (2013-04-24 00:09:55+00:00)
Title: Added ParallelTests::Cucumber::FailuresLogger to log cucumber failures.

Hey, so I added a cucumber formatter that would log failures in the same way that cucumber's own rerun profile logs failures.

The ParallelTests::Cucumber::FailuresLogger class subclasess Cucumber::Formatter::Rerun and overrides the 'after_feature' method in order to lock the output file so that multiple processes can write to it.

The output format is similar to cucumber's own rerun output format so it can be re-run with cucumber in the same way. The only difference in output between cucumber's run format is that I thought it would look better if each file was on a separate line, whereas cucumber's own rerun logger puts the output on a single line separated by spaces.
Regardless, cucumber will run both formats when the filename is passed in prefixed with '@', i.e. cucumber @parallel_cucumber_failures.log

So in my cucumber.yml I added the following to the "parallel" profile...
`--format ParallelTests::Cucumber::FailuresLogger --out tmp/parallel_cucumber_failures.log`
And to rerun just the failures I can do
`cucumber @tmp/parallel_cucumber_failures.log`