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
1
vote
1 answer

How to resolve a mixlib-shellout gem version conflict?

I am trying use to Kitchen/Chef to deploy. I am actually not sure if I've touched Kitchen yet. My understanding is gem list lists all the gems in the repository, and a project fetches any gems it wants from this repository. After I ran gem install…
post2626
  • 239
  • 1
  • 6
  • 16
1
vote
2 answers

Chef vault - error accessing vault item during kitchen converge

Here is the call I am making in my recipe: mypassword = chef_vault_item("passwords", "default_pass") Here is the error I am getting when running a kitchen converge on this recipe: Net::HTTPServerException ------------------------ …
weevil
  • 56
  • 6
1
vote
1 answer

Chef - override node attribute

We have recipe which use node attribute: python_pip 'request_proxy' do virtualenv '/opt/proxy/.env' version node.default['request-proxy']['version'] Chef::Log.info('Auth request proxy #{version}') action :install end Attribute is set on…
parasit
  • 13
  • 6
1
vote
0 answers

Unable to override rspec_opts in test-kitchen/busser-serverspec

It seems that there's way to override rspec_opts. By default it is running with "--color --format documentation", like such: /opt/chef/embedded/bin/ruby -I/tmp/verifier/suites/serverspec…
Nicholas Key
  • 1,429
  • 4
  • 21
  • 24
1
vote
3 answers

getting error for kitchen create in chef

As i am very new to chef i am not able to figure out following error : $ kitchen create -----> Starting Kitchen (v1.4.2) >>>>>> ------Exception------- >>>>>> Class: Kitchen::UserError >>>>>> Message: Error parsing /home/ashishk/motd/.kitchen.yml as…
Ashish Karpe
  • 5,087
  • 7
  • 41
  • 66
1
vote
1 answer

Ansible kitchen test fails executing source command on debian

I wrote a ansible playbook role for python and trying to test it using kitchen test with Serverspec/RSpec. The following test is making sure if I am able source activate the virtualenv. This runs fine on CentOS but test fails on Debian-Ubuntu with…
Krish
  • 467
  • 1
  • 6
  • 16
1
vote
2 answers

Kitchen: add a role to a node

One of our app uses gunicorn and is configured via a chef cookbook. The cookbook has some attributes, one of them is the gunicorn version: grep 'version' attributes/default.rb default['myapp']['gunicorn']['version'] = '19.1.1' I want to use version…
simsaull
  • 319
  • 1
  • 4
  • 12
1
vote
1 answer

TestKichen, Serverspec and out-of-order command execution

Inside TestKitchen describe blocks I'm running a command, loading its output into a variable then running multiple expect statements over that output validating different parts of it. The end goal is using this as part of CI builds to do blackbox…
Will L
  • 76
  • 6
1
vote
2 answers

Kitchen Converge for windows 7 box failing with boot timeout

I'm currently using a test kitchen to try and converge a Windows 7 machine with VMware Fusion as the provisioner to eventually deploy a chef cookbook. Every time I run a kitchen converge the process hangs on "Waiting for machine to boot. This may…
amarkon
  • 341
  • 1
  • 6
  • 17
1
vote
1 answer

Test kitchen fails to install VirtualBox Guest Additions 4.3.28

I'm having trouble creating a synced folder using kitchen. Seems like something is wrong with the latest version of Virtualbox Guest Additions (2.3.8) After running: $ kitchen converge I get this: Downloading VirtualBox Guest Additions ISO from…
alexg
  • 902
  • 11
  • 37
1
vote
2 answers

Set up a test kitchen cookbook recipe to generate chef server inside vagrant

I'm experimenting with chef and test kitchen. The problem I'm facing is as follows. I'm using arch linux and I couldn't get chef installed on my machine, so I decided to use a centos7 box for a working vm to do so. My goal is to have enterprise chef…
alexg
  • 902
  • 11
  • 37
1
vote
0 answers

Running kitchen converge with rvm cookbook doesn't work

Trying to run test-kitchen and use the rvm cookbook. As soon as the node converges with the rvm cookbook I can no longer run kitchen converge as it can no longer find the chef-client…
senile_genius
  • 527
  • 1
  • 7
  • 12
1
vote
0 answers

Test Kitchen with vsphere

I am getting following error when i try to run kitchen test : Starting Kitchen (v1.3.1) Cleaning up any prior instances of Finished destroying (0m0.00s). Testing Creating…
sencha7
  • 51
  • 1
  • 4
1
vote
2 answers

How to setup test preconditions before a ServerSpec test?

I am writing a simple cookbook that will be used to deploy an SSL proxy onto a server. This cookbook will ultimately be used by other cookbooks that deploy web services in order to set up an SSL proxy in front of them, but for the purpose of…
Kenneth Baltrinic
  • 2,941
  • 2
  • 28
  • 45
1
vote
2 answers

kitchen not detecting vagrant plugin `kitchen-vagrant`

Ubuntu 14.10 fresh install chef@ubuntu:~/db2$ uname -a Linux ubuntu 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux chef@ubuntu:~/db2$ vagrant -v Vagrant 1.4.3 chef@ubuntu:~/db2$ vagrant plugin…
Jacques Betancourt
  • 2,652
  • 3
  • 18
  • 19