I’m trying to get test-kitchen to work and am running into some issues
that I was hoping to get some help with.
In our organization git repo, we have all our Chef cookbooks in git
repos named “cookbook-X”, where X is a project we work on.
For example, we work on the OpenStack Nova project. We have a repo
called github.com:att-cloud/nova that houses our Nova code changes and a
repo called github.com:att-cloud/cookbook-nova that houses our cookbook
The above seems to me to be a very common developer scenario, but
apparently it’s not what many tools in the Chef ecosystem are hard-coded
to look for – namely ChefSpec and test-kitchen.
For ChefSpec, we get around the problem of ChefSpec not being able to
find the cookbook by doing this:
mkdir -p cookbooks
ln -s … cookbooks/$short_name
Where $short_name would be just “nova”.
This little hack allows ChefSpec to run properly.
Unfortunately, we can’t seem to figure out how to do the same thing with
If I run kitchen init && kitchen test in our cookbook-nova root dir,
things look like this:
There are a number of Foodcritic failures like this:
FC007: Ensure recipe dependencies are reflected in cookbook metadata:
Which refer to an include_recipe that refers to a “nova::”
If I go into test/kitchen/Kitchenfile and change this line:
cookbook “cookbook-nova” do
cookbook “nova” do
I get more failures when running kitchen test:
How do others get around this problem? I can’t imagine that our shop is
the only one that has developers working on projects and cookbooks that
have similar naming conventions… since you can’t have the code and the
cookbook repo named the same thing.
Any and all advice most appreciated,