Skip to content
This repository has been archived by the owner on Jun 4, 2021. It is now read-only.

Developer setup

David Lutterkort edited this page Aug 21, 2013 · 11 revisions

To start developing Razor code, first follow the instructions in Installation.

Running tests

  • Make sure test.database_url in your config.yaml is set properly
  • (Re)create the test database with rake db:reset[test]
  • Run tests with rake spec:all or rspec spec
  • Run individual tests with rspec spec/some_spec.rb

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.)

JVM settings

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

Restart the server when you make changes

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
Clone this wiki locally