Questions tagged [test-kitchen]

Test Kitchen is an integration tool for developing and testing infrastructure code and software on isolated target platforms.

What is Test Kitchen?

Test Kitchen is a test harness tool to execute your configured code on one or more platforms in isolation. A driver plugin architecture is used which lets you run your code on various cloud providers and virtualization technologies such as Amazon EC2, Blue Box, CloudStack, Digital Ocean, Rackspace, OpenStack, Vagrant, Docker, LXC containers, and more. Many testing frameworks are already supported out of the box including Bats, shUnit2, RSpec, Serverspec, with others being created weekly.

For Chef workflows, cookbook dependency resolver tools such as Berkshelf and Librarian-Chef are supported or you can simply have a cookbooks/ directory and Test Kitchen will know what to do. Support for Test Kitchen is already included in many Chef community cookbooks such as the MySQL, nginx, Chef Server, and runit cookbooks.

What does it give me?

Test Kitchen has a simple workflow that stresses speed but optimizes for the freshness of your code executing on the remote systems between tests. It has a static, declarative configuration in a .kitchen.yml file at the root of your project. It is designed to execute isolated code run in pristine environments ensuring that no prior state exists. A plugin architecture gives you the freedom to run your code on any cloud, virtualization, or bare metal resources and allows you to write acceptance criteria in whatever framework you desire.

How do I get started?

Adding testing support to your Chef cookbook or project is easy. Assuming you have Ruby 1.9 or higher and Vagrant installed, open a terminal session and type:

$ gem install test-kitchen
$ kitchen init
$ kitchen test

For more comprehensive instructions, check out the Getting Started guide.

358 questions
0
votes
1 answer

Chef: Kitchen Converge cannot find local cookbook dependency

I have 2 local cookbooks. One is called golang_app and the other is called test_go_web_app. test_go_web_app depends on golang_app and runs golang_app::default by doing include_recipe 'golang_app::default' in its default.rb.... I am trying to add…
denniss
  • 17,229
  • 26
  • 92
  • 141
0
votes
1 answer

kitchen - client.pem is not created on vagrant node

I'm trying to run kitchen converge kitchen login to diagnose problem with serverspec tests. When I login to the node I see that there's no client.pem key in /etc/chef, which leads to errors if I try to run chef-client: Your…
skwisgaar
  • 880
  • 2
  • 13
  • 31
0
votes
1 answer

Using Travis for CI of Chef cookbook with E2 instance just hangs on Waiting for SSH service after creating instance

Fixed a problem like this a while ago but somehow stumbled into again - messing with my head. Using just a simple wrapper-cookbook for Sudo to demonstrate Travis CI job using EC2 for instance provisioning, configuration, and testing. While both the…
Nic
  • 1
  • 2
0
votes
1 answer

Installing busser-serverspec plugin in test-kitchen errors out on windows

kitchen verify command will throw the following on windows platform. I don't know which gem to start debugging to fix this issue. Installed gems on my windows host: kitchen-pester (0.4.0) kitchen-salt (0.0.22) kitchen-vagrant (0.19.0) test-kitchen…
Pat O'Shea
  • 50
  • 1
  • 8
0
votes
1 answer

Create user for Kitchen use

I have a set of Chef scripts that make use of the 'ubuntu' user on our servers I have now started trying to get Kitchen working on doing testing but it sets up with the 'vagrant' user so when running my scripts I get a UserIDNotFound error Is there…
Olly W
  • 347
  • 3
  • 10
0
votes
1 answer

Why Does a micro instance if RH7.2 return "Non-Windows instances with a virtualization type of 'hvm' are currently not supported ...."?

My kitchen.yml looks like. driver: name: ec2 require_chef_omnibus: true instance_type: t2.micro block_device_mappings: - ebs_device_name: /dev/sda1 ebs_volume_type: standard ebs_virtual_name: test ebs_volume_size: 50 …
Josh Beauregard
  • 2,498
  • 2
  • 20
  • 37
0
votes
1 answer

Chef template resource not_if solo

I have following chef recipe and I don't want to run template resource when it gets converged under chef solo. It does not seem to obey the not_if while running kitchen converge. It still tries to connect the chef server. Please…
user2114835
0
votes
1 answer

Why are the node attributes in the Test Kitchen generated dna.json not being included in my chef-shell execution?

Using the following commands I am able to get chef-shell to execute, pulling in all of my cookbooks and data bags: kitchen login cd /tmp/kitchen sudo -E /opt/chef/embedded/bin/chef-zero -d sudo knife cookbook upload -a -c client.rb sudo knife upload…
0
votes
1 answer

Chef recipe not executing on first convergence

I've basic chef cookbook and one of the recipes does not converge in the first run. Chef Cookbook: https://github.com/linaksa/linaksa_infra When I run kitchen test the recipe linaksa_infra::hosts does not get converge at all. Also when I run kitchen…
user2114835
0
votes
1 answer

Unable to find rbenv cookbook with default Chef kitchen setup, chef_zero, Berkshelf

I'm trying to create a Chef cookbook for provisioning a machine with rbenv, Postgres, and the JDK, but I'm running into problems with dependencies. I created a Chef repo using (if I remember correctly) chef generate app chef-project, and started…
r.pazyaquian
  • 73
  • 1
  • 6
0
votes
1 answer

Missing roles in run list, Chef kitchen chef_solo

When running kitchen converge I get the follow error: ================================================================================ Error expanding the run_list: ================================================================================ …
Johnny5
  • 463
  • 2
  • 5
  • 16
0
votes
1 answer

Running Chef Test-Kitchen behind Proxy on Windows 7

I am trying to run Test-Kitchen on a Windows 7 box, using Powershell, behind a corporate firewall (I'm following the tutorial at http://kitchen.ci/docs/getting-started/creating-cookbook). When I run: PS C:\Users\jazzyb\Documents\git-cookbook>…
0
votes
1 answer

Could not load the 'chef-solo' provisioner from the load path

I have freshly installed ChefDK on my workstation, downloaded the starter kit and modified .kitchen.yml to follows: --- driver: name: opennebula opennebula_endpoint: http://10.1.1.1/zonea oneauth_file: /home/local/.one/one_auth …
Luxing
  • 323
  • 1
  • 2
  • 7
0
votes
0 answers

chef and test-kitchen synchronizing cookbooks from s3

i am using kitchen-ec2 with chef-zero provisioner: $ cat Gemfile | grep kitchen gem "test-kitchen", "1.4.2" gem "kitchen-ec2", "0.10.0" $ cat .kitchen.yml | grep require_chef_omnibus require_chef_omnibus: true where the current chef_omnibus…
Mr.
  • 9,429
  • 13
  • 58
  • 82
0
votes
0 answers

Test Kitchen adding env variable to windows vagrant box

I am trying to implement a local testing environment for our windows chef cookbooks using vagrant/test kitchen. Inside of our cookbooks we have some recipes that need authentication information for AWS. Each dev has their personal aws authentication…