Skip to content
This repository has been archived by the owner on Jan 8, 2022. It is now read-only.

Commit

Permalink
Merge pull request #155 from sul-dlss/test_solr6
Browse files Browse the repository at this point in the history
Test on Solr 6 using solr_wrapper
  • Loading branch information
tingulfsen committed Jul 25, 2018
2 parents 2b24c34 + 6783887 commit 8258c26
Show file tree
Hide file tree
Showing 10 changed files with 271 additions and 264 deletions.
5 changes: 5 additions & 0 deletions .solr_wrapper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
port: 8984
version: 6.6.5
collection:
dir: solr_conf/conf/
name: hydrus-test
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ gem 'uglifier', '>= 1.0.3'

group :development, :test do
gem 'factory_bot_rails'
gem 'solr_wrapper', '~> 2.0'
gem 'jettywrapper', '~> 2.0'
gem 'sqlite3'
gem 'rspec-rails', '~> 3.1'
Expand Down
7 changes: 7 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ GEM
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
retriable (3.1.2)
retries (0.0.5)
rsolr (1.0.13)
builder (>= 2.1.2)
Expand Down Expand Up @@ -459,6 +460,11 @@ GEM
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
solr_wrapper (2.0.0)
faraday
retriable
ruby-progressbar
rubyzip
solrizer (3.4.1)
activesupport
daemons
Expand Down Expand Up @@ -561,6 +567,7 @@ DEPENDENCIES
rubocop (~> 0.56.0)
sass-rails (~> 4.0)
simplecov
solr_wrapper (~> 2.0)
sqlite3
sul_chrome (~> 0.1.0)
uglifier (>= 1.0.3)
Expand Down
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ Digital Repository for preservation and access.
## Setting up your environment

First, you need a Java runtime so you can have a local Solr and Fedora instance for development/testing.
One way to install Solr/Fedora is by using hydra-jetty, which is what the instructions below assume
One way to install Solr/Fedora is by using solr_wrapper and jetty_wrapper (for Fedora),
which is what the instructions below assume

```bash
rvm install 2.3.4
Expand All @@ -24,11 +25,12 @@ cd hydrus
bundle install

rake jetty:clean # download hydra-jetty
rake hydra:jetty:config # configure hydra-jetty

# Create a config/settings.local.yml file, adding passwords, etc. Talk to another developer to see what is needed here.

rake jetty:start # start your local solr/fedora
rake jetty:start # start your local fedora

solr_wrapper # start Solr. Do this in a separate terminal window.

rake db:migrate
rake db:test:prepare
Expand All @@ -40,10 +42,12 @@ rake hydrus:refreshfix RAILS_ENV=test

## Running the application

Assuming you are using hydra-jetty for solr/fedora, start the Jetty server:
Assuming you are using solr_wrapper for Solr and jetty_wrapper for Fedora,
start the servers:

```bash
rake jetty:start
solr_wrapper # Do this in a separate terminal window.
```

Run the Hydrus application in either of these ways:
Expand All @@ -67,7 +71,7 @@ docker run -d -p 127.0.0.1:3002:3000 suldlss/suri-rails:latest
* Jetty - [http://localhost:8983](http://localhost:8983)
* Fedora admin - [http://localhost:8983/fedora/admin](http://localhost:8983/fedora/admin)
* Fedora objects - [http://localhost:8983/fedora/objects](http://localhost:8983/fedora/objects)
* Solr - [http://localhost:8983/solr](http://localhost:8983/solr)
* Solr - [http://localhost:8984/solr](http://localhost:8983/solr)

## User accounts used during development

Expand Down
2 changes: 1 addition & 1 deletion config/settings/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ suri:
mint_ids: false

solr:
url: http://localhost:8983/solr/test
url: http://localhost:8984/solr/hydrus-test
4 changes: 2 additions & 2 deletions config/solr.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
development:
url: http://localhost:8983/solr/development
url: http://localhost:8984/solr/hydrus-test

test:
url: http://localhost:8983/solr/test
url: http://localhost:8984/solr/hydrus-test
20 changes: 12 additions & 8 deletions lib/tasks/ci.rake
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
if defined? Jettywrapper
# Only in dev/test
Jettywrapper.hydra_jetty_version = 'v7.0.0'
end
# This tells Jettywrapper where to download from
ZIP_URL = 'https://github.com/sul-dlss/fcrepo3-jetty/archive/master.zip'

desc 'Run Continuous Integration Suite (tests, coverage, docs)'
task ci: [:rubocop, 'jetty:clean', 'jetty:config'] do
task ci: [:rubocop] do
unless Rails.env.test?
# force any CI sub-tasks to run in the test environment (e.g. to ensure
# fixtures get loaded into the right places)
Expand All @@ -13,16 +11,22 @@ task ci: [:rubocop, 'jetty:clean', 'jetty:config'] do
end

Rake::Task['db:migrate'].invoke
Rake::Task['jetty:clean'].invoke

jetty_params = Jettywrapper.load_config.merge({
jetty_home: File.expand_path(File.dirname(__FILE__) + '/../../jetty'),
jetty_home: File.expand_path(File.dirname(__FILE__) + '../../../jetty'),
startup_wait: 90
})

error = nil
error = Jettywrapper.wrap(jetty_params) do
Rake::Task['hydrus:refreshfix'].invoke
Rake::Task['spec'].invoke
SolrWrapper.wrap do |solr|
solr.with_collection(name: 'hydrus-test',
dir: File.join(File.expand_path('../..', File.dirname(__FILE__)), 'solr_conf', 'conf')) do
Rake::Task['hydrus:refreshfix'].invoke
Rake::Task['spec'].invoke
end
end
end
raise "TEST FAILURES: #{error}" if error
end
2 changes: 1 addition & 1 deletion lib/tasks/fixtures.rake
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ namespace :hydrus do
# Restore jetty to initial state.
Rake::Task['jetty:stop'].invoke
Rake::Task['jetty:clean'].invoke
Rake::Task['hydra:jetty:config'].invoke
Rake::Task['hydra:jetty:config_fedora'].invoke
Rake::Task['jetty:start'].invoke
Rake::Task['hydrus:clear_upload_files'].invoke
end
Expand Down
Loading

0 comments on commit 8258c26

Please sign in to comment.