There are two collections of tests in the Razor project, our unit tests, and the acceptance tests.
The unit test suite is kind of incomplete right now - most of it is placeholders that do nothing beyond a syntax check. You should still run it before you submit something, though, since it is better than no checking.
To run that:
rspec spec # whee!
You can run the acceptance rspec suite fairly easily:
- Install
MongoDB
and have it running. - Install
nodejs
andnpm
. - Install the required node modules. (See the Puppet module for details)
- Install the required gems. (See the Puppet module for details, again)
- Make sure you don't care about your data! This will DESTROY the Razor database!
- Start razor with
/opt/razor/bin/razor_daemons.rb start
- Run
rspec acceptance/spec
If you want to use our full acceptance suite, which saves you destroying your local data, and provides a bunch of valuable additional testing you are welcome to. It is not totally trivial to get working, but should be possible even outside our offices:
- Get a copy of the Razor git repo. (
$REPO
will represent that in future.) - Get a copy of the puppet-acceptance git repository.
- Follow their documentation for which VM systems work, and how to interface with them.
- Build a new Ubuntu 12.04 64-bit VM, bare bones, nothing installed but the base system.
- Create a snapshot named something like
razor-test-base
. (Shut off the VM while you do this.) - Modify the configuration file in
acceptance/razor-acceptance.cfg
for your VM system. - Grab the latest successful artifact from the Puppet module build CI system
- Put that as the only tarball in
$REPO/pkg
- Run something akin it
cd $REPO && WORKSPACE=$REPO ../puppet-acceptance/systest.rb --vmrun fusion -c local-acceptance.cfg --type manual -t acceptance --debug
That should go through, build, and test everything for you. Ask on the mailing list if it isn't sufficient to get a test run going.