kitchen.yml
Note
As of test-kitchen 1.21.0, we now preferkitchen.yml
over .kitchen.yml
. This preference applies to kitchen.local.yml
as 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 Chef Workstation 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 20.04 with the latest Chef Infra Client release. 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_infra
verifier:
name: inspec
platforms:
- name: ubuntu-20.04
suites:
- name: 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-2004 Vagrant ChefInfra Inspec Ssh <Not Created> <None>
Let’s talk about what an instance is and how kitchen interacts with these.