# Kitchen Testing

**URL:** <https://discourse.chef.io/t/kitchen-testing/5158>\
**Category:** Chef Infra (archive)\
**Created:** [March 25, 2014, 12:05am UTC](https://discourse.chef.io/t/kitchen-testing/5158 "2014-03-25T00:05:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Douglas\_Garstang](https://avatars.discourse-cdn.com/v4/letter/d/c2a13f/32.png) [@Douglas\_Garstang](https://discourse.chef.io/u/Douglas_Garstang)\
**Post date:** [March 25, 2014, 12:05am UTC](https://discourse.chef.io/t/kitchen-testing/5158/1 "2014-03-25T00:05:00Z")

</div>

I’m trying to correctly use test kitchen (sorry if there’s a separate  
mailing list for that - couldn’t find one).

Up until now, in order to unit test (or at least quickly and repeatedly  
confirm) a cookbook works, the Vagrantfile had just contained the recipe  
for the cookbook. We have a base role, but our cookbooks typically don’t  
need the base role to function and are therefore are not a dependancy.

This also means the base role is not in the Berksfile. However, it seems  
that kitchen reads the Berksfile. When I run a ‘kitchen test’, kitchen  
fails because it can’t find the base role that I have put into the  
kitchen.yml file.

I’m not sure what to do here. It makes no sense to me to put the base role  
into the Berksfile, because it is not a dependancy. However, kitchen seems  
to need it. Adding the base role to the Berksfile would greatly increase  
the time required to quickly test a cookbook works.

If I did add it, this would mean that a ‘kitchen test’ would be basically  
the same as a ‘vagrant up’ since both include the cookbook AND the base  
role. I’m left wondering what the point of kitchen is at that point?

Thanks,  
Douglas

---

<div class="post-metadata">

**Author:** ![Eric\_G\_Wolfe](https://avatars.discourse-cdn.com/v4/letter/e/13edae/32.png) [@Eric\_G\_Wolfe](https://discourse.chef.io/u/Eric_G_Wolfe)\
**Post date:** [March 25, 2014, 5:11am UTC](https://discourse.chef.io/t/kitchen-testing/5158/2 "2014-03-25T05:11:05Z")

</div>

If you've put the base cookbook into the kitchen file, then you've made  
it a requirement for kitchen.

## Eric G. Wolfe Senior Linux Administrator, IT Infrastructure Systems

Marshall University Computing Services  
Drinko Library 428-K  
One John Marshall Dr.  
Huntington, WV 25755  
Phone: 304.942.3970  
Email: eric.wolfe@marshall.edu

The difference between a Miracle and a Fact is exactly the difference  
between a mermaid and a seal.  
-- Mark Twain

On 03/24/2014 08:05 PM, Douglas Garstang wrote:

> I'm trying to correctly use test kitchen (sorry if there's a separate  
> mailing list for that - couldn't find one).
> 
> Up until now, in order to unit test (or at least quickly and  
> repeatedly confirm) a cookbook works, the Vagrantfile had just  
> contained the recipe for the cookbook. We have a base role, but our  
> cookbooks typically don't need the base role to function and are  
> therefore are not a dependancy.
> 
> This also means the base role is not in the Berksfile. However, it  
> seems that kitchen reads the Berksfile. When I run a 'kitchen test',  
> kitchen fails because it can't find the base role that I have put into  
> the kitchen.yml file.
> 
> I'm not sure what to do here. It makes no sense to me to put the base  
> role into the Berksfile, because it is not a dependancy. However,  
> kitchen seems to need it. Adding the base role to the Berksfile would  
> greatly increase the time required to quickly test a cookbook works.
> 
> If I did add it, this would mean that a 'kitchen test' would be  
> basically the same as a 'vagrant up' since both include the cookbook  
> AND the base role. I'm left wondering what the point of kitchen is at  
> that point?
> 
> Thanks,  
> Douglas

---

<div class="post-metadata">

**Author:** ![Douglas\_Garstang](https://avatars.discourse-cdn.com/v4/letter/d/c2a13f/32.png) [@Douglas\_Garstang](https://discourse.chef.io/u/Douglas_Garstang)\
**Post date:** [March 25, 2014, 5:12am UTC](https://discourse.chef.io/t/kitchen-testing/5158/3 "2014-03-25T05:12:18Z")

</div>

Eric,

Yes, but doing so also means it's a requirement for this particular  
cookbook, which it is not.

Douglas.

On Mon, Mar 24, 2014 at 10:11 PM, Eric G. Wolfe [eric.wolfe@marshall.edu](mailto:eric.wolfe@marshall.edu)wrote:

> If you've put the base cookbook into the kitchen file, then you've made  
> it a requirement for kitchen.
> 
> ## Eric G. Wolfe Senior Linux Administrator, IT Infrastructure Systems
> 
> Marshall University Computing Services  
> Drinko Library 428-K  
> One John Marshall Dr.  
> Huntington, WV 25755  
> Phone: 304.942.3970  
> Email: eric.wolfe@marshall.edu
> 
> The difference between a Miracle and a Fact is exactly the difference  
> between a mermaid and a seal.  
> -- Mark Twain
> 
> On 03/24/2014 08:05 PM, Douglas Garstang wrote:
> 
> I'm trying to correctly use test kitchen (sorry if there's a separate  
> mailing list for that - couldn't find one).
> 
> Up until now, in order to unit test (or at least quickly and repeatedly  
> confirm) a cookbook works, the Vagrantfile had just contained the recipe  
> for the cookbook. We have a base role, but our cookbooks typically don't  
> need the base role to function and are therefore are not a dependancy.
> 
> This also means the base role is not in the Berksfile. However, it seems  
> that kitchen reads the Berksfile. When I run a 'kitchen test', kitchen  
> fails because it can't find the base role that I have put into the  
> kitchen.yml file.
> 
> I'm not sure what to do here. It makes no sense to me to put the base  
> role into the Berksfile, because it is not a dependancy. However, kitchen  
> seems to need it. Adding the base role to the Berksfile would greatly  
> increase the time required to quickly test a cookbook works.
> 
> If I did add it, this would mean that a 'kitchen test' would be  
> basically the same as a 'vagrant up' since both include the cookbook AND  
> the base role. I'm left wondering what the point of kitchen is at that  
> point?
> 
> Thanks,  
> Douglas

--  
Regards,

Douglas Garstang  
[http://www.linkedin.com/in/garstang](http://www.linkedin.com/in/garstang)  
Email: [doug.garstang@gmail.com](mailto:doug.garstang@gmail.com)  
Cell: +1-805-340-5627

---

<div class="post-metadata">

**Author:** ![Douglas\_Garstang](https://avatars.discourse-cdn.com/v4/letter/d/c2a13f/32.png) [@Douglas\_Garstang](https://discourse.chef.io/u/Douglas_Garstang)\
**Post date:** [March 25, 2014, 5:31am UTC](https://discourse.chef.io/t/kitchen-testing/5158/4 "2014-03-25T05:31:15Z")

</div>

I've become aware of the Berkshelf group option. Eg: from the Berkshelf  
documentation:

group :solo do  
cookbook 'riot\_base'  
end

When running 'berks install', you can use the --without option to exclude a  
group. In my situation, that would then be:

group :test do  
cookbook 'bc-role-base'  
end

However, I need to exclude this cookbook when running a 'vagrant up', and I  
don't see how to pass this information to vagrant so that it can be passed  
to berkshelf.

Doug.

On Mon, Mar 24, 2014 at 10:12 PM, Douglas Garstang  
[doug.garstang@gmail.com](mailto:doug.garstang@gmail.com)wrote:

> Eric,
> 
> Yes, but doing so also means it's a requirement for this particular  
> cookbook, which it is not.
> 
> Douglas.
> 
> On Mon, Mar 24, 2014 at 10:11 PM, Eric G. Wolfe [eric.wolfe@marshall.edu](mailto:eric.wolfe@marshall.edu)wrote:
> 
> > If you've put the base cookbook into the kitchen file, then you've made  
> > it a requirement for kitchen.
> > 
> > ## Eric G. Wolfe Senior Linux Administrator, IT Infrastructure Systems
> > 
> > Marshall University Computing Services  
> > Drinko Library 428-K  
> > One John Marshall Dr.  
> > Huntington, WV 25755  
> > Phone: 304.942.3970  
> > Email: eric.wolfe@marshall.edu
> > 
> > The difference between a Miracle and a Fact is exactly the difference  
> > between a mermaid and a seal.  
> > -- Mark Twain
> > 
> > On 03/24/2014 08:05 PM, Douglas Garstang wrote:
> > 
> > I'm trying to correctly use test kitchen (sorry if there's a separate  
> > mailing list for that - couldn't find one).
> > 
> > Up until now, in order to unit test (or at least quickly and repeatedly  
> > confirm) a cookbook works, the Vagrantfile had just contained the recipe  
> > for the cookbook. We have a base role, but our cookbooks typically don't  
> > need the base role to function and are therefore are not a dependancy.
> > 
> > This also means the base role is not in the Berksfile. However, it  
> > seems that kitchen reads the Berksfile. When I run a 'kitchen test',  
> > kitchen fails because it can't find the base role that I have put into the  
> > kitchen.yml file.
> > 
> > I'm not sure what to do here. It makes no sense to me to put the base  
> > role into the Berksfile, because it is not a dependancy. However, kitchen  
> > seems to need it. Adding the base role to the Berksfile would greatly  
> > increase the time required to quickly test a cookbook works.
> > 
> > If I did add it, this would mean that a 'kitchen test' would be  
> > basically the same as a 'vagrant up' since both include the cookbook AND  
> > the base role. I'm left wondering what the point of kitchen is at that  
> > point?
> > 
> > Thanks,  
> > Douglas
> 
> --  
> Regards,
> 
> Douglas Garstang  
> [http://www.linkedin.com/in/garstang](http://www.linkedin.com/in/garstang)  
> Email: [doug.garstang@gmail.com](mailto:doug.garstang@gmail.com)  
> Cell: +1-805-340-5627

--  
Regards,

Douglas Garstang  
[http://www.linkedin.com/in/garstang](http://www.linkedin.com/in/garstang)  
Email: [doug.garstang@gmail.com](mailto:doug.garstang@gmail.com)  
Cell: +1-805-340-5627

---

<div class="post-metadata">

**Author:** ![Seth\_Vargo2](https://avatars.discourse-cdn.com/v4/letter/s/ccd318/32.png) [@Seth\_Vargo2](https://discourse.chef.io/u/Seth_Vargo2)\
**Post date:** [March 27, 2014, 10:35pm UTC](https://discourse.chef.io/t/kitchen-testing/5158/5 "2014-03-27T22:35:57Z")

</div>

You want to use `group :integration`. Test Kitchen will automatically pick that up.

Thanks,  
Seth

On Mar 25, 2014, at 1:31 AM, Douglas Garstang [doug.garstang@gmail.com](mailto:doug.garstang@gmail.com) wrote:

> I've become aware of the Berkshelf group option. Eg: from the Berkshelf documentation:
> 
> group :solo do  
> cookbook 'riot\_base'  
> end
> 
> When running 'berks install', you can use the --without option to exclude a group. In my situation, that would then be:
> 
> group :test do  
> cookbook 'bc-role-base'  
> end
> 
> However, I need to exclude this cookbook when running a 'vagrant up', and I don't see how to pass this information to vagrant so that it can be passed to berkshelf.
> 
> Doug.
> 
> On Mon, Mar 24, 2014 at 10:12 PM, Douglas Garstang [doug.garstang@gmail.com](mailto:doug.garstang@gmail.com) wrote:  
> Eric,
> 
> Yes, but doing so also means it's a requirement for this particular cookbook, which it is not.
> 
> Douglas.
> 
> ## On Mon, Mar 24, 2014 at 10:11 PM, Eric G. Wolfe [eric.wolfe@marshall.edu](mailto:eric.wolfe@marshall.edu) wrote: If you've put the base cookbook into the kitchen file, then you've made it a requirement for kitchen. Eric G. Wolfe Senior Linux Administrator, IT Infrastructure Systems
> 
> Marshall University Computing Services  
> Drinko Library 428-K  
> One John Marshall Dr.  
> Huntington, WV 25755  
> Phone: 304.942.3970  
> Email: eric.wolfe@marshall.edu
> 
> The difference between a Miracle and a Fact is exactly the difference  
> between a mermaid and a seal.  
> -- Mark Twain  
> On 03/24/2014 08:05 PM, Douglas Garstang wrote:
> 
> > I'm trying to correctly use test kitchen (sorry if there's a separate mailing list for that - couldn't find one).
> > 
> > Up until now, in order to unit test (or at least quickly and repeatedly confirm) a cookbook works, the Vagrantfile had just contained the recipe for the cookbook. We have a base role, but our cookbooks typically don't need the base role to function and are therefore are not a dependancy.
> > 
> > This also means the base role is not in the Berksfile. However, it seems that kitchen reads the Berksfile. When I run a 'kitchen test', kitchen fails because it can't find the base role that I have put into the kitchen.yml file.
> > 
> > I'm not sure what to do here. It makes no sense to me to put the base role into the Berksfile, because it is not a dependancy. However, kitchen seems to need it. Adding the base role to the Berksfile would greatly increase the time required to quickly test a cookbook works.
> > 
> > If I did add it, this would mean that a 'kitchen test' would be basically the same as a 'vagrant up' since both include the cookbook AND the base role. I'm left wondering what the point of kitchen is at that point?
> > 
> > Thanks,  
> > Douglas
> 
> --  
> Regards,
> 
> Douglas Garstang  
> [http://www.linkedin.com/in/garstang](http://www.linkedin.com/in/garstang)  
> Email: [doug.garstang@gmail.com](mailto:doug.garstang@gmail.com)  
> Cell: +1-805-340-5627
> 
> --  
> Regards,
> 
> Douglas Garstang  
> [http://www.linkedin.com/in/garstang](http://www.linkedin.com/in/garstang)  
> Email: [doug.garstang@gmail.com](mailto:doug.garstang@gmail.com)  
> Cell: +1-805-340-5627

---

<div class="post-metadata">

**Author:** ![Eric\_G\_Wolfe](https://avatars.discourse-cdn.com/v4/letter/e/13edae/32.png) [@Eric\_G\_Wolfe](https://discourse.chef.io/u/Eric_G_Wolfe)\
**Post date:** [March 28, 2014, 5:16am UTC](https://discourse.chef.io/t/kitchen-testing/5158/6 "2014-03-28T05:16:00Z")

</div>

I actually had this conversation on IRC the other day with Doug. But I couldn’t sufficiently explain where the group integration pattern originated for lack of documentation.

All I knew was this works with apt in Debian platform scenarios. But I don’t know if its because of Berkshelf, Kitchen, or even a Kitchen plugin. Even code diving with git grep, I could not find the code evaluating the integration group in Kitchen or Berkshelf.

Seth Vargo [sethvargo@getchef.com](mailto:sethvargo@getchef.com) wrote:

You want to use `group :integration`. Test Kitchen will automatically pick that up.

Thanks,  
Seth

On Mar 25, 2014, at 1:31 AM, Douglas Garstang \<[doug.garstang@gmail.com](mailto:doug.garstang@gmail.com)[mailto:doug.garstang@gmail.com](mailto:doug.garstang@gmail.com)\> wrote:

I’ve become aware of the Berkshelf group option. Eg: from the Berkshelf documentation:

group :solo do  
cookbook 'riot\_base’  
end

When running ‘berks install’, you can use the --without option to exclude a group. In my situation, that would then be:

group :test do  
cookbook 'bc-role-base’  
end

However, I need to exclude this cookbook when running a ‘vagrant up’, and I don’t see how to pass this information to vagrant so that it can be passed to berkshelf.

Doug.

On Mon, Mar 24, 2014 at 10:12 PM, Douglas Garstang \<[doug.garstang@gmail.com](mailto:doug.garstang@gmail.com)[mailto:doug.garstang@gmail.com](mailto:doug.garstang@gmail.com)\> wrote:  
Eric,

Yes, but doing so also means it’s a requirement for this particular cookbook, which it is not.

Douglas.

On Mon, Mar 24, 2014 at 10:11 PM, Eric G. Wolfe \<[eric.wolfe@marshall.edu](mailto:eric.wolfe@marshall.edu)[mailto:eric.wolfe@marshall.edu](mailto:eric.wolfe@marshall.edu)\> wrote:  
If you’ve put the base cookbook into the kitchen file, then you’ve made it a requirement for kitchen.

## Eric G. Wolfe Senior Linux Administrator, IT Infrastructure Systems

Marshall University Computing Services  
Drinko Library 428-K  
One John Marshall Dr.  
Huntington, WV 25755  
Phone: 304.942.3970tel:304.942.3970  
Email: [eric.wolfe@marshall.edu](mailto:eric.wolfe@marshall.edu)[mailto:eric.wolfe@marshall.edu](mailto:eric.wolfe@marshall.edu)

The difference between a Miracle and a Fact is exactly the difference  
between a mermaid and a seal.  
– Mark Twain

On 03/24/2014 08:05 PM, Douglas Garstang wrote:  
I’m trying to correctly use test kitchen (sorry if there’s a separate mailing list for that - couldn’t find one).

Up until now, in order to unit test (or at least quickly and repeatedly confirm) a cookbook works, the Vagrantfile had just contained the recipe for the cookbook. We have a base role, but our cookbooks typically don’t need the base role to function and are therefore are not a dependancy.

This also means the base role is not in the Berksfile. However, it seems that kitchen reads the Berksfile. When I run a ‘kitchen test’, kitchen fails because it can’t find the base role that I have put into the kitchen.yml file.

I’m not sure what to do here. It makes no sense to me to put the base role into the Berksfile, because it is not a dependancy. However, kitchen seems to need it. Adding the base role to the Berksfile would greatly increase the time required to quickly test a cookbook works.

If I did add it, this would mean that a ‘kitchen test’ would be basically the same as a ‘vagrant up’ since both include the cookbook AND the base role. I’m left wondering what the point of kitchen is at that point?

Thanks,  
Douglas

–  
Regards,

Douglas Garstang  
[http://www.linkedin.com/in/garstang](http://www.linkedin.com/in/garstang)  
Email: [doug.garstang@gmail.com](mailto:doug.garstang@gmail.com)[mailto:doug.garstang@gmail.com](mailto:doug.garstang@gmail.com)  
Cell: +1-805-340-5627tel:%2B1-805-340-5627

–  
Regards,

Douglas Garstang  
[http://www.linkedin.com/in/garstang](http://www.linkedin.com/in/garstang)  
Email: [doug.garstang@gmail.com](mailto:doug.garstang@gmail.com)[mailto:doug.garstang@gmail.com](mailto:doug.garstang@gmail.com)  
Cell: +1-805-340-5627
