Esad Hajdarevic wrote:
As you probably know, every time you run the tests, the whole rails
environment is loaded, which alone takes about 20 seconds on a empty
rails project for me.
I was thinking of running some kind of test server (using DRb) in the
background that loads the environment once, and then just communicates
with the rake task. It would basically reload the testcase files, run
them and and output the results back to the rake task. No reload
environment on every test run.
Even webserver could be used, so we could have built-in controller at
/test that would allow developers to run the tests in browser!
Any ideas or thought why this shouldn't be posssible or why it isn't
This interview with Ryan Davis, at InfoQ, suggests that ZenTest  will get this capability:
"Q: And you don't have the cost of starting the Ruby executable in the Rails environment every time you want to run a test?
we didn't want to have ourselves accidentally infect our results and so we're shelling out and invoking the right test files, sometimes with -n in order to name what particular test case we want, but we're still invoking that, we still get that cost. But we're working on tools to address that as well. We're building a tool that will actually be hooked-in automatically from autotest that will load up config/environment.rb, which is the bootstrap mechanism for Rails and incurs the most costs for loading much of anything. It will load all that stuff up, get everything initialized, set up the paths and everything and then open up a socket with an interface to interact with it, saying "I want you to run this class test with this test method and it will fork so that you've copied your cost of initializing and run just those things so you don't have that cost anymore. Basically we've seen a 10x improvement in speed."