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

Specific version of cookbook chef kitchen

I am trying to get a chef cookbook to run. I need version 1.7.2 of the cookbook to run with current at 1.7.3. I am currently trying to do, recipe[nginx::default@1.7.2] but it wont't work. This is in a runlist in my .kitchen.yml file. I found an…
user9753902
0
votes
1 answer

Chef Kitchen: Error pullling a kitchen box for sles 12

I am trying to converge a kitchen sles box. But I keep getting the following error. I was able to converge a centos-7 so I dont think anything is wrong in my configuration. ---- Begin output of vagrant up --no-provision --provider virtualbox…
codec
  • 7,978
  • 26
  • 71
  • 127
0
votes
0 answers

kitchen puppet docker cannot converge

I have an issue when using kitchen ci to test puppet manifests into a docker container. Here is my .kitchen.yml driver: name: docker privileged: true use_sudo: true binary: docker provisioner: name: puppet_apply platforms: - name:…
a-dawg
  • 783
  • 1
  • 5
  • 13
0
votes
1 answer

Running a command as a specific user in Test Kitchen

I know that you can run the 'execute' module in Chef recipes and that it contains a cwd and user parameter that will allow you to run a command as that user in the current working directory. Which is what I have done in my code: execute…
ryekayo
  • 2,341
  • 3
  • 23
  • 51
0
votes
1 answer

Test Kitchen failing when cloning a private repo

I am trying to clone from a private Bitbucket repo in test kitchen. I have went as far as configuring a key pair for Bitbucket use and when I run kitchen login can manually run the command as root: git clone But when running a…
ryekayo
  • 2,341
  • 3
  • 23
  • 51
0
votes
1 answer

how to stop kitchen from using *.*~ files? chefignore?

I use emacs to do my development. Emacs will make backups of edited files with a tilde ~. When I run kitchen converge I'm getting the following error Recipe Compile Error in /tmp/kitchen/cache/cookbooks/lcd_haproxy/attributes/default.rb~ Notice…
KingAndrew
  • 1,164
  • 4
  • 21
  • 41
0
votes
1 answer

Gitlab Pipeline reports "Failed to complete #create action: [execution expired]" on default-windows-2016

Gitlab Pipeline is failing with below errors after instance volume are ready for AWS public EC2 windows 2012/2016 AMI. If we execute this within kitchen.local.yml with same subnet, sg-group and Public AMI everything works fine until kitchen…
asur
  • 1,759
  • 7
  • 38
  • 81
0
votes
1 answer

Error executing action `install` on resource | Kitchen | Vagrant 2.1 | Virtual Box 5.2

i am trying to converge my kitchen instances created on CentOS 7 and only one line in recipe to install nginx package. # Cookbook:: vmaas # Recipe:: default # # Copyright:: 2018, The Authors, All Rights Reserved. package "nginx" However the…
Sunil
  • 553
  • 1
  • 12
  • 30
0
votes
1 answer

Chef kitchen stopped working all of the sudden with "Could not find 'net-scp'" (Ubuntu 17.10)

I was working on a project, and suddenly, any invocation to anything Ruby seems stopped working. All of them report missing dependencies. I was uninstalling unrelated C/C++ -dev libraries before that, could be the cause because I didn't do anything…
Ondra Žižka
  • 43,948
  • 41
  • 217
  • 277
0
votes
1 answer

Unable to parse authorization header. Headers: McAfee Web Gateway

I am trying to spin up AWS EC2 Windows 2016/2012R2 server using Kitchen create with defined yaml configuration, but while in the process it is waiting to connect to that remote EC2 machine using wsman (http://:5985/wsman) and failed after…
asur
  • 1,759
  • 7
  • 38
  • 81
0
votes
1 answer

How to replace a bundled test-kitchen driver with a local version

I'm trying to test a change to the kitchen-hyperv driver locally, but can't figure out how I replace the driver bundled in test-kitchen with my local bits. I've tried to install my local built kitchen-hyperv gem, but test-kitchen still uses its…
0
votes
1 answer

Berk depedency with kitchen ci

I cannot figure out to make my cookbook run correctly with kitchen ci. This is what I wrote and execute: kitchen.yml driver: name: docker binary: docker use_sudo: false provisioner: name: chef_zero always_update_cookbooks: true …
0
votes
2 answers

Chef/ruby: import all templates from template subdirectory into single directory on a node

Using a simple template block, is there a way to copy all template files in a templates/default/SubDir/ (templates/default/SubDir/*) to a single location (/tmp/)? Here is an example block: template '/tmp/...' do source 'default/SubDir/...' …
aphexlog
  • 1,503
  • 3
  • 16
  • 43
0
votes
1 answer

SSL Error with 12045

I have written a chef cookbook for windows platform. I'm able to converge the cookbook. It is working fine with downloading the packages from the internal artifactory using "http", but unable to access "https" due to SSL ERROR 12045?
kiran
  • 21
  • 1
  • 1
0
votes
1 answer

Using test-kitchen with vsphere

I have a chef cookbook that works when using kitchen to test it on aws. I want to instead have it test with our vsphere cluster. I can't seem to find any MODERN documentation on how to make this work. Currently, kitchen create seems to work, and…
Kevin Milner
  • 821
  • 2
  • 14
  • 30