On 15 December 2010 07:52, dnagir <[email protected]> wrote:
> Hi Guys,
>
> I am a bit tired of waiting for for the [rails 3] specs to run after I
> save a file. After saving, I have to wait 10 secs or so for my specs
> only to be executed (by autotest).
>

10 seconds! That sounds positively snappy compared to what I have to
endure. I have some individual specs in one (Rails 2.3.9) app that
take longer than that (!), and whole suite takes 2 - 3 hours on my
machine.... which makes using autotest impossible :(. We have a
buildbot server which runs them in parallel on a beefy machine so I
(only) have to wait 15 - 20 minutes for a response from the CI server,
but it's still long enough to be a hindrance to testing.

I've been trying to fix this by moving setup from before do ..end into
a before :all block [1] but some issues (db not being cleared between
specs and factories trying to re-inset records that already exist)
persist. Some tests create 10 - 15 models, are parse some big json
file before running *each* example, so I have a fair idea why they are
running so slowly. I haven't been able to find anything similar to
loading fixtures before the whole test suite with factory girl, but I
suspect it's just because I don't have all that much experience with
it.

Has anyone seen some examples of rspec + factory girl + setup before
all tests in the wild? I've found Pretty much every rspec + factory
girl example I can find uses the standard before do ... end block for
setup as it's probably fine for most test suites.... maybe I need to
just search the githubs?

Apologies for hijacking this thread, by the way!

Thanks all for your advice,

Robert

[1] http://blog.andrewbruce.net/optimizing-specs-for-activerecord-scopes

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
or Rails Oceania" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rails-oceania?hl=en.

Reply via email to