Blacklight Plugin

specs calling index are too fragile

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 2.1
  • Fix Version/s: 2.1
  • Component/s: None
  • Description:
    Hide
    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

    Show
    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

Activity

Hide
Naomi Dushay added a comment - 20/Mar/09 12:03 PM
from IRC:

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
Show
Naomi Dushay added a comment - 20/Mar/09 12:03 PM from IRC: 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
Hide
Bess Sadler added a comment - 23/Apr/09 9:35 PM
This is done. Bess installed a stripped down copy of jira in the plugin, and then Jamie made the plugin tests actually run against it, so tests that need a real solr index now have one on tap.
Show
Bess Sadler added a comment - 23/Apr/09 9:35 PM This is done. Bess installed a stripped down copy of jira in the plugin, and then Jamie made the plugin tests actually run against it, so tests that need a real solr index now have one on tap.

People

Dates

  • Created:
    20/Mar/09 11:50 AM
    Updated:
    23/Apr/09 9:35 PM
    Resolved:
    23/Apr/09 9:35 PM