-
Notifications
You must be signed in to change notification settings - Fork 163
Developer setup
To start developing Razor code, first follow the instructions in Installation.
- Make sure
test.database_url
in yourconfig.yaml
is set properly - (Re)create the test database with
rake db:reset[test]
- Run tests with
rake spec:all
orrspec spec
- Run individual tests with
rspec spec/some_spec.rb
As of now, coverage generation through SimpleCov is automatically enabled for all spec test runs. This doesn't substantially change the runtime of the tests.
You should set JRUBY_OPTS='--debug'
in your environment to avoid the warning
about reduced coverage accuracy -- or simply ignore the warning, which does
not change the accuracy of the tests themselves.
(The same option is required if you intend to use a debugger with JRuby.)
Since you will be redeploying the application quite a bit, it is recommended to start torquebox with
torquebox run --jvm-options='-XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled' --bind-address=0.0.0.0
To restart the Razor server automatically whenever you change any if its files, you simply need to touch the file deployments/razor-server-knob.yml.deployed
inside the torquebox installation. The following script does that (ab)using rerun:
#! /bin/bash
export RBENV_VERSION=1.9.3-p392
export TBX=$(bundle show torquebox)
# Assume we are stored inside razor-server/LOCAL/
cd $(dirname $0)/..
exec rerun -x -- touch $TBX/deployments/razor-server-knob.yml.deployed