From 1eb0d4ad2c4c7b71d5d73e75d83cda9d4b4244bf Mon Sep 17 00:00:00 2001 From: Mark Vanderwiel Date: Mon, 18 Aug 2014 15:18:40 -0500 Subject: [PATCH] Add Testing.md * match the other cookbooks for this testing file Change-Id: I70f78efff21effcfd6d3b49a9b306bcc44a279c3 Partial-Bug: #1350470 --- TESTING.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 TESTING.md diff --git a/TESTING.md b/TESTING.md new file mode 100755 index 0000000..476fefa --- /dev/null +++ b/TESTING.md @@ -0,0 +1,30 @@ +# Testing the Cookbook # + +This cookbook uses [bundler](http://gembundler.com/) and [berkshelf](http://berkshelf.com/) to isolate dependencies. + +To setup the dependencies: + + $ bundle install --path=.bundle # install gem dependencies + $ bundle exec berks vendor .cookbooks # install cookbook dependencies and create the folder .cookbooks + +To run the tests: + + $ export COOKBOOK='openstack-ceph' + $ bundle exec foodcritic -f any -t ~FC003 -t ~FC023 .cookbooks/$COOKBOOK + $ bundle exec rubocop .cookbooks/$COOKBOOK + $ bundle exec rspec --format documentation .cookbooks/$COOKBOOK/spec + +## Rubocop ## + +[Rubocop](https://github.com/bbatsov/rubocop) is a static Ruby code analyzer, based on the community [Ruby style guide](https://github.com/bbatsov/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](http://acrmp.github.io/foodcritic/) is a lint tool for Chef cookbooks. We ignore the following rules: + +* [FC003](http://acrmp.github.io/foodcritic/#FC003) These cookbooks are not intended for Chef Solo. +* [FC023](http://acrmp.github.io/foodcritic/#FC023) Prefer conditional attributes. + +## Chefspec + +[ChefSpec](http://code.sethvargo.com/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.