map7
map7

Reputation: 5126

Thinking Sphinx in cucumber tests

I'm using Rails 3, Thinking-sphinx 2.0.2 and Cucumber 0.10.2. I would like to test my thinking-sphinx search statements in my integration tests using Cucumber, but it seems very slow.

I've added to my env.rb file:

require 'cucumber/thinking_sphinx/external_world'
Cucumber::ThinkingSphinx::ExternalWorld.new

Cucumber::Rails::World.use_transactional_fixtures = false

As soon as I add these lines and run 'time rake cucumber' on a fresh project with no tests written yet it takes 48seconds (on a i7-930 with 12GB ram and an Intel SSD). If I take out the thinking_sphinx lines it takes 10 seconds.

Is this normal? If so can I limit the loading of sphinx for anything with tag @slow?

Upvotes: 0

Views: 511

Answers (1)

pat
pat

Reputation: 16226

What happens if you remove the last line (ie. set transactional fixtures back to true). The TS docs are a little out of date - refer to my blog post instead.

That said, the second line could be the cause of the slowness - as it'll automatically configure, index and start Sphinx - and then stop it once the task is finished.

Upvotes: 1

Related Questions