diff --git a/.delivery/project.toml b/.delivery/project.toml new file mode 100644 index 00000000..3d104906 --- /dev/null +++ b/.delivery/project.toml @@ -0,0 +1,9 @@ +[local_phases] +unit = "bundle exec rspec test/spec/" +lint = 'cookstyle --display-cop-names --extra-details' +syntax = "foodcritic ." +provision = "echo skipping" +deploy = "echo skipping" +smoke = "echo skipping" +functional = "echo skipping" +cleanup = "echo skipping" diff --git a/.travis.yml b/.travis.yml index ef3ce579..ced2889c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,7 +43,7 @@ matrix: include: - script: - bundle install - - bundle exec rake + - chef exec delivery local all env: UNIT_AND_LINT=1 notifications: diff --git a/Berksfile b/Berksfile new file mode 100644 index 00000000..05d9a8e5 --- /dev/null +++ b/Berksfile @@ -0,0 +1,8 @@ +source 'https://supermarket.chef.io' + +metadata + +group :integration do + cookbook 'selinux' + cookbook 'consul_spec', path: 'test/fixtures/cookbooks/consul_spec' +end diff --git a/Gemfile b/Gemfile index 50655c4a..1ef183e0 100644 --- a/Gemfile +++ b/Gemfile @@ -1,28 +1,14 @@ +# This gemfile provides additional gems for testing and releasing this cookbook +# It is meant to be installed on top of ChefDK which provides the majority +# of the necessary gems for testing this cookbook +# +# Run 'chef exec bundle install' to install these dependencies + source 'https://rubygems.org' + +gem 'berkshelf' gem 'poise', '~> 2.2' -gem 'poise-service', '~> 1.0' gem 'poise-boiler' -gem 'chef-sugar' - -group :lint do - gem 'cookstyle', '~> 1.0' - gem 'rubocop' - gem 'foodcritic' -end - -group :unit, :integration do - gem 'chef-dk', '~> 1.0' - gem 'chefspec' - gem 'rubyzip' - gem 'serverspec' - gem 'rb-readline' -end - -group :development do - gem 'awesome_print' - gem 'stove' -end - -group :doc do - gem 'yard' -end +gem 'poise-service', '~> 1.0' +gem 'rb-readline' +gem 'stove' diff --git a/metadata.rb b/metadata.rb index f74a52d2..66439bd7 100644 --- a/metadata.rb +++ b/metadata.rb @@ -25,3 +25,5 @@ source_url 'https://github.com/johnbellone/consul-cookbook' if respond_to?(:source_url) issues_url 'https://github.com/johnbellone/consul-cookbook/issues' if respond_to?(:issues_url) + +chef_version '>= 12.1' if respond_to?(:chef_version) diff --git a/test/spec/spec_helper.rb b/test/spec/spec_helper.rb index cdcaa92e..054bcd22 100644 --- a/test/spec/spec_helper.rb +++ b/test/spec/spec_helper.rb @@ -1,7 +1,4 @@ require 'chefspec' -require 'chefspec/policyfile' +require 'chefspec/berkshelf' require 'poise_boiler/spec_helper' require_relative '../../libraries/helpers' - -require 'codeclimate-test-reporter' -CodeClimate::TestReporter.start