This problem arises when you:
test
cookbook under test/fixtures/cookbooks/
to exercise the library. That is test/fixtures/cookbooks/test/recipes/system.rb
describe 'test::system'
When using Berkshelf you would use group :integration do ... end
to include the test cookbook only when running tests.
How do you write a Policyfile that only references the test cookbook when running tests?
Right now I have my policyfile always packaging the test cookbook. Not ideal but acceptable to get something that just works in a test environment. Not sustainable over the longer term.
Appreciate any hints, tips or incantations.
Create two Policyfiles.
One of them contains the recipes/attributes that you would run on a "real" node. The other contains what is needed to exercise the cookbook in test kitchen.
You can specify a Policyfile path in kitchen.rb
.
suites:
- name: default
provisioner:
policyfile_path: policies/kitchen.rb