Speed up test kitchen

I have been working one some cookbooks using test kitchen. Especially during my early phases of developing a cookbook I had to converge quiet often.

Some of my cookbooks required the installation of software packages which were downloaded from their respective internet repositories. Which depending on internet connection speed and availability, considerably increased t he time each converge took.

So I tried to figure out a way to speed up the converging.

The first thing I did is switch from yum to plain rpm installation were it was possible. Obviously that approach has the drawback of having to manager dependencies myself. But for the time being I was willing to expect that.

The second thing I did, that really got things up to speed, was hosting the rpms on my development machine. This involved the following steps:

  1. Create a subdirectory rpms in my cookbook into which I downloaded the rpms to install:

     
  2. Set up a private network in my kitchen yaml file so that the guest was able to access the host. This stackoverflow post describes how to do it and which Ips to use:

     
  3. Start a simple python http server in the rpm directory:

     
  4. Change the urls for downloading the rpms to point at the host’s http server and add the host’s ip to the no proxy list:

    After doing so converge runs really went pretty fast. But this approach has its limitation and drawbacks. When installing yum packages this solution obviously does not work. And setting up a local yum repository is fare more work than starting a simple http server.

    Nevertheless do I think that using this approach during development could make life a little bit easier.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">