From: Rick DeNatale Date: 2009-07-21T02:36:11+09:00 Subject: Re: Test::Unit run order On Mon, Jul 20, 2009 at 12:50 PM, Dylan wrote: > I would love to do that, but I have no idea how. The "real problem" of > my slow tests is caused by the very real requirement of logging in > every time, were they to be truly independent. I'm not in charge of > the bandwidth to the server, I'm not in charge of the log-in code, and > I'm not in charge of the "Lets make the tests take less than a day to > run" requirement. I'm testing a web app, and web apps by their very > nature have to transmit data back and forth, which takes more time > than any local machine doing operations. It sounds to me that there's a confusion here between unit-testing and full-stack testing. For example if this were a rails app, the normal approach is to have tests for models, separate tests for controllers, and integration tests to test user interface flows. And even in the last case, this is normally done not by transmitting data back and forth, instead Rails provides special integration test mocks for the http infrastructure which simulates actual http request and response transmission. And logging in (i.e. authorization) is one thing which is usually mocked out for many if not all tests. Jim Weirich does a humorous 'skit' about mocking login, in which he has to help a co-worker who was testing failed password validation using real access and his own account, and kept getting locked out of the system. Less traditional ruby web developers are using tools like Cucumber and webrat to do integration/acceptance testing, but these are still simulating infrastructure in different ways. -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Twitter: http://twitter.com/RickDeNatale WWR: http://www.workingwithrails.com/person/9021-rick-denatale LinkedIn: http://www.linkedin.com/in/rickdenatale