Skip to content

For Contributors

Max Kadel edited this page Mar 12, 2021 · 15 revisions

For Contributors to the Hydra-Head Gem

Testing the Gem

For the Impatient

  1. Clone the Hydra-Head code (to a fresh working copy)
    git clone [email protected]:samvera/hydra-head.git
  2. Switch to the hydra-head directory
    cd hydra-head
  3. Install bundler gem
    gem install bundler
  4. Get the project dependencies
    bundle install
  5. Run the tests
    bundle exec rake ci

    This rake task:
    1. creates the test app in .internal_test_app
    2. spins up solr (in solr_wrapper)
    3. spins up fedora (in fcrepo_wrapper)
    4. imports fixtures
    5. runs rspec
    6. kills solr & fedora

More Detailed Instructions & Notes

Testing the gem

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.

Clone this wiki locally