.kitchen.yml

Let's turn our attention to the .kitchen.yml file for a minute. While ChefDK may have created the initial file automatically, it's expected that you will read and edit this file. After all, you know what you want to test… right?

For the moment let's say we only care about running our Chef cookbook on Ubuntu 16.04 with Chef version 13. In that case, we can edit the .kitchen.yml file so that we pin the version of Chef and trim the list of platforms to only one entry like so:

---
driver:
  name: vagrant

provisioner:
  name: chef_zero

verifier:
  name: inspec

platforms:
  - name: ubuntu-16.04

suites:
  - name: default
    run_list:
      - recipe[git_cookbook::default]
    verifier:
      inspec_tests:
        - test/smoke/default
    attributes:

Very briefly we can cover the common sections you're likely to find in a .kitchen.yml file:

---
transport:
  name: winrm
  elevated: true

To see the results of our work, let's run the kitchen list subcommand:

$ kitchen list
Instance             Driver   Provisioner  Verifier  Transport  Last Action    Last Error
default-ubuntu-1604  Vagrant  ChefZero     Inspec    Ssh        <Not Created>  <None>

Let's talk about what an instance is and how kitchen interacts with these.