[chef] Re: Use of chef-zero in unit testing


Chronological Thread 
  • From: Eric Herot < >
  • To: , Joe Nuspl < >
  • Subject: [chef] Re: Use of chef-zero in unit testing
  • Date: Fri, 14 Mar 2014 12:42:57 -0400

Hi Joe,

Have you tried using test kitchen with the chef-zero provider?  That pretty much handles this whole test harness automagically, including the port numbers on multiple instances, spin-up/down, etc.
-- 
Eric

On March 14, 2014 at 12:17:40 PM, Joe Nuspl ( "> ) wrote:

I am writing rspec tests for tools that interact with the chef, i.e. pushing of new cookbooks to the chef-server, creating Chef::Node objects from asset-tracking system.

I was thinking of firing up a chef-zero instance to used as the backend for these tests. A couple issues I see:

1) chef-zero requires a port to be specified. Since there may be multiple tests running simultaneously, need to use different ports. I suppose I could iterate over a range of ports and use that one if it succeeds.

2) Teardown. I suppose an after(:all) clause to do a zero.stop would do the trick.

Before I start, has anyone else gone down this path?

Thanks.

Joe



Archive powered by MHonArc 2.6.16.

§