NoteAs of test-kitchen 1.21.0, we now prefer
.kitchen.yml. This preference applies to
kitchen.local.ymlas well. This is backward compatible so the dot versions continue to work.
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 the latest Chef version. 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/integration/default attributes:
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.