From 111841eb1335cc2fc87b5c52d0ffe858290ca50c Mon Sep 17 00:00:00 2001 From: Chris Gianelloni Date: Tue, 5 Dec 2017 15:12:58 -0500 Subject: [PATCH] Add TESTING.md Signed-off-by: Chris Gianelloni --- TESTING.md | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 TESTING.md diff --git a/TESTING.md b/TESTING.md new file mode 100644 index 0000000..0665212 --- /dev/null +++ b/TESTING.md @@ -0,0 +1,44 @@ +This cookbook uses a variety of testing components: + +- Unit tests: [ChefSpec](https://docs.chef.io/chefspec.html) +- Integration tests: [Test Kitchen](http://kitchen.ci/) +- Chef Style lints: [Foodcritic](http://www.foodcritic.io/) +- Ruby Style lints: [cookstyle](https://github.com/chef/cookstyle) + + +Prerequisites +------------- +You can install the [Chef Development Kit (Chef-DK)](http://downloads.chef.io/chef-dk/) to more easily install the above components. + +You must also have Vagrant and VirtualBox installed: + +- [Vagrant](https://vagrantup.com) +- [VirtualBox](https://virtualbox.org) + + +Development +----------- +1. Clone the git repository from GitHub: + + - `git clone git@github.com:caskdata/hadoop_cookbook.git` + +2. Install the dependencies using bundler: + + - `chef exec bundle install --path ../vendor` + +3. Create a branch for your changes: + + - `git checkout -b my_bug_fix` + +4. Make any changes +5. Write tests to support those changes. It is highly recommended you write both unit and integration tests. +6. Run the tests: + + - `chef exec bundle exec rspec` + - `chef exec bundle exec foodcritic .` + - `chef exec bundle exec rubocop` + - `chef exec bundle exec kitchen test` + +7. Assuming the tests pass, open a Pull Request on GitHub + +For more information, see [the cookbook's Contribution Guidelines](https://github.com/caskdata/hadoop_cookbook/blob/master/CONTRIBUTING.md)