Doing TDD with TS

4 views
Skip to first unread message

Srinivasan

unread,
Jul 27, 2008, 3:53:04 AM7/27/08
to Thinking Sphinx
Hi, i'm interested in knowing how everyone's doing TDD with
ThinkingSphinx. I've been having trouble with it since the start. The
classes in my rails app involves a lot of relationships and hence i
cannot really use just the delta indices. Triggering the indexer in
setup makes tests real slow and doesn't work too.

The hackish idea i have in my mind is to load the test data, once
before the tests, trigger the indexer, and run test normally and later
at the end of the tests, clean up the database. Although i'm able to
load up the data, i cannot seem to be able to delete it after the
tests.

I hope there are cleaner ways. Please share. Thanks in advance.

-- Srini

Pat Allan

unread,
Jul 31, 2008, 10:03:50 PM7/31/08
to thinkin...@googlegroups.com
Hi Srini

There's been a bit of discussion about this lately on the list. A post
I came across the other day - which is focused on Ultrasphinx - might
prompt some ideas:
http://blog.lrdesign.com/2008/07/fixing-problems-with-sphinx-search/

So, keep in mind if you're running two instances of Sphinx, each will
need to have a different port - so specify that in your config/
sphinx.yml file.

I do prefer stubbing the search method, and disabling delta indexes -
but that solution doesn't take into account the updates to Sphinx when
model instances change. A fix for that will be coming soon though.

Hopefully this gives you something to start with.

Cheers

--
Pat
e: p...@freelancing-gods.com || m: +614 1327 3337
w: http://freelancing-gods.com || t: twitter.com/pat
discworld: http://ausdwcon.org || skype: patallan

ts

unread,
Aug 1, 2008, 7:01:51 AM8/1/08
to thinkin...@googlegroups.com
Thank you, Pat for the link. It looks interesting.

Regarding running two instances of searchd, yes, i had ran into it earlier and worked around it. And yes, I have been testing out the 'search' rails-action logic by stubbing out the search methods, but i actually wanted to test out the *search* and verify the records returned by the search.

-- Srini

Pat Allan

unread,
Aug 1, 2008, 12:59:57 PM8/1/08
to thinkin...@googlegroups.com
If you want to test the search, then yeah, you'll definitely need the second instance of searchd.

-- 
Pat

Reply all
Reply to author
Forward
0 new messages