Skip to content
This repository has been archived by the owner on Nov 26, 2019. It is now read-only.

(DO NOT MERGE) Solr wrapper test fix #1153

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions config/solr_wrapper_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ collection:
dir: solr/config
name: hydra-test
version: 6.3.0

# To simply ignore the checksum, you can set validate to false.
# The default is true; we are currently downloading the checksum.
# validate: false

# Attempt to use mirror url to keep travis tests from being blocked by
# apache for too many solr downloads.
mirror_url: http://lib-solr-mirror.princeton.edu/dist/
23 changes: 23 additions & 0 deletions lib/solr_wrapper_patch.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Hack to monkey-patch solr_wrapper to get the checksum
# file from archive.apache.org instead of www.us.apache.org .

# This monkey patch is based on :
# https://github.com/cbeer/solr_wrapper/pull/119/files
# When the patch is accepted, you can simply remove this file
# as well as the reference to it in /chf-sufia/lib/tasks/dev.rake

if Gem.loaded_specs["solr_wrapper"].version > Gem::Version.new('2.0.0')
puts(""" The solr_wrapper gem has been upgraded. Time to
remove the monkey-patch in
* lib/tasks/dev.rake
* lib/solr_wrapper_patch.rb .
""")
end

module SolrWrapper
class ChecksumValidator
def checksumurl(suffix)
"http://archive.apache.org/dist/lucene/solr/#{config.static_config.version}/solr-#{config.static_config.version}.zip.#{suffix}"
end
end
end
4 changes: 4 additions & 0 deletions lib/tasks/dev.rake
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ unless ENV['RAILS_ENV'] == "production"
require 'fcrepo_wrapper'
require 'active_fedora/rake_support'

# This can be removed when solr_wrapper is upgraded.
# See the patch file for more details.
require "#{Rails.root}/lib/solr_wrapper_patch"

namespace :dev do
# Starts Fedora and Solr, per config in `./config/solr_wrapper_test.rb` and
# and `./config/fcrepo_wrapper_test.rb`. You can still run individual files
Expand Down