From 110c8a00dbcaa9004ddc0cbb7bac381f4d6501c4 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Fri, 1 Apr 2016 11:52:35 -0700 Subject: [PATCH] Update testing with new platforms --- .kitchen.docker.yml | 16 +++++++++++++++- .kitchen.yml | 12 ++++++++---- .rubocop.yml | 10 ++++++---- .travis.yml | 8 +++++--- Berksfile | 1 + Rakefile | 22 ++-------------------- 6 files changed, 37 insertions(+), 32 deletions(-) diff --git a/.kitchen.docker.yml b/.kitchen.docker.yml index 8472ac7..098ead2 100644 --- a/.kitchen.docker.yml +++ b/.kitchen.docker.yml @@ -7,7 +7,21 @@ driver: privileged: true platforms: -- name: centos-7.1 +- name: centos-5 + driver: + image: centos:5 + platform: rhel + run_command: /sbin/init + provision_command: + - /usr/bin/yum install -y initscripts net-tools wget +- name: centos-6 + driver: + image: centos:6 + platform: rhel + run_command: /sbin/init + provision_command: + - /usr/bin/yum install -y initscripts net-tools wget +- name: centos-7 driver: image: centos:7 platform: rhel diff --git a/.kitchen.yml b/.kitchen.yml index 8515980..1d59321 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -5,13 +5,17 @@ provisioner: name: chef_zero platforms: + - name: centos-5.11 - name: centos-6.7 - - name: centos-7.1 - - name: debian-7.8 + - name: centos-7.2 + - name: debian-7.9 run_list: apt::default - - name: debian-8.1 + - name: debian-8.2 run_list: apt::default - - name: fedora-21 + - name: fedora-22 + run_list: yum::dnf_yum_compat + - name: fedora-23 + run_list: yum::dnf_yum_compat - name: ubuntu-12.04 run_list: apt::default - name: ubuntu-14.04 diff --git a/.rubocop.yml b/.rubocop.yml index 1ed1a76..7b24da2 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -16,17 +16,19 @@ Encoding: Enabled: false Style/FileName: Enabled: false +Style/Alias: + Enabled: false +Style/SpaceBeforeFirstArg: + Enabled: false LineLength: Enabled: false MethodLength: Enabled: false Metrics/AbcSize: Enabled: false -PerceivedComplexity: +Metrics/ModuleLength: Enabled: false -SingleSpaceBeforeFirstArg: +PerceivedComplexity: Enabled: false Style/ClassAndModuleChildren: Enabled: false -Style/FileName: - Enabled: false diff --git a/.travis.yml b/.travis.yml index 5170fd3..6469315 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,9 +12,11 @@ services: docker env: matrix: - - INSTANCE=default-ubuntu-1404 - INSTANCE=default-ubuntu-1204 - - INSTANCE=default-centos-71 + - INSTANCE=default-ubuntu-1404 + - INSTANCE=default-centos-5 + - INSTANCE=default-centos-6 + - INSTANCE=default-centos-7 # Don't `bundle install` install: echo "skip bundle install" @@ -30,6 +32,6 @@ script: - /opt/chefdk/embedded/bin/rubocop --version - /opt/chefdk/embedded/bin/rubocop - /opt/chefdk/embedded/bin/foodcritic --version - - /opt/chefdk/embedded/bin/foodcritic . --exclude spec + - /opt/chefdk/embedded/bin/foodcritic . --exclude spec -f any - /opt/chefdk/embedded/bin/rspec - KITCHEN_LOCAL_YAML=.kitchen.docker.yml /opt/chefdk/embedded/bin/kitchen verify ${INSTANCE} diff --git a/Berksfile b/Berksfile index 420871f..67c4024 100644 --- a/Berksfile +++ b/Berksfile @@ -3,6 +3,7 @@ source 'https://supermarket.chef.io' metadata group :integration do + cookbook 'yum' cookbook 'apt' cookbook 'fake', path: 'test/fixtures/cookbooks/fake' cookbook 'wrapper', path: 'test/fixtures/cookbooks/wrapper' diff --git a/Rakefile b/Rakefile index 3c52bbb..e3ef8ea 100644 --- a/Rakefile +++ b/Rakefile @@ -13,8 +13,7 @@ namespace :style do desc 'Run Chef style checks' FoodCritic::Rake::LintTask.new(:chef) do |t| t.options = { - fail_tags: ['any'], - tags: ['~FC005'] + fail_tags: ['any'] } end end @@ -35,27 +34,10 @@ namespace :integration do instance.test(:always) end end - - desc 'Run Test Kitchen with cloud plugins' - task :cloud do - run_kitchen = true - if ENV['TRAVIS'] == 'true' && ENV['TRAVIS_PULL_REQUEST'] != 'false' - run_kitchen = false - end - - if run_kitchen - Kitchen.logger = Kitchen.default_file_logger - @loader = Kitchen::Loader::YAML.new(project_config: './.kitchen.cloud.yml') - config = Kitchen::Config.new(loader: @loader) - config.instances.each do |instance| - instance.test(:always) - end - end - end end desc 'Run all tests on Travis' task travis: ['style', 'spec', 'integration:cloud'] # Default -task default: ['style', 'spec', 'integration:vagrant'] +task default: %w(style spec)