- From: Yoshi Spendiff <
>
- To:
- Subject: [chef] Re: Testing advice
- Date: Wed, 30 Sep 2015 12:36:23 -0700
For the Rspec tests I'm assuming you mean ChefSpec, in which case you only cover the code you write in your own cookbook. If you use the berkshelf plug-in then it by defaults filters the checks against code only in your cookbook. Remember to turn on code coverage resports.
These two posts cover it well:
https://sethvargo.com/chef-recipe-code-coverage/
For the ServerSpec tests you check that the end result scenario of all of your cookbook code worked, e.g. so certain services are started, certain files are created as the end result of a run (not files deployed by chef), certain ports are listening and so on. Avoid duplicating tests that the upstream cookbooks already implement and there's little point duplicating tests implemented by ChefSpec unless you're super duper paranoid about something working.
Archive powered by MHonArc 2.6.16.