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
2 answers

How to test final Chef server configuration with the help of community cookbooks?

I saw most of the community cookbooks have tests. As I read some articles those tests can be, simply put, described as unit tests (does the cookbook does what it says?) and integration tests (does it work on the OS?). I setup a LAMP virtual…
tsusanka
  • 4,801
  • 7
  • 36
  • 42
0
votes
2 answers

Distributing Cookbooks to Team Members

Using test-kitchen and Berkshelf, I'd like to capture & distribute my current cookbooks. After telling teammates to install berkshelf, these options seem possible: retrieve cookbooks via the opscode repo per Berksfile cookbook run berks package to…
Kevin Meredith
  • 41,036
  • 63
  • 209
  • 384
0
votes
1 answer

Continuous delivery of infrastructure projects

I'm using Jenkins to achieve Continuous Delivery on some infrastructure projects. ATM Master-Slave Jenkins model is used where the jobs are always built by some some slave and not by the master, my intentions are to build and run test-kitchen and…
Carlos Castellanos
  • 2,358
  • 4
  • 25
  • 43
0
votes
1 answer

How can use net/ssh gem to know if a package was installed?

I am trying to use the net/ssh gem to find an installed package into my Test-Kitchen instance. I do a simple recipe that reuse the build-essential cookbook. It is my recipe: node['my-cookbook']['packages'].each do |pkg| package pkg end And these…
Robert
  • 10,403
  • 14
  • 67
  • 117
-1
votes
1 answer

Chef kitchen tests, how to pass multiple Chef cookbooks AWS Opsworks like?

I try to test Chef cookbooks on Centos 7 OS locally. I follow https://learn.chef.io/modules/local-development/rhel/virtualbox/apply-a-cookbook#/ --- driver: # specifies the software that manages the machine. We're using the Vagrant Test Kitchen…
Gilles Quénot
  • 173,512
  • 41
  • 224
  • 223
-1
votes
1 answer

How can we implement this without bash operator

How can we change this bash operator with any resource Just i am moving particular directories in to particular directories bash " deploy" do cwd "#{stage}" code <<-EOH cp -pr "#{stage}/#{name}-#{package_version}.tar" "#{stage_operator}/" …
Udhay
  • 7
  • 7
-1
votes
1 answer

Kitchen test not running

I was trying to run kitchen list and it was showing gem conflict between mixlib-shellout v2.1.0 and v2.2.6. Until yesterday everything was running fine and i have no idea from where this conflict arises. This is the error i was getting I,…
shivams
  • 2,597
  • 6
  • 25
  • 47
-1
votes
1 answer

Errors on kitchen converge step

I'm trying to setup listenbrainz server https://github.com/metabrainz/listenbrainz-server/ but i have little/no knoledge about chef/ Vagrant setup. I noticed 2 error in log file https://gist.github.com/samithaj/dfb99dac67ca9b52ce9d ERROR: Failed to…
sam
  • 1
  • 1
-1
votes
1 answer

Test kitchen with kitchen-docker doesn't work

I'm trying to kick off testing using kitchen-docker. kitchen-docker gem was installed through bundler already. .kitchen.yml looks like this --- driver: name: docker network: - ["private_network", { ip: "192.168.33.10" }] provisioner: name:…
Toshi
  • 6,012
  • 8
  • 35
  • 58
-1
votes
2 answers

kitchen openstack steps/example

I am trying to make it work the tool test kitchen with kitchen-openstack to perform some integration/functional test of some Chef recipes we have. But I cannot get it work :( I have a .kitchen.yml with following content: driver: name: openstack …
user2620348
  • 309
  • 4
  • 15
-1
votes
1 answer

How can I configure a timeout attribute to kitchen instance

My kitchen instance is configured with 256 memory ram, but it is running very slow. Then my questions are: How can I configure it to improve the memory ram size? Is there any tutorial or post where I can find a solution?
Robert
  • 10,403
  • 14
  • 67
  • 117
-2
votes
2 answers

Chef kitchen ruby gems error fails to converge on windows

chef verify shows error that gems dependencies on this path error C:/opscode/chefdk/embedded/lib/ruby/site_ruby/2.3.0/rubygems/dependency.rb:310:in `to_specs': Could not find 'test-kitchen' (= 1.15.0) - did find: [test-kitchen-1.17.0]…
one
  • 11
  • 1
-2
votes
1 answer

Node search is not working in test kitchen

I am not geeting output and error ------Exception------- Class: Kitchen::ActionFailed Message: 1 actions failed." cookbook/test/integration/nodes Json file { "id": "hive server", "chef_type": "node", "environment": "dev", …
Udhay
  • 7
  • 7
1 2 3
23
24