We’ve had some trouble with test task errors causing failing builds on our continuous integration boxes ever since the release of the version 0.8.3 rake gem. Sound familiar? Read on!
As it turns out, we run all of our continuous integration tasks with the –trace option, so we can see what went wrong in the (extremely rare, of course) eventuality of some kind of error.
This is the output we started seeing with the new gem:
** Invoke selenium:local (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute selenium:local running selenium tests locally... invalid option: --trace Test::Unit automatic runner. Usage: /usr/bin/rake [options] [-- untouched arguments] <snip valid command line options>
After some investigation we uncovered changes in how rake 0.8.3 parses command line arguments. In particular, it doesn’t remove rake-specific arguments, like –trace, from the ARGV. So, when test tasks invoke the Test::Unit::AutoRunner class, it receives these arguments, fails to recognize them, and complains. Messily.