|
1 | | -This cookbook includes support for running tests via Test Kitchen (1.0). This has some requirements. |
| 1 | +This cookbook uses a variety of testing components: |
2 | 2 |
|
3 | | -1. You must be using the Git repository, rather than the downloaded cookbook from the Chef Community Site. |
4 | | -2. You must have Vagrant 1.1 installed. |
5 | | -3. You must have a "sane" Ruby 1.9.3 environment. |
| 3 | +- Unit tests: [ChefSpec](https://github.com/acrmp/chefspec) |
| 4 | +- Integration tests: [Test Kitchen](https://github.com/opscode/test-kitchen) |
| 5 | +- Chef Style lints: [Foodcritic](https://github.com/acrmp/foodcritic) |
| 6 | +- Ruby Style lints: [Rubocop](https://github.com/bbatsov/rubocop) |
6 | 7 |
|
7 | | -Once the above requirements are met, install the additional requirements: |
8 | 8 |
|
9 | | -Install the berkshelf plugin for vagrant, and berkshelf to your local Ruby environment. |
| 9 | +Prerequisites |
| 10 | +------------- |
| 11 | +To develop on this cookbook, you must have a sane Ruby 1.9+ environment. Given the nature of this installation process (and it's variance across multiple operating systems), we will leave this installation process to the user. |
10 | 12 |
|
11 | | - vagrant plugin install vagrant-berkshelf |
12 | | - gem install berkshelf |
| 13 | +You must also have `bundler` installed: |
13 | 14 |
|
14 | | -Install Test Kitchen 1.0 (unreleased yet, use the alpha / prerelease version). |
| 15 | + $ gem install bundler |
15 | 16 |
|
16 | | - gem install test-kitchen --pre |
| 17 | +You must also have Vagrant and VirtualBox installed: |
17 | 18 |
|
18 | | -Install the Vagrant driver for Test Kitchen. |
| 19 | +- [Vagrant](https://vagrantup.com) |
| 20 | +- [VirtualBox](https://virtualbox.org) |
19 | 21 |
|
20 | | - gem install kitchen-vagrant |
| 22 | +Once installed, you must install the `vagrant-berkshelf` plugin: |
21 | 23 |
|
22 | | -Once the above are installed, you should be able to run Test Kitchen: |
| 24 | + $ vagrant plugin install vagrant-berkshelf |
23 | 25 |
|
24 | | - kitchen list |
25 | | - kitchen test |
| 26 | + |
| 27 | +Development |
| 28 | +----------- |
| 29 | +1. Clone the git repository from GitHub: |
| 30 | + |
| 31 | + $ git clone git@github.com:opscode-cookbooks/COOKBOOK.git |
| 32 | + |
| 33 | +2. Install the dependencies using bundler: |
| 34 | + |
| 35 | + $ bundle install |
| 36 | + |
| 37 | +3. Create a branch for your changes: |
| 38 | + |
| 39 | + $ git checkout -b my_bug_fix |
| 40 | + |
| 41 | +4. Make any changes |
| 42 | +5. Write tests to support those changes. It is highly recommended you write both unit and integration tests. |
| 43 | +6. Run the tests: |
| 44 | + |
| 45 | + - `bundle exec rspec` |
| 46 | + - `bundle exec foodcritic .` |
| 47 | + - `bundle exec rubocop` |
| 48 | + - `bundle exec kitchen test` |
| 49 | + |
| 50 | +7. Assuming the tests pass, open a Pull Request on GitHub |
| 51 | +8. Open a JIRA ticket for this component, linking the JIRA ticket to the Pull Request and visa versa. |
| 52 | +9. Mark the JIRA ticket as "Fix Provided" |
| 53 | + |
| 54 | +For more information, see [Opscode's Contribution Guidelines](https://wiki.opscode.com/display/chef/How+to+Contribute). |
0 commit comments