cookbook-openstack-common/TESTING.md
Mark Vanderwiel 775ad40140 Cleanup cookbook contact info
* Consistent email across cookbooks
* Add Contributor.md to help out new folks
* Fix file modes
* Fix broken link in Testing.md
* Readme tweaks

Change-Id: I5bcf8724b1d8ea9833102f53b21b4c938d4615f0
Partial-Bug: #1342735
2014-10-13 11:31:42 -05:00

1.6 KiB

Testing the Cookbook

This cookbook uses bundler and berkshelf to isolate dependencies. Make sure you have ruby 1.9.x, bundler, rake, build essentials and the header files for gecode installed before continuing. Make sure that you're using gecode version 3. More info here.

We have three test suites which you can run either, individually (there are three rake tasks):

$ rake lint
$ rake style
$ rake unit

or altogether:

$ rake test

The rake tasks will take care of installing the needed gem dependencies and cookbooks with berkshelf.

Rubocop

Rubocop is a static Ruby code analyzer, based on the community Ruby style guide. We are attempting to adhere to this where applicable, slowly cleaning up the cookbooks until we can turn on Rubocop for gating the commits.

Foodcritic

Foodcritic is a lint tool for Chef cookbooks. We ignore the following rules:

  • FC003 These cookbooks are not intended for Chef Solo.
  • FC023 Prefer conditional attributes.

Chefspec

ChefSpec is a unit testing framework for testing Chef cookbooks. ChefSpec makes it easy to write examples and get fast feedback on cookbook changes without the need for virtual machines or cloud servers.