we probably need to set up the specs so they create a known solr index and work against that. Or do all fixtures/mock objects for solr responses. However, it is crucial for sites to ensure that blacklight is correctly querying their solr instance ... not sure how to cope with that. (Think of Jamie discovering that the demo app index was NOT the one he was twiddling ... that sort of test result is valuable.)
From: Jamie Orchard-Hays <
jamie@dang.com>
Date: March 20, 2009 8:41:09 AM PDT
To:
blacklight-development@rubyforge.org
Specs are passing currently:
http://cc.blacklightopac.org/
The index needed to be blown away and the sample data reindexed with the new schema. There was also one example that was failing:
#TODO id => 1 is not in the sample data, so this fails
it "should get document" do
get :show, :id => 1
# assigns[:document].should_not be_nil
end
There's no item with that id in the sample data, so I've commented the assigns() call out for now.
Right now specs that call out to a live Solr instance are quite fragile. We (Naomi, Bess and I?) need to discuss how to reduce this fragility so that we have reliable spec runs.
Jamie
erikhatcher: jamieorc: for reliable specs... have a fixed dataset, fire up solr in the background, index data, run specs, shut down
[09:58am] jamieorc: naomi: we need to figure out a reliable/easy way to setup a test solr with test data, or a reliable/easy way to mock the data
[09:59am] naomi: yes, we all agree.
[09:59am] erikhatcher: jamieorc: solr-ruby's test suite does that
[09:59am] jamieorc: erikhatcher: that's one of the scenarios I have inmind
[09:59am] erikhatcher: with TestUnit
[09:59am] erikhatcher: but, really ought to consider mocking most stuff... no need to test solr itself in order to test your code
[10:00am] jamieorc: erikhatcher: looks like solr-ruby's would be a good reference/starting point
[10:00am] naomi: erikhatcher: i felt it was important due to rewrite with solr_helper, and b/c we expect use of gem underneath to change
[10:00am] erikhatcher: jamieorc: solr-ruby has near 100% coverage, including lotsa mocked units and some functional that go through solr itself