# Test-kitchen cookbook dependencies

**URL:** <https://discourse.chef.io/t/test-kitchen-cookbook-dependencies/6493>\
**Category:** Chef Infra (archive)\
**Created:** [April 17, 2015, 6:44pm UTC](https://discourse.chef.io/t/test-kitchen-cookbook-dependencies/6493 "2015-04-17T18:44:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Morgan\_Blackthorne](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/morgan_blackthorne/32/100_2.png) [@Morgan\_Blackthorne](https://discourse.chef.io/u/Morgan_Blackthorne)\
**Post date:** [April 17, 2015, 6:44pm UTC](https://discourse.chef.io/t/test-kitchen-cookbook-dependencies/6493/1 "2015-04-17T18:44:12Z")

</div>

ashdcsbamboo00:~/git/RS-DCS-Base$ kitchen test  
.  
.  
.  
Thank you for installing Chef!  
Transferring files to   
Starting Chef Client, version 12.2.1  
Compiling Cookbooks...

```
   Running handlers:
   [2015-04-17T18:39:48+00:00] ERROR: Running exception handlers
   Running handlers complete
   [2015-04-17T18:39:48+00:00] ERROR: Exception handlers complete
   [2015-04-17T18:39:48+00:00] FATAL: Stacktrace dumped to

```

/tmp/kitchen/cache/chef-stacktrace.out  
Chef Client failed. 0 resources updated in 1.315520495 seconds  
[2015-04-17T18:39:48+00:00] ERROR: Cookbook RS-DCS-Chef not found.  
If you're loading RS-DCS-Chef from another cookbook, make sure you  
configure the dependency in your metadata  
[2015-04-17T18:39:48+00:00] FATAL:  
Chef::Exceptions::ChildConvergeError: Chef run process exited  
unsuccessfully (exit code 1)

> > > > > > ## Converge failed on instance . Please see .kitchen/logs/default-ubuntu-1404.log for more details ------Exception------- Class: Kitchen::ActionFailed Message: SSH exited (1) for command: [sh -c ' sudo -E /opt/chef/bin/chef-solo --config /tmp/kitchen/solo.rb --log\_level auto --force-formatter --no-color --json-attributes /tmp/kitchen/dna.json ']

ashdcsbamboo00:~/git/RS-DCS-Base$ more metadata.rb  
.  
.  
.

%w(sudo apt sssd\_ldap RS-DCS-Inventory RS-DCS-Chef RS-DCS-Postfix).each do  
|cb|  
depends cb  
end

supports 'ubuntu', '\>= 10.04'  
supports 'debian', '\>= 6.0'  
supports 'centos', '\>= 6.0'  
supports 'oracle', '\>= 5.0'  
supports 'amazon', '\>= 2014.03'  
supports 'redhat', '\>= 5.0'  
ashdcsbamboo00:~/git/RS-DCS-Base$ cat .kitchen.yml  
driver\_plugin: docker  
driver\_config:  
socket: tcp://localhost:5000  
require\_chef\_omnibus: true  
customize:  
memory: 1024

platforms:

- name: ubuntu-14.04
- name: ubuntu-12.04
- name: ubuntu-10.04
- name: centos-6.5
- name: centos-5.10
- name: centos-7.0

suites:

- name: default  
run\_list:
  - recipe[RS-DCS-Base]

Any ideas about what I need to do to make chef-solo copy over cookbook  
dependencies when using test-kitchen?

--  
~_~ StormeRider ~_~

"Every world needs its heroes [...] They inspire us to be better than we  
are. And they protect from the darkness that's just around the corner."

(from Smallville Season 6x1: "Zod")

On why I hate the phrase "that's so lame"... [http://bit.ly/Ps3uSS](http://bit.ly/Ps3uSS)

---

<div class="post-metadata">

**Author:** ![James\_Erickson](https://avatars.discourse-cdn.com/v4/letter/j/dc4da7/32.png) [@James\_Erickson](https://discourse.chef.io/u/James_Erickson)\
**Post date:** [April 17, 2015, 7:13pm UTC](https://discourse.chef.io/t/test-kitchen-cookbook-dependencies/6493/2 "2015-04-17T19:13:29Z")

</div>

Using Berkshelf/Berksfile should be able to solve the issue you are seeing.  
Example (stolen):  
cookbook 'application', git: 'git@github.com:company-cookbook/application.git'  
cookbook 'nginx', git: 'git@github.com:company-cookbook/nginx.git'  
cookbook 'unicorn', git: 'git@github.com:company-cookbook/unicorn.git'

Basically, it needs a way to know where to find the cookbooks, if that’s a supermarket, berks api, git, local path, etc.

--  
James

From: Morgan Blackthorne [[mailto:stormerider@gmail.com](mailto:stormerider@gmail.com)]  
Sent: Friday, April 17, 2015 1:44 PM  
To: [chef@lists.opscode.com](mailto:chef@lists.opscode.com)  
Subject: [chef] Test-kitchen cookbook dependencies

ashdcsbamboo00:~/git/RS-DCS-Base$ kitchen test  
.  
.  
.  
Thank you for installing Chef!  
Transferring files to   
Starting Chef Client, version 12.2.1  
Compiling Cookbooks...

```
   Running handlers:
   [2015-04-17T18:39:48+00:00] ERROR: Running exception handlers
   Running handlers complete
   [2015-04-17T18:39:48+00:00] ERROR: Exception handlers complete
   [2015-04-17T18:39:48+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
   Chef Client failed. 0 resources updated in 1.315520495 seconds
   [2015-04-17T18:39:48+00:00] ERROR: Cookbook RS-DCS-Chef not found. If you're loading RS-DCS-Chef from another cookbook, make sure you configure the dependency in your metadata
   [2015-04-17T18:39:48+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

```

> > > > > > ## Converge failed on instance . Please see .kitchen/logs/default-ubuntu-1404.log for more details ------Exception------- Class: Kitchen::ActionFailed Message: SSH exited (1) for command: [sh -c ' sudo -E /opt/chef/bin/chef-solo --config /tmp/kitchen/solo.rb --log\_level auto --force-formatter --no-color --json-attributes /tmp/kitchen/dna.json ']

ashdcsbamboo00:~/git/RS-DCS-Base$ more metadata.rb  
.  
.  
.

%w(sudo apt sssd\_ldap RS-DCS-Inventory RS-DCS-Chef RS-DCS-Postfix).each do |cb|  
depends cb  
end

supports 'ubuntu', '\>= 10.04'  
supports 'debian', '\>= 6.0'  
supports 'centos', '\>= 6.0'  
supports 'oracle', '\>= 5.0'  
supports 'amazon', '\>= 2014.03'  
supports 'redhat', '\>= 5.0'  
ashdcsbamboo00:~/git/RS-DCS-Base$ cat .kitchen.yml  
driver\_plugin: docker  
driver\_config:  
socket: tcp://localhost:5000  
require\_chef\_omnibus: true  
customize:  
memory: 1024

platforms:

- name: ubuntu-14.04
- name: ubuntu-12.04
- name: ubuntu-10.04
- name: centos-6.5
- name: centos-5.10
- name: centos-7.0

suites:

- name: default  
run\_list:
  - recipe[RS-DCS-Base]

Any ideas about what I need to do to make chef-solo copy over cookbook dependencies when using test-kitchen?

--  
~_~ StormeRider ~_~  
"Every world needs its heroes [...] They inspire us to be better than we are. And they protect from the darkness that's just around the corner."

(from Smallville Season 6x1: "Zod")

On why I hate the phrase "that's so lame"... [http://bit.ly/Ps3uSS](http://bit.ly/Ps3uSS)

\*\*\*\*\*\*\* CONFIDENTIALITY NOTICE \*\*\*\*\*\*\*

This e-mail message and all attachments transmitted with it may contain legally privileged and confidential information intended solely for the use of the addressee. If the reader of this message is not the intended recipient, you are hereby notified that any reading, dissemination, distribution, copying, or other use of this message or its attachments is strictly prohibited. If you have received this message in error, please notify the sender immediately and delete this message from your system. Thank you.

---

<div class="post-metadata">

**Author:** ![Morgan\_Blackthorne](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/morgan_blackthorne/32/100_2.png) [@Morgan\_Blackthorne](https://discourse.chef.io/u/Morgan_Blackthorne)\
**Post date:** [April 17, 2015, 7:43pm UTC](https://discourse.chef.io/t/test-kitchen-cookbook-dependencies/6493/3 "2015-04-17T19:43:28Z")

</div>

Aha, thanks. I forgot that I needed to render my Berksfile.erb into a real  
Berksfile(.lock) first.

--  
~_~ StormeRider ~_~

"Every world needs its heroes [...] They inspire us to be better than we  
are. And they protect from the darkness that's just around the corner."

(from Smallville Season 6x1: "Zod")

On why I hate the phrase "that's so lame"... [http://bit.ly/Ps3uSS](http://bit.ly/Ps3uSS)

On Fri, Apr 17, 2015 at 12:13 PM, James Erickson [James.Erickson@wnco.com](mailto:James.Erickson@wnco.com)  
wrote:

> Using Berkshelf/Berksfile should be able to solve the issue you are  
> seeing.
> 
> Example (stolen):
> 
> cookbook 'application', git: 'git@github.com:  
> company-cookbook/application.git'
> 
> cookbook 'nginx', git: 'git@github.com:company-cookbook/nginx.git'
> 
> cookbook 'unicorn', git: 'git@github.com:company-cookbook/unicorn.git'
> 
> Basically, it needs a way to know where to find the cookbooks, if that’s a  
> supermarket, berks api, git, local path, etc.
> 
> --
> 
> James
> 
> _From:_ Morgan Blackthorne [[mailto:stormerider@gmail.com](mailto:stormerider@gmail.com)]  
> _Sent:_ Friday, April 17, 2015 1:44 PM  
> _To:_ [chef@lists.opscode.com](mailto:chef@lists.opscode.com)  
> _Subject:_ [chef] Test-kitchen cookbook dependencies
> 
> ashdcsbamboo00:~/git/RS-DCS-Base$ kitchen test
> 
> .
> 
> .
> 
> .
> 
> Thank you for installing Chef!
> 
> ```
> Transferring files to <default-ubuntu-1404>
> 
> Starting Chef Client, version 12.2.1
> 
> Compiling Cookbooks...
> 
> Running handlers:
> 
> [2015-04-17T18:39:48+00:00] ERROR: Running exception handlers
> 
> Running handlers complete
> 
> [2015-04-17T18:39:48+00:00] ERROR: Exception handlers complete
> 
> [2015-04-17T18:39:48+00:00] FATAL: Stacktrace dumped to
> 
> ```
> 
> /tmp/kitchen/cache/chef-stacktrace.out
> 
> ```
> Chef Client failed. 0 resources updated in 1.315520495 seconds
> 
> [2015-04-17T18:39:48+00:00] ERROR: Cookbook RS-DCS-Chef not found.
> 
> ```
> 
> If you're loading RS-DCS-Chef from another cookbook, make sure you  
> configure the dependency in your metadata
> 
> ```
> [2015-04-17T18:39:48+00:00] FATAL:
> 
> ```
> 
> Chef::Exceptions::ChildConvergeError: Chef run process exited  
> unsuccessfully (exit code 1)
> 
> > > > > > > Converge failed on instance .
> 
> > > > > > > Please see .kitchen/logs/default-ubuntu-1404.log for more details
> 
> > > > > > > ------Exception-------
> 
> > > > > > > Class: Kitchen::ActionFailed
> 
> > > > > > > Message: SSH exited (1) for command: [sh -c '
> 
> sudo -E /opt/chef/bin/chef-solo --config /tmp/kitchen/solo.rb --log\_level  
> auto --force-formatter --no-color --json-attributes /tmp/kitchen/dna.json
> 
> ']
> 
> > > > > > > * * *
> 
> ashdcsbamboo00:~/git/RS-DCS-Base$ more metadata.rb
> 
> .
> 
> .
> 
> .
> 
> %w(sudo apt sssd\_ldap RS-DCS-Inventory RS-DCS-Chef RS-DCS-Postfix).each do  
> |cb|
> 
> depends cb
> 
> end
> 
> supports 'ubuntu', '\>= 10.04'
> 
> supports 'debian', '\>= 6.0'
> 
> supports 'centos', '\>= 6.0'
> 
> supports 'oracle', '\>= 5.0'
> 
> supports 'amazon', '\>= 2014.03'
> 
> supports 'redhat', '\>= 5.0'
> 
> ashdcsbamboo00:~/git/RS-DCS-Base$ cat .kitchen.yml
> 
> driver\_plugin: docker
> 
> driver\_config:
> 
> socket: tcp://localhost:5000
> 
> require\_chef\_omnibus: true
> 
> customize:
> 
> ```
> memory: 1024
> 
> ```
> 
> platforms:
> 
> - name: ubuntu-14.04
> 
> - name: ubuntu-12.04
> 
> - name: ubuntu-10.04
> 
> - name: centos-6.5
> 
> - name: centos-5.10
> 
> - name: centos-7.0
> 
> suites:
> 
> - name: default
> 
> Any ideas about what I need to do to make chef-solo copy over cookbook  
> dependencies when using test-kitchen?
> 
> --
> 
> ~_~ StormeRider ~_~
> 
> "Every world needs its heroes [...] They inspire us to be better than we  
> are. And they protect from the darkness that's just around the corner."
> 
> (from Smallville Season 6x1: "Zod")
> 
> On why I hate the phrase "that's so lame"... [http://bit.ly/Ps3uSS](http://bit.ly/Ps3uSS)
> 
> * * *
> 
> * * *
> 
> \*\*\*\*\*\*\*\* CONFIDENTIALITY NOTICE \*\*\*\*\*\*\*\*
> 
> - This e-mail message and all attachments transmitted with it may contain  
> legally privileged and confidential information intended solely for the use  
> of the addressee. If the reader of this message is not the intended  
> recipient, you are hereby notified that any reading, dissemination,  
> distribution, copying, or other use of this message or its attachments is  
> strictly prohibited. If you have received this message in error, please  
> notify the sender immediately and delete this message from your system.  
> Thank you. \*
