Skip to content

Commit

Permalink
update test coverage for test kitchen 1.0.alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
jtimberman committed Feb 25, 2013
1 parent f8491cd commit 83e056e
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 53 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
.vagrant
tmp
Gemfile.lock
.kitchen/
.kitchen.local.yml
31 changes: 31 additions & 0 deletions .kitchen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
driver_plugin: vagrant
platforms:
- name: ubuntu-12.04
driver_config:
box: opscode-ubuntu-12.04
box_url: http://cloud-images.ubuntu.com/vagrant/precise/current/precise-server-cloudimg-amd64-vagrant-disk1.box
require_chef_omnibus: 11.4.0
run_list:
- recipe[apt]
- name: ubuntu-10.04
driver_config:
box: opscode-ubuntu-10.04
box_url: http://opscode-vm.s3.amazonaws.com/vagrant/opscode_ubuntu-10.04_chef-11.2.0.box
require_chef_omnibus: 11.4.0
run_list:
- recipe[apt]
- name: centos-6.3
driver_config:
box: opscode-centos-6.3
box_url: http://opscode-vm.s3.amazonaws.com/vagrant/opscode_centos-6.3_chef-11.2.0.box
require_chef_omnibus: 11.4.0
run_list:
- recipe[yum::epel]
suites:
- name: default
run_list:
- recipe[minitest-handler]
- recipe[ark]
- recipe[ark::test]
attributes: {}
9 changes: 7 additions & 2 deletions Berksfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ site :opscode
metadata

cookbook "java"
cookbook "minitest-handler"
cookbook "apt"

group :integration do
cookbook "apt"
cookbook "yum"

# Future, when/if minitest support for this cookbook is added
cookbook "minitest-handler"
end
16 changes: 13 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
source :rubygems
source 'https://rubygems.org'

gem 'rake'
gem 'foodcritic'
gem 'berkshelf'
gem 'thor-foodcritic'
gem 'vagrant', '~> 1.0.5'
gem 'rake'
gem 'vagrant', '~> 1.0.6'

group :integration do
gem 'test-kitchen', :git => "git://github.com/opscode/test-kitchen.git", :branch => '1.0'
gem 'kitchen-vagrant', :git => "git://github.com/opscode/kitchen-vagrant.git"

# Change .kitchen.yml's driver_plugin to ec2 and populate
# .kitchen.local.yml's driver_config with aws auth data
gem 'kitchen-ec2', :git => "git://github.com/opscode/kitchen-ec2.git"
end
7 changes: 7 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,10 @@ def prepare_foodcritic_sandbox(sandbox)
cp_r Dir.glob("{#{files.join(',')}}"), sandbox
puts "\n\n"
end

begin
require 'kitchen/rake_tasks'
Kitchen::RakeTasks.new
rescue LoadError
puts ">>>>> Kitchen gem not loaded, omitting tasks" unless ENV['CI']
end
50 changes: 2 additions & 48 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,52 +1,6 @@
require 'kitchen/vagrant'
require 'berkshelf/vagrant'

distros = {
:lucid32 => {
:url => 'https://opscode-vm.s3.amazonaws.com/vagrant/boxes/opscode-ubuntu-10.04-i386.box',
:recipe => "openjdk",
:run_list => [ "apt" ]
},
:centos6_3_32 => {
:url => 'https://opscode-vm.s3.amazonaws.com/vagrant/boxes/opscode-centos-6.3-i386.box',
:recipe => "openjdk"
},
:debian_squeeze_32 => {
:url => 'http://mathie-vagrant-boxes.s3.amazonaws.com/debian_squeeze_32.box',
:recipe => "openjdk",
:run_list => [ "apt" ]
},
:precise32 => {
:url => 'https://opscode-vm.s3.amazonaws.com/vagrant/boxes/opscode-ubuntu-12.04-i386.box',
:recipe => "openjdk",
:run_list => [ "apt" ]
}
}

Vagrant::Config.run do |config|

distros.each_pair do |name,options|
config.vm.define name do |dist_config|
dist_config.vm.box = name.to_s
dist_config.vm.box_url = options[:url]

dist_config.vm.customize do |vm|
vm.name = name.to_s
vm.memory_size = 1024
end

dist_config.vm.provision :chef_solo do |chef|

chef.log_level = :debug
chef.add_recipe "minitest-handler"
chef.add_recipe "ark"
chef.add_recipe "ark::test"

if options[:run_list]
options[:run_list].each {|recipe| chef.run_list.insert(0, recipe) }
end

end
end
end
Kitchen::Vagrant.define_vms(config)
end

Empty file.
Empty file.

0 comments on commit 83e056e

Please sign in to comment.