Home » 2017 » February » 10 » test kitchen
2:56 PM
test kitchen





Getting Started Writing Chef Cookbooks the Berkshelf Way, Part 3 - Mischa Taylor's Coding Blog

Update January 7, 2014 * Note about Michel Goetz’s blog series on ChefSpec

Updated December 29, 2013

  • Bumped Test Kitchen from 1.0.0.beta.3 to 1.1.1
  • Bumped CentOS to version 6.5
  • Per Kelly Setzer, updated os check with recent RSpec updates

Updated September 10, 2013

  • Bumped VirtualBox images from version 4.2.16 to 4.2.18
  • Bumped Vagrant from version 1.2.7 to 1.3.1

Updated September 1, 2013

  • Bumped Test Kitchen from 1.0.0.beta.2 to 1.0.0.beta.3

This is the third article in a series on writing Opscode Chef cookbooks the Berkshelf Way. Here’s a link to Part 1 and Part 2. The source code examples covered in this article can be found on Github: https://github.com/misheska/myface

In this installment, we’re going to learn how to use Test Kitchen to automate all the verification steps we did by hand for each iteration in Part 1 and Part 2. If not anything else, it’s worth learning Test Kitchen because OpsCode, the company that makes Chef, has encouraged the use of Test Kitchen to verify community cookbooks.

Test Kitchen is built on top of vagrant and supplements the Vagrantfile file you have been using so far in this series to do local automated testing. The main benefit to Test Kitchen is that it makes it easy to run tests on multiple platforms in parallel, which is more difficult to do with just a Vagrantfile. We’ll be showcasing this aspect of Test Kitchen by ensuring that Myface works on both the CentOS 6.4 and Ubuntu 12.04 Linux distributions.

Edit myface/Gemfile and add the following lines to load the Test Kitchen gems:

Depending on when you went through this article series, your Gemfile may already have these additions. After editing, your myface/Gemfile should look like the following after editing:




Views: 282 | Added by: iviangame | Tags: test, kitchen | Rating: 0.0/0
Total comments: 0
avatar