Files
cookbook-openstack-block-st…/TESTING.md
Matt Ray 60e37c5eb0 Unified Rubocop cleanups under single file.
Consolidate all the .rubocop.yml into a single file, finished out cleanups for
all the Ruby files.

Change-Id: I92d5983724d5d0185cd25bea6a0f46657a6c05d4
Addresses: blueprint rubocop-for-block-storage
2014-01-17 15:35:20 -06:00

1.5 KiB

Testing the Cookbook

This cookbook uses bundler, berkshelf, and strainer to isolate dependencies and run tests.

Tests are defined in Strainerfile, which in turn calls rubocop, knife, foodcritic and chefspec.

To run the tests:

$ bundle install --path=.bundle # install gem dependencies
$ bundle exec berks install --path=.cookbooks # install cookbook dependencies
$ bundle exec strainer test -s Strainerfile # run tests

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.

Knife

knife cookbook test is used to check the cookbook's Ruby and ERB files for basic syntax errors.

Foodcritic

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

FC003 these cookbooks are not intended for Chef Solo.

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.