I'm trying to test a cookbook that depends on three other local cookbooks. My directory structure looks like this:
/cookbooks/
cookbook_test/
recipes
templates
metadata.rb
cookbook_dep1/
cookbook_dep2/
cookbook_dep3/
My metadata file in the cookbook I'm trying to test (cookbook_test) simply has the other three cookbook dependencies mentioned like:
depends cookbook_dep1
depends cookbook_dep2
depends cookbook_dep3
However when running kitchen converge default-ubuntu-1204
I get the following:
[2014-03-03T18:05:13+00:00] ERROR: Cookbook cookbook_devp1 not found. If you're loading cookbook_devp1 from another cookbook, make sure you configure the dependency in your metadata
[2014-03-03T18:05:13+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
The only thing I could find online is that I should be using berkshelf. Is there no other way of referencing local cookbooks with test-kitchen only ?
A general overview: a test kitchen is a kitchen most often equipped with multiple cooking stations where test cooks and chefs research, test and develop recipes for home cooks. Recipes are often testing multiple times and critiqued by many people.
The “kitchen test” command is used to fully test the cookbooks in a CI/CD pipeline and is an elaborate process consisting of creating a new instance, converging it, verifying and then destroying the instance.
You have to put the dependencies into a directory named "cookbooks" (or "site-cookbooks") in the same directory where .kitchen.yml is. Or use Berkshelf or Librarian-Chef.
You could also try to just symlink the parent directory into "./cookbooks", but not sure if that would cause infinite recursion for some command.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With