Skip to content
This repository has been archived by the owner on Jun 13, 2019. It is now read-only.

Latest commit

 

History

History
63 lines (41 loc) · 1.36 KB

CONTRIBUTING.md

File metadata and controls

63 lines (41 loc) · 1.36 KB

Contributing

You will need Ruby installed, for version see: .ruby_version in the root.

Setup

You will need bundler (gem install bundler):

$ cd cookbooks-clone && make install

Run tests

Run all:

$ make test

Running individual tests

We use Appraisal to test against both Chef11.10 and Chef12.7. The Makefile-triggered commands always test against both versions.

To speed up development, below are some examples how to run only a part of the testsuite or only against one chef version:

Run only chef 12.7 specs:

$ bundle exec appraisal chef-12.7 rake spec

Run only specs for one cookbook with chef 11.10:

$ bundle exec appraisal chef-11.10 rake spec[cookbookname]

Run only one spec for a cookbook with both versions:

$ bundle exec appraisal rake spec[cookbookname,specname]

Add tests

It's a good habit to add tests for code that is introduced.

Available are:

It's complicated

Sometimes tests are not enough and you need to setup a small VM. We have a few Vagrant setups in vagrant-test.

General CI

The following is run on Travis-CI:

$ make test && make cs

Please run these before pushing upstream to save resources and time.