rails/commands

Enable running test command in development console

gbuesing opened this issue · 2 comments

I've got a working implementation of this here: https://github.com/gbuesing/duoconsole

The test environment is forked after loading Rails and gems, so this work only needs to be performed once -- should be a win for apps with lots of gems.

Commands are sent to the test process via a Unix socket -- the implementation is pretty straightforward.

App reloading behavior works as expected. To pick up changes to config/, lib/ and Gemfile, however, you need to exit the console and reload. I've got code in the "reloadable" branch that enables manual reloading of the entire app (excluding gems), but this requires keeping an additional process around, and I'm not yet sure if this is worth it.

Also, this forking fixes issue #13 (Stop sending ActiveRecord logs to STDOUT during test/rake) when running the test command, and fixes Postgres compatibility (re-establishing the AR connection before forking causes an issue.)

Let me know if there's interest in pulling any of this in here -- I'd be happy to create patches.

+1 for submitting patches, especially disabling the log messages during test/rake