require 'kitchen'
|
I use the erb component of test kitchen in the .kitchen.yml file. It looks something like below. I set up boxes and then iterate. You will also see I append the minitest-handler recipe to make sure each node runs the tests I have in place (using minitest currently)
<%
boxes = [
{ :name => :node1, :run_list => '"recipe[cookbook::recipe_1]", "recipe[yummy::food]"' },
{ :name => :node2, :run_list => '"recipe[cookbook::recipe_2]"' }
]
%>
suites:
<% boxes.each do |opts| %>
- name: <%= opts[:name] %>
provisioner:
solo_rb:
environment: LOCAL
encrypted_data_bag_secret_key_path: "/path/to/secret"
data_bags_path: "../../data_bags"
roles_path: "../../roles"
environments_path: "../../environments"
run_list: [ <%= opts[:run_list] %>, "recipe[minitest-handler]" ]
attributes:
cloud:
provider: "ec2"
<% end %>