summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjtimberman <joshua@opscode.com>2012-11-22 23:35:54 -0700
committerjtimberman <joshua@opscode.com>2012-11-22 23:35:54 -0700
commit933784a3240d488cfbf79b5a9b8ecb89ef2cb44f (patch)
treeb33b66f5cea78de455cb0027bdcfc12e90bb62d4
parent5199c45dfbdfa9919aaa3a64535d8216c27b7948 (diff)
downloadmixlib-shellout-933784a3240d488cfbf79b5a9b8ecb89ef2cb44f.tar.gz
add test cookbook for rvm installation
* test-kitchen needs its own bundle group * project-specific Cheffile addition for rvm * create a test cookbook to do the rvm installation/setup for running tests * remove "rvm baseboxes" for supported platforms, use test-kitchen defaults Output of 'bundle exec kitchen test --platform ubuntu-12.04: Finished in 15.2 seconds 99 examples, 0 failures
-rw-r--r--Gemfile4
-rw-r--r--test/kitchen/Kitchenfile20
-rw-r--r--test/kitchen/cookbooks/Cheffile3
-rw-r--r--test/kitchen/cookbooks/mixlib-shellout_test/README.md1
-rw-r--r--test/kitchen/cookbooks/mixlib-shellout_test/metadata.rb5
-rw-r--r--test/kitchen/cookbooks/mixlib-shellout_test/recipes/default.rb32
6 files changed, 47 insertions, 18 deletions
diff --git a/Gemfile b/Gemfile
index 9d42572..6450af9 100644
--- a/Gemfile
+++ b/Gemfile
@@ -8,4 +8,8 @@ group(:test) do
end
+group(:kitchen) do
+ gem 'test-kitchen', '>= 0.7.0.beta.1'
+
+end
diff --git a/test/kitchen/Kitchenfile b/test/kitchen/Kitchenfile
index 70460f2..60afd49 100644
--- a/test/kitchen/Kitchenfile
+++ b/test/kitchen/Kitchenfile
@@ -17,26 +17,10 @@
# limitations under the License.
#
-# We need to test on platforms with baseboxes that have RVM and Ruby
-# (1.9.2) already installed.
-
-platform :centos do
- version "5.7" do
- box "centos-5.7-rvm"
- box_url "http://acrmp-vm.s3.amazonaws.com/vagrant/boxes/centos-5.7-rvm.box"
- end
-end
-
-platform :ubuntu do
- version "11.04" do
- box "ubuntu-11.04-rvm"
- box_url "http://acrmp-vm.s3.amazonaws.com/vagrant/boxes/ubuntu-11.04-rvm.box"
- end
-end
-
integration_test "mixlib-shellout" do
language 'ruby'
- runtimes ['1.9.2']
+ runtimes ['1.9.3']
install 'bundle install --without kitchen'
script 'bundle exec rspec spec'
+ run_list_extras ['mixlib-shellout_test::default']
end
diff --git a/test/kitchen/cookbooks/Cheffile b/test/kitchen/cookbooks/Cheffile
new file mode 100644
index 0000000..5313b1d
--- /dev/null
+++ b/test/kitchen/cookbooks/Cheffile
@@ -0,0 +1,3 @@
+cookbook 'rvm',
+:git => 'https://github.com/fnichol/chef-rvm.git',
+:ref => 'd6cdb2ab93c421ca6234cbaf5548c914eba4084f'
diff --git a/test/kitchen/cookbooks/mixlib-shellout_test/README.md b/test/kitchen/cookbooks/mixlib-shellout_test/README.md
new file mode 100644
index 0000000..dd93d60
--- /dev/null
+++ b/test/kitchen/cookbooks/mixlib-shellout_test/README.md
@@ -0,0 +1 @@
+This cookbook is used with test-kitchen to test the parent project, mixlib-shellout.
diff --git a/test/kitchen/cookbooks/mixlib-shellout_test/metadata.rb b/test/kitchen/cookbooks/mixlib-shellout_test/metadata.rb
new file mode 100644
index 0000000..b44b488
--- /dev/null
+++ b/test/kitchen/cookbooks/mixlib-shellout_test/metadata.rb
@@ -0,0 +1,5 @@
+maintainer "Opscode, Inc."
+maintainer_email "cookbooks@opscode.com"
+license "Apache 2.0"
+description "This cookbook is used with test-kitchen to test the parent project, mixlib-shellout."
+version "1.0.0"
diff --git a/test/kitchen/cookbooks/mixlib-shellout_test/recipes/default.rb b/test/kitchen/cookbooks/mixlib-shellout_test/recipes/default.rb
new file mode 100644
index 0000000..fa78b4a
--- /dev/null
+++ b/test/kitchen/cookbooks/mixlib-shellout_test/recipes/default.rb
@@ -0,0 +1,32 @@
+#
+# Cookbook Name:: mixlib-shellout_test
+# Recipe:: default
+#
+# Copyright 2012, Opscode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+node.set['rvm']['user_installs'] = [
+ { 'user' => 'vagrant',
+ 'default_ruby' => 'ruby-1.9.3-p327',
+ 'rubies' => ['1.9.3']
+ }
+]
+
+node.set['rvm']['gems'] = {
+ "ruby-1.9.3-p327" => [
+ { 'name' => 'bundler' }
+ ]
+}
+include_recipe "rvm::user"