Browse Source

move from bundler to chefdk

- deprecated Gemfile
- Updated TESTING.md and README.md
- updated Rakefile to use chef exec insted of bundle exec
- replaced Runner with SoloRunner in specs

Change-Id: If3e3b54c9dbaa8bb51164bc85fd93ff5fc54ec4d
tags/kilo-eol
Jan Klare 4 years ago
parent
commit
16a6af5000

+ 4
- 0
Gemfile View File

@@ -1,3 +1,7 @@
1
+## THIS GEMFILE IS DEPRECATED AND WILL BE REMOVED AFTER THE NEXT RELEASE
2
+## THERE WON'T BE ANY UPDATES TO THIS FILE DURING THIS RELEASE CYCLE
3
+## WE SWITCHED TO CHEFDK AS THE BUNDLE FOR THE NEEDED GEMS
4
+
1 5
 # encoding: UTF-8
2 6
 source 'https://rubygems.org'
3 7
 

+ 1
- 0
README.md View File

@@ -253,6 +253,7 @@ License and Author
253 253
 | **Author**           |  Mark Vanderwiel (<vanderwl@us.ibm.com>)           |
254 254
 | **Author**           |  Eric Zhou (<zyouzhou@cn.ibm.com>)                 |
255 255
 | **Author**           |  Edwin Wang (<edwin.wang@cn.ibm.com>)              |
256
+| **Author**           |  Jan Klare (<j.klare@x-ion.de>)                    |
256 257
 |                      |                                                    |
257 258
 | **Copyright**        |  Copyright (c) 2012, Rackspace US, Inc.            |
258 259
 | **Copyright**        |  Copyright (c) 2012-2013, AT&T Services, Inc.      |

+ 7
- 14
Rakefile View File

@@ -2,32 +2,25 @@ task default: ["test"]
2 2
 
3 3
 task :test => [:lint, :style, :unit]
4 4
 
5
-task :bundler_prep do
6
-  mkdir_p '.bundle'
7
-  sh %{bundle install --path=.bundle --jobs 1 --retry 3 --verbose}
5
+task :berks_prep do
6
+  sh %{chef exec berks vendor}
8 7
 end
9 8
 
10
-task :berks_prep => :bundler_prep do
11
-  sh %{bundle exec berks vendor}
9
+task :lint do
10
+  sh %{chef exec foodcritic --epic-fail any --tags ~FC003 --tags ~FC023 .}
12 11
 end
13 12
 
14
-task :lint => :bundler_prep do
15
-  sh %{bundle exec foodcritic --epic-fail any --tags ~FC003 --tags ~FC023 .}
16
-end
17
-
18
-task :style => :bundler_prep do
19
-  sh %{bundle exec rubocop}
13
+task :style do
14
+  sh %{chef exec rubocop}
20 15
 end
21 16
 
22 17
 task :unit => :berks_prep do
23
-  sh %{bundle exec rspec --format documentation}
18
+  sh %{chef exec rspec --format documentation}
24 19
 end
25 20
 
26 21
 task :clean do
27 22
   rm_rf [
28
-    '.bundle',
29 23
     'berks-cookbooks',
30
-    'Gemfile.lock',
31 24
     'Berksfile.lock'
32 25
   ]
33 26
 end

+ 8
- 8
TESTING.md View File

@@ -1,18 +1,18 @@
1 1
 # Testing the Cookbook #
2 2
 
3
-This cookbook uses [bundler](http://gembundler.com/) and [berkshelf](http://berkshelf.com/) to isolate dependencies. Make sure you have `ruby 1.9.x`, `bundler`, `rake`, build essentials and the header files for `gecode` installed before continuing. Make sure that you're using gecode version 3. More info [here](https://github.com/opscode/dep-selector-libgecode/tree/0bad63fea305ede624c58506423ced697dd2545e#using-a-system-gecode-instead).
3
+This cookbook uses [chefdk](https://downloads.chef.io/chef-dk/) and [berkshelf](http://berkshelf.com/) to isolate dependencies. Make sure you have chefdk and the header files for `gecode` installed before continuing. Make sure that you're using gecode version 3. More info [here](https://github.com/opscode/dep-selector-libgecode/tree/0bad63fea305ede624c58506423ced697dd2545e#using-a-system-gecode-instead). For more detailed information on what needs to be installed, you can have a quick look into the bootstrap.sh file in this repository, which does install all the needed things to get going on ubuntu trusty. The tests defined in the Rakefile include lint, style and unit. For integration testing please refere to the [openstack-chef-repo](https://github.com/stackforge/openstack-chef-repo).
4 4
 
5
-We have three test suites which you can run individually (there are three rake tasks):
5
+We have three test suites which you can run either, individually (there are three rake tasks):
6 6
 
7
-    $ rake lint
8
-    $ rake style
9
-    $ rake unit
7
+    $ chef exec rake lint
8
+    $ chef exec rake style
9
+    $ chef exec rake unit
10 10
 
11 11
 or altogether:
12 12
 
13
-    $ rake test
13
+    $ chef exec rake
14 14
 
15
-The `rake` tasks will take care of installing the needed gem dependencies and cookbooks with `berkshelf`.
15
+The `rake` tasks will take care of installing the needed cookbooks with `berkshelf`.
16 16
 
17 17
 ## Rubocop  ##
18 18
 
@@ -27,4 +27,4 @@ The `rake` tasks will take care of installing the needed gem dependencies and co
27 27
 
28 28
 ## Chefspec
29 29
 
30
-[ChefSpec](https://github.com/sethvargo/chefspec/) is a unit testing framework for testing Chef cookbooks. ChefSpec makes it easy to write examples and get fast feedback on cookbook changes without the need for virtual machines or cloud servers.
30
+[ChefSpec](https://github.com/sethvargo/chefspec) is a unit testing framework for testing Chef cookbooks. ChefSpec makes it easy to write examples and get fast feedback on cookbook changes without the need for virtual machines or cloud servers.

+ 1
- 1
spec/api-opensuse_spec.rb View File

@@ -6,7 +6,7 @@ require_relative 'spec_helper'
6 6
 
7 7
 describe 'openstack-block-storage::api' do
8 8
   describe 'suse' do
9
-    let(:runner) { ChefSpec::Runner.new(SUSE_OPTS) }
9
+    let(:runner) { ChefSpec::SoloRunner.new(SUSE_OPTS) }
10 10
     let(:node) { runner.node }
11 11
     let(:chef_run) { runner.converge(described_recipe) }
12 12
 

+ 1
- 1
spec/api-redhat_spec.rb View File

@@ -6,7 +6,7 @@ require_relative 'spec_helper'
6 6
 
7 7
 describe 'openstack-block-storage::api' do
8 8
   describe 'redhat' do
9
-    let(:runner) { ChefSpec::Runner.new(REDHAT_OPTS) }
9
+    let(:runner) { ChefSpec::SoloRunner.new(REDHAT_OPTS) }
10 10
     let(:node) { runner.node }
11 11
     let(:chef_run) { runner.converge(described_recipe) }
12 12
 

+ 1
- 1
spec/api_spec.rb View File

@@ -6,7 +6,7 @@ require_relative 'spec_helper'
6 6
 
7 7
 describe 'openstack-block-storage::api' do
8 8
   describe 'ubuntu' do
9
-    let(:runner) { ChefSpec::Runner.new(UBUNTU_OPTS) }
9
+    let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) }
10 10
     let(:node) { runner.node }
11 11
     let(:chef_run) { runner.converge(described_recipe) }
12 12
 

+ 1
- 1
spec/cinder_common-redhat_spec.rb View File

@@ -6,7 +6,7 @@ require_relative 'spec_helper'
6 6
 
7 7
 describe 'openstack-block-storage::cinder-common' do
8 8
   describe 'rhel' do
9
-    let(:runner) { ChefSpec::Runner.new(REDHAT_OPTS) }
9
+    let(:runner) { ChefSpec::SoloRunner.new(REDHAT_OPTS) }
10 10
     let(:node) { runner.node }
11 11
     let(:chef_run) { runner.converge(described_recipe) }
12 12
 

+ 1
- 1
spec/cinder_common-suse_spec.rb View File

@@ -6,7 +6,7 @@ require_relative 'spec_helper'
6 6
 
7 7
 describe 'openstack-block-storage::cinder-common' do
8 8
   describe 'suse' do
9
-    let(:runner) { ChefSpec::Runner.new(SUSE_OPTS) }
9
+    let(:runner) { ChefSpec::SoloRunner.new(SUSE_OPTS) }
10 10
     let(:node) { runner.node }
11 11
     let(:chef_run) { runner.converge(described_recipe) }
12 12
 

+ 1
- 1
spec/cinder_common_spec.rb View File

@@ -6,7 +6,7 @@ require_relative 'spec_helper'
6 6
 
7 7
 describe 'openstack-block-storage::cinder-common' do
8 8
   describe 'ubuntu' do
9
-    let(:runner) { ChefSpec::Runner.new(UBUNTU_OPTS) }
9
+    let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) }
10 10
     let(:node) { runner.node }
11 11
     let(:chef_run) do
12 12
       node.set['openstack']['mq']['host'] = '127.0.0.1'

+ 1
- 1
spec/client-redhat_spec.rb View File

@@ -3,7 +3,7 @@ require_relative 'spec_helper'
3 3
 
4 4
 describe 'openstack-block-storage::client' do
5 5
   describe 'redhat' do
6
-    let(:runner) { ChefSpec::Runner.new(REDHAT_OPTS) }
6
+    let(:runner) { ChefSpec::SoloRunner.new(REDHAT_OPTS) }
7 7
     let(:node) { runner.node }
8 8
     let(:chef_run) do
9 9
       runner.converge(described_recipe)

+ 1
- 1
spec/client_spec.rb View File

@@ -3,7 +3,7 @@ require_relative 'spec_helper'
3 3
 
4 4
 describe 'openstack-block-storage::client' do
5 5
   describe 'ubuntu' do
6
-    let(:runner) { ChefSpec::Runner.new(UBUNTU_OPTS) }
6
+    let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) }
7 7
     let(:node) { runner.node }
8 8
     let(:chef_run) do
9 9
       runner.converge(described_recipe)

+ 1
- 1
spec/identity_registration_spec.rb View File

@@ -6,7 +6,7 @@ require_relative 'spec_helper'
6 6
 
7 7
 describe 'openstack-block-storage::identity_registration' do
8 8
   describe 'ubuntu' do
9
-    let(:runner) { ChefSpec::Runner.new(UBUNTU_OPTS) }
9
+    let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) }
10 10
     let(:node) { runner.node }
11 11
     let(:chef_run) { runner.converge(described_recipe) }
12 12
 

+ 1
- 1
spec/scheduler-redhat_spec.rb View File

@@ -6,7 +6,7 @@ require_relative 'spec_helper'
6 6
 
7 7
 describe 'openstack-block-storage::scheduler' do
8 8
   describe 'redhat' do
9
-    let(:runner) { ChefSpec::Runner.new(REDHAT_OPTS) }
9
+    let(:runner) { ChefSpec::SoloRunner.new(REDHAT_OPTS) }
10 10
     let(:node) { runner.node }
11 11
     let(:chef_run) { runner.converge(described_recipe) }
12 12
 

+ 1
- 1
spec/scheduler-suse_spec.rb View File

@@ -6,7 +6,7 @@ require_relative 'spec_helper'
6 6
 
7 7
 describe 'openstack-block-storage::scheduler' do
8 8
   describe 'suse' do
9
-    let(:runner) { ChefSpec::Runner.new(SUSE_OPTS) }
9
+    let(:runner) { ChefSpec::SoloRunner.new(SUSE_OPTS) }
10 10
     let(:node) { runner.node }
11 11
     let(:chef_run) { runner.converge(described_recipe) }
12 12
 

+ 1
- 1
spec/scheduler_spec.rb View File

@@ -6,7 +6,7 @@ require_relative 'spec_helper'
6 6
 
7 7
 describe 'openstack-block-storage::scheduler' do
8 8
   describe 'ubuntu' do
9
-    let(:runner) { ChefSpec::Runner.new(UBUNTU_OPTS) }
9
+    let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) }
10 10
     let(:node) { runner.node }
11 11
     let(:chef_run) { runner.converge(described_recipe) }
12 12
 

+ 2
- 2
spec/volume-redhat_spec.rb View File

@@ -6,7 +6,7 @@ require_relative 'spec_helper'
6 6
 
7 7
 describe 'openstack-block-storage::volume' do
8 8
   describe 'redhat' do
9
-    let(:runner) { ChefSpec::Runner.new(REDHAT_OPTS) }
9
+    let(:runner) { ChefSpec::SoloRunner.new(REDHAT_OPTS) }
10 10
     let(:node) { runner.node }
11 11
     let(:chef_run) { runner.converge(described_recipe) }
12 12
 
@@ -107,7 +107,7 @@ describe 'openstack-block-storage::volume' do
107 107
 
108 108
     describe 'IBM GPFS volume driver' do
109 109
       before do
110
-        @chef_run = ::ChefSpec::Runner.new ::REDHAT_OPTS do |n|
110
+        @chef_run = ::ChefSpec::SoloRunner.new ::REDHAT_OPTS do |n|
111 111
           n.set['openstack']['block-storage']['volume']['driver'] = 'cinder.volume.drivers.ibm.gpfs.GPFSDriver'
112 112
           n.set['openstack']['block-storage']['gpfs']['gpfs_mount_point_base'] = 'volumes'
113 113
         end

+ 1
- 1
spec/volume-suse_spec.rb View File

@@ -6,7 +6,7 @@ require_relative 'spec_helper'
6 6
 
7 7
 describe 'openstack-block-storage::volume' do
8 8
   describe 'suse' do
9
-    let(:runner) { ChefSpec::Runner.new(SUSE_OPTS) }
9
+    let(:runner) { ChefSpec::SoloRunner.new(SUSE_OPTS) }
10 10
     let(:node) { runner.node }
11 11
     let(:chef_run) { runner.converge(described_recipe) }
12 12
 

+ 1
- 1
spec/volume_spec.rb View File

@@ -6,7 +6,7 @@ require_relative 'spec_helper'
6 6
 
7 7
 describe 'openstack-block-storage::volume' do
8 8
   describe 'ubuntu' do
9
-    let(:runner) { ChefSpec::Runner.new(UBUNTU_OPTS) }
9
+    let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) }
10 10
     let(:node) { runner.node }
11 11
     let(:chef_run) { runner.converge(described_recipe) }
12 12
 

Loading…
Cancel
Save