-
Notifications
You must be signed in to change notification settings - Fork 41
For Contributors
- Clone the Hydra-Head code (to a fresh working copy)
git clone [email protected]:samvera/hydra-head.git
- Switch to the hydra-head directory
cd hydra-head
- Install bundler gem
gem install bundler
- Get the project dependencies
bundle install
- Run the tests
bundle exec rake ci
This rake task:- creates the test app in .internal_test_app
- spins up solr (in solr_wrapper)
- spins up fedora (in fcrepo_wrapper)
- imports fixtures
- runs rspec
- kills solr & fedora
Sometimes the versions of gems needed for development outpace the gems needed for the gemspec itself. It is valuable to keep the requirements for the gem itself as broad as possible, to allow for broad adoption, but gems we use exclusively for development and testing may require a higher version of a gem, particularly rails. To test the gem using a higher version of rails you can set the environment variable RAILS_VERSION
and then bundle install
. E.g. RAILS_ENV=">= 5.2.4" bundle install
Sometimes in the course of generating the internal_test_app the Gemfile.lock of the gem itself and the internal_test_app’s Gemfile.lock can get out of sync. If that happens, you can run
bundle update [angry_gem]
If you are testing and decide to use different versions of Ruby or particular gems, you can delete both Gemfile.lock files and re-bundle using
bundle install
In order to run a single spec, in one terminal window start the test server using
bundle exec rake test_server
then in another window use the following from the command line:
bundle exec rake spec SPEC=spec/controllers/catalog_controller_spec.rb # path to the spec file you wish to run
When running individual tests, you may get success on one gem and failure on the other gem – this is expected, since some tests exist only in a single gem.