Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cddd502

Browse files
committed
Add test-kitchen 1.0 support
The 1.0 branch of test-kitchen is based on Fletcher Nichol's excellent Jamie CI codebase.
1 parent 87223e2 commit cddd502

File tree

6 files changed

+138
-0
lines changed

6 files changed

+138
-0
lines changed

.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.vagrant
2+
Berksfile.lock
3+
*~
4+
*#
5+
.#*
6+
\#*#
7+
.*.sw[a-z]
8+
*.un~
9+
/cookbooks
10+
11+
# Bundler
12+
Gemfile.lock
13+
bin/*
14+
.bundle/*
15+
.kitchen/
16+
.kitchen.local.yml

.kitchen.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
driver_plugin: vagrant
3+
platforms:
4+
- name: ubuntu-12.10
5+
driver_config:
6+
box: canonical-ubuntu-12.10
7+
box_url: http://cloud-images.ubuntu.com/vagrant/quantal/current/quantal-server-cloudimg-amd64-vagrant-disk1.box
8+
require_chef_omnibus: 11.4.0
9+
run_list:
10+
- recipe[apt]
11+
- name: ubuntu-12.04
12+
driver_config:
13+
box: canonical-ubuntu-12.04
14+
box_url: http://cloud-images.ubuntu.com/vagrant/precise/current/precise-server-cloudimg-amd64-vagrant-disk1.box
15+
require_chef_omnibus: 11.4.0
16+
run_list:
17+
- recipe[apt]
18+
- name: ubuntu-10.04
19+
driver_config:
20+
box: opscode-ubuntu-10.04
21+
box_url: http://opscode-vm.s3.amazonaws.com/vagrant/opscode_ubuntu-10.04_chef-11.2.0.box
22+
require_chef_omnibus: 11.4.0
23+
run_list:
24+
- recipe[apt]
25+
- name: centos-5.8
26+
driver_config:
27+
box: opscode-centos-6.3
28+
box_url: http://opscode-vm.s3.amazonaws.com/vagrant/opscode_centos-5.8_chef-11.2.0.box
29+
require_chef_omnibus: 11.4.0
30+
run_list:
31+
- recipe[yum::epel]
32+
- name: centos-6.3
33+
driver_config:
34+
box: opscode-centos-6.3
35+
box_url: http://opscode-vm.s3.amazonaws.com/vagrant/opscode_centos-6.3_chef-11.2.0.box
36+
require_chef_omnibus: 11.4.0
37+
run_list:
38+
- recipe[yum::epel]
39+
suites:
40+
- name: default
41+
run_list:
42+
- recipe[python]
43+
attributes: {}

Berksfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
site :opscode
2+
3+
metadata
4+
5+
group :integration do
6+
cookbook "apt"
7+
cookbook "yum"
8+
end

Gemfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
source 'https://rubygems.org'
2+
3+
gem 'foodcritic'
4+
gem 'berkshelf'
5+
gem 'thor-foodcritic'
6+
gem 'vagrant', '~> 1.0.6'
7+
8+
group :integration do
9+
gem 'test-kitchen', :git => "git://github.com/opscode/test-kitchen.git", :branch => '1.0'
10+
gem 'kitchen-vagrant', :git => "git://github.com/opscode/kitchen-vagrant.git"
11+
gem 'kitchen-ec2', :git => "git://github.com/opscode/kitchen-ec2.git"
12+
end

README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,59 @@ virtualenv
153153

154154
Installs virtualenv using the `python_pip` resource.
155155

156+
Testing
157+
=======
158+
159+
This cookbook ships with full support for the new alpha version of Opscode's
160+
`test-kitchen`. [Fletcher Nichol's](https://github.com/fnichol) excellent Jamie
161+
integration test runner was
162+
[recently merged into the test-kitchen codebase](http://lists.opscode.com/sympa/arc/chef-dev/2013-01/msg00038.html).
163+
This merge and all new feature work are now taking place in the
164+
[1.0 branch of test-kitchen](https://github.com/opscode/test-kitchen/tree/1.0).
165+
Even though many community members have been dogfooding the new `test-kitchen`
166+
codebase and it has proven quite stable, it should still be regarded as
167+
pre-release code and YMMV.
168+
169+
Running integration with test-kitchen is easy. First we'll assume you have a
170+
sane cookbook development toolchain installed which includes:
171+
172+
* Git
173+
* Ruby 1.9.x
174+
* Bundler
175+
* VirtualBox 4.x
176+
177+
If you need help setting up this toolchain, take a read through the
178+
"[System Setup](http://vialstudios.com/guide-authoring-cookbooks.html#system_setup)"
179+
section of [Jamie Winsor's](https://github.com/reset) excellent cookbook
180+
authoring guide.
181+
182+
First install all gem dependencies with Bundler:
183+
184+
```shell
185+
$ bundle install --binstubs
186+
```
187+
188+
Bundler will install all of the dependent RubyGems and guarantee that you have
189+
the right versions. Now it's time to get your test on:
190+
191+
```shell
192+
$ bundle exec kitchen test
193+
```
194+
195+
This command will do the following across every platform/version this cookbook
196+
supports:
197+
198+
* Use Vagrant to provision a platform-specific VM.
199+
* Add a `recipe[python]` entry to the instance's run_list.
200+
* Converge the VM with `chef-solo`.
201+
202+
By default, any VM that successfully converges will automaticallly be cleaned
203+
up. The full set of `kitchen` subcommands can be viewed by running:
204+
205+
```shell
206+
$ bundle exec kitchen help
207+
```
208+
156209
License and Author
157210
==================
158211

Vagrantfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
require 'kitchen/vagrant'
2+
require 'berkshelf/vagrant'
3+
4+
Vagrant::Config.run do |config|
5+
Kitchen::Vagrant.define_vms(config)
6+
end

0 commit comments

Comments
 (0)