Skip to content

Commit

Permalink
Overhaul TESTING.md (fix for issue #39).
Browse files Browse the repository at this point in the history
  • Loading branch information
flaccid committed Mar 12, 2016
1 parent 8fbdc26 commit e9be1be
Showing 1 changed file with 41 additions and 14 deletions.
55 changes: 41 additions & 14 deletions TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,57 @@ Testing
=======

Preparation
-----
-----------

Install Chef DK by following https://docs.chef.io/install_dk.html.

Ensure both bin dirs from chefdk take precedence in your `$PATH`:

$ export PATH="/opt/chefdk/bin:/opt/chefdk/embedded/bin:$PATH"

List the rake tasks available:

$ rake -T

Install the gem dependencies and cookbooks:

$ bundle install
$ rake prepare

And then, to install all cookbooks:
All
---

$ bundle exec berks install
Run all tests, write a symphony while you wait:

Local
$ rake test

Style
-----

$ bundle exec strainer test
Rubocop and Foodcritic:

$ rake style

The above runs:
Unit
----

- `knife cookbook test` tests
- Food Critic lint
- Chefspec tests
Currently ChefSpec only:

Chefspec tests (the interesting part) are in `spec/`.
$ rake unit

Integration
-----------

$ bundle exec kitchen test

See `.kitchen.yml` and `test/` directory for details.
$ rake kitchen:all

See `.kitchen.yml` and `test/` directory for details.

Additional Information
----------------------

Rake is used as a wrapper, providing quick commands to do key tests. Feel free
to use all the different methods provided by Chef DK and the development files
included in the cookbook.

These testing methods are also supported, although appear outdated at this time:

https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/TESTING.MD

0 comments on commit e9be1be

Please sign in to comment.