From eb9af8d4900e2ec707a33d1e27a8c17525360a33 Mon Sep 17 00:00:00 2001 From: jtimberman Date: Mon, 27 May 2013 22:57:01 -0600 Subject: [PATCH] convert test kitchen support to v1.0alpha --- .gitignore | 11 ++++- .kitchen.yml | 40 +++++++++++++++++++ Berksfile | 8 ++++ TESTING.md | 25 ++++++++++++ test/kitchen/Kitchenfile | 4 -- test/kitchen/cookbooks/git_test/README.md | 1 - test/kitchen/cookbooks/git_test/metadata.rb | 6 --- .../cookbooks/git_test/recipes/default.rb | 20 ---------- .../cookbooks/git_test/recipes/server.rb | 20 ---------- 9 files changed, 83 insertions(+), 52 deletions(-) create mode 100644 .kitchen.yml create mode 100644 Berksfile create mode 100644 TESTING.md delete mode 100644 test/kitchen/Kitchenfile delete mode 100644 test/kitchen/cookbooks/git_test/README.md delete mode 100644 test/kitchen/cookbooks/git_test/metadata.rb delete mode 100644 test/kitchen/cookbooks/git_test/recipes/default.rb delete mode 100644 test/kitchen/cookbooks/git_test/recipes/server.rb diff --git a/.gitignore b/.gitignore index 7beac45..dd1e425 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,14 @@ +.vagrant +Berksfile.lock +Gemfile.lock +*~ +*# +.#* +\#*# +.*.sw[a-z] +*.un~ .bundle .cache .kitchen bin -Gemfile.lock +.kitchen.local.yml diff --git a/.kitchen.yml b/.kitchen.yml new file mode 100644 index 0000000..7aff204 --- /dev/null +++ b/.kitchen.yml @@ -0,0 +1,40 @@ +--- +driver_plugin: vagrant +driver_config: + require_chef_omnibus: true + +platforms: +- name: ubuntu-12.04 + driver_config: + box: opscode-ubuntu-12.04 + box_url: https://opscode-vm.s3.amazonaws.com/vagrant/opscode_ubuntu-12.04_provisionerless.box + run_list: + - recipe[apt] + +- name: ubuntu-10.04 + driver_config: + box: opscode-ubuntu-10.04 + box_url: https://opscode-vm.s3.amazonaws.com/vagrant/opscode_ubuntu-10.04_provisionerless.box + run_list: + - recipe[apt] + +- name: centos-6.4 + driver_config: + box: opscode-centos-6.4 + box_url: https://opscode-vm.s3.amazonaws.com/vagrant/opscode_centos-6.4_provisionerless.box + +- name: centos-5.9 + driver_config: + box: opscode-centos-5.9 + box_url: https://opscode-vm.s3.amazonaws.com/vagrant/opscode_centos-5.9_provisionerless.box + +suites: +- name: default + run_list: + - recipe[git] + attributes: {} + +- name: server + run_list: + - recipe[git::server] + attributes: {} diff --git a/Berksfile b/Berksfile new file mode 100644 index 0000000..34a3b2d --- /dev/null +++ b/Berksfile @@ -0,0 +1,8 @@ +site :opscode + +metadata + +group :integration do + cookbook "apt" + cookbook "yum" +end diff --git a/TESTING.md b/TESTING.md new file mode 100644 index 0000000..e29ff7c --- /dev/null +++ b/TESTING.md @@ -0,0 +1,25 @@ +This cookbook includes support for running tests via Test Kitchen (1.0). This has some requirements. + +1. You must be using the Git repository, rather than the downloaded cookbook from the Chef Community Site. +2. You must have Vagrant 1.1 installed. +3. You must have a "sane" Ruby 1.9.3 environment. + +Once the above requirements are met, install the additional requirements: + +Install the berkshelf plugin for vagrant, and berkshelf to your local Ruby environment. + + vagrant plugin install vagrant-berkshelf + gem install berkshelf + +Install Test Kitchen 1.0 (unreleased yet, use the alpha / prerelease version). + + gem install test-kitchen --pre + +Install the Vagrant driver for Test Kitchen. + + gem install kitchen-vagrant + +Once the above are installed, you should be able to run Test Kitchen: + + kitchen list + kitchen test diff --git a/test/kitchen/Kitchenfile b/test/kitchen/Kitchenfile deleted file mode 100644 index 813df49..0000000 --- a/test/kitchen/Kitchenfile +++ /dev/null @@ -1,4 +0,0 @@ -cookbook "git" do - configuration "default" - configuration "server" -end diff --git a/test/kitchen/cookbooks/git_test/README.md b/test/kitchen/cookbooks/git_test/README.md deleted file mode 100644 index 77be8e6..0000000 --- a/test/kitchen/cookbooks/git_test/README.md +++ /dev/null @@ -1 +0,0 @@ -This cookbook is used with test-kitchen to test the parent, git cookbok diff --git a/test/kitchen/cookbooks/git_test/metadata.rb b/test/kitchen/cookbooks/git_test/metadata.rb deleted file mode 100644 index f161af6..0000000 --- a/test/kitchen/cookbooks/git_test/metadata.rb +++ /dev/null @@ -1,6 +0,0 @@ -name "git" -maintainer "Opscode, Inc." -maintainer_email "cookbooks@opscode.com" -license "Apache 2.0" -description "This cookbook is used with test-kitchen to test the parent, git cookbok" -version "1.0.0" diff --git a/test/kitchen/cookbooks/git_test/recipes/default.rb b/test/kitchen/cookbooks/git_test/recipes/default.rb deleted file mode 100644 index bb97513..0000000 --- a/test/kitchen/cookbooks/git_test/recipes/default.rb +++ /dev/null @@ -1,20 +0,0 @@ -# -# Cookbook Name:: git_test -# Recipe:: default -# -# Copyright 2013, 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. -# - -include_recipe "git::default" diff --git a/test/kitchen/cookbooks/git_test/recipes/server.rb b/test/kitchen/cookbooks/git_test/recipes/server.rb deleted file mode 100644 index 0671f1f..0000000 --- a/test/kitchen/cookbooks/git_test/recipes/server.rb +++ /dev/null @@ -1,20 +0,0 @@ -# -# Cookbook Name:: git_test -# Recipe:: server -# -# Copyright 2013, 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. -# - -include_recipe "git::server"