-
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]:projecthydra/hydra-head.git
- Switch to the hydra-head directory
cd hydra-head
- Install bundler gem
gem install bundler
- Get the project dependencies
bundle install
- Grab the jetty submodule
git submodule init; git submodule update
- Run the tests
rake ci
This rake task:- creates the test app in tmp/test_app
- spins up jetty (in jettywrapper)
- imports fixtures
- runs rspec & cucumber tests
- kills jetty (in jettywrapper)
In order to test the gem during development, the hydra-jetty is included as a submodule to provide both a fedora and solr instance. Once you have cloned the github repository, run the following commands to load hydra-jetty:
git submodule init git submodule update
To start jetty:
rake jetty:start
Note: the first time you start hydra-jetty, you must use the following command in order to properly configure jetty:
rake hydra:jetty:load
The gem must be tested within the context of a Rails 3 application.
A rake task is provided for setting up a rails 3 test app in the tmp/test_app directory. To generate the app, run:
rake hyhead:setup_test_app
The specs, features and fixtures for testing the Hydra-Head gem are all contained within the test_support directory of the gem. Once you have installed the test app and have Hydra-Jetty running, you will be able to run the specs/features from within that app via the provided rake tasks.
To run both the specs and cucumber features (from within the test application):
rake hyhead:test
In order to run a single spec or cucumber feature, use the following from the command line:
export RAILS_ROOT="tmp/test_app" rspec test_support/spec/controllers/catalog_controller_spec.rb # path to the spec file you wish to run cucumber test_support/features/mods_asset_show.feature # path to the feature file you wish to run
In order to more quickly install the required gems, the gems have been cached and are stored in the vendor/cache directory. This was done to reduce the time bundler took to install all the gems and their dependencies. To get all the requisite gems, simply run:
bundle install --local
The cached gems also provide a quick means for generating a gemset for the test_app.
When developing the hydra-head gem, be sure to commit any changes to the vendor/cache directory when you update or install a new gem.
When you change the Solr and Fedora config files, you must update them in the generator templates directory (lib/generators/hydra-head) as well as root of the hydra_head code.