Skip to content

Commit

Permalink
Update testing framework
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Smith <[email protected]>
  • Loading branch information
tas50 committed Jul 17, 2016
1 parent 44450f4 commit 1feeb80
Show file tree
Hide file tree
Showing 12 changed files with 371 additions and 357 deletions.
10 changes: 6 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
*.gem
.zero-knife.rb
*.rbc
.bundle
.config
coverage
InstalledFiles
Expand All @@ -12,7 +9,6 @@ spec/reports
test/tmp
test/version_tmp
tmp
Gemfile.lock
_Store
*~
*#
Expand All @@ -23,9 +19,14 @@ _Store
*.tmp
*.bk
*.bkup

# ruby/bundler files
.ruby-version
.ruby-gemset
.rvmrc
Gemfile.lock
.bundle
*.gem

# YARD artifacts
.yardoc
Expand All @@ -39,6 +40,7 @@ Berksfile.lock
.kitchen.local.yml
vendor/
.coverage/
.zero-knife.rb

#vagrant stuff
.vagrant/
Expand Down
103 changes: 79 additions & 24 deletions .kitchen.docker.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,100 @@
settings:
parallel: true

driver:
name: docker
# privileged is required otherwise the container doesn't boot right
privileged: true
name: dokken
chef_version: latest
privileged: true # because Docker and SystemD/Upstart

transport:
name: dokken

provisioner:
name: dokken

verifier:
name: inspec
format: doc

platforms:
- name: debian-7
driver:
image: debian:7
pid_one_command: /sbin/init
intermediate_instructions:
- RUN /usr/bin/apt-get update
- RUN /usr/bin/apt-get install lsb-release -y

- name: debian-8
driver:
image: debian:8
pid_one_command: /bin/systemd
intermediate_instructions:
- RUN /usr/bin/apt-get update
- RUN /usr/bin/apt-get install lsb-release -y

- name: centos-5
driver:
image: centos:5
platform: rhel
pid_one_command: /sbin/init
intermediate_instructions:
- RUN yum install -y which initscripts

- name: centos-6
driver:
image: centos:6
platform: rhel
run_command: /sbin/init
provision_command:
- /usr/bin/yum install -y initscripts net-tools wget
pid_one_command: /sbin/init
intermediate_instructions:
- RUN yum -y install which initscripts

- name: centos-7
driver:
image: centos:7
platform: rhel
run_command: /usr/lib/systemd/systemd
provision_command:
- /bin/yum install -y initscripts net-tools wget
pid_one_command: /usr/lib/systemd/systemd
intermediate_instructions:
- RUN yum -y install lsof which systemd-sysv initscripts

- name: fedora-latest
driver:
image: fedora:latest
pid_one_command: /usr/lib/systemd/systemd
intermediate_instructions:
- RUN dnf -y install yum which systemd-sysv initscripts

- name: ubuntu-12.04
driver:
image: ubuntu-upstart:12.04
platform: ubuntu
disable_upstart: false
run_command: /sbin/init
provision_command:
- /usr/bin/apt-get update
- /usr/bin/apt-get install apt-transport-https net-tools -y
pid_one_command: /sbin/init
intermediate_instructions:
- RUN /usr/bin/apt-get update

- name: ubuntu-14.04
driver:
image: ubuntu-upstart:14.04
platform: ubuntu
disable_upstart: false
run_command: /sbin/init
provision_command:
- /usr/bin/apt-get update
- /usr/bin/apt-get install apt-transport-https net-tools -y
pid_one_command: /sbin/init
intermediate_instructions:
- RUN /usr/bin/apt-get update

- name: ubuntu-16.04
driver:
image: ubuntu:16.04
pid_one_command: /bin/systemd
intermediate_instructions:
- RUN /usr/bin/apt-get update

- name: opensuse-13.2
driver:
image: opensuse:13.2
pid_one_command: /bin/systemd
intermediate_instructions:
- RUN zypper --non-interactive install aaa_base perl-Getopt-Long-Descriptive

- name: opensuse-42.1
driver:
image: opensuse:42.1
pid_one_command: /bin/systemd
intermediate_instructions:
- RUN zypper --non-interactive install aaa_base perl-Getopt-Long-Descriptive
suites:
- name: server
run_list:
Expand Down
7 changes: 4 additions & 3 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ platforms:
run_list: apt::default
- name: debian-8.4
run_list: apt::default
- name: fedora-21
- name: fedora-22
- name: fedora-23
run_list: yum::dnf_yum_compat
- name: opensuse-13.2
- name: ubuntu-12.04
run_list: apt::default
- name: ubuntu-14.04
run_list: apt::default
- name: freebsd-10.1
- name: freebsd-10.3
run_list: freebsd::pkgng

suites:
Expand Down
39 changes: 8 additions & 31 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,10 @@
AllCops:
# cookstyle todo
#
Lint/AmbiguousRegexpLiteral:
Exclude:
- vendor/**/*
- Guardfile
- files/default/test/**/*
- Rakefile
- 'files/default/test/auth_test.rb'

AlignParameters:
Enabled: false
ClassLength:
Enabled: false
CyclomaticComplexity:
Enabled: false
Documentation:
Enabled: false
Encoding:
Enabled: false
Style/FileName:
Enabled: false
LineLength:
Enabled: false
MethodLength:
Enabled: false
Metrics/AbcSize:
Enabled: false
PerceivedComplexity:
Enabled: false
Style/SpaceBeforeFirstArg:
Enabled: false
Style/ClassAndModuleChildren:
Enabled: false
Style/FileName:
Enabled: false
# Configuration parameters: AllowedVariables.
Style/GlobalVars:
Exclude:
- 'Rakefile'
20 changes: 12 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ addons:
packages:
- chefdk

# Don't `bundle install` which takes about 1.5 mins
install: echo "skip bundle install"

branches:
only:
- master

services: docker

env:
Expand All @@ -18,20 +25,17 @@ env:
- INSTANCE=server-centos-6
- INSTANCE=server-centos-7

# Don't `bundle install`
install: echo "skip bundle install"
fast_finish: true

# Ensure we make ChefDK's Ruby the default
before_script:
# https://github.com/zuazo/kitchen-in-travis-native/issues/1#issuecomment-142230889
- sudo iptables -L DOCKER || ( echo "DOCKER iptables chain missing" ; sudo iptables -N DOCKER )
- eval "$(/opt/chefdk/bin/chef shell-init bash)"
- /opt/chefdk/embedded/bin/chef gem install kitchen-docker

script:
- /opt/chefdk/embedded/bin/chef --version
- /opt/chefdk/embedded/bin/rubocop --version
- /opt/chefdk/embedded/bin/rubocop
- /opt/chefdk/embedded/bin/cookstyle --version
- /opt/chefdk/embedded/bin/cookstyle
- /opt/chefdk/embedded/bin/foodcritic --version
- /opt/chefdk/embedded/bin/foodcritic . --exclude spec
- /opt/chefdk/embedded/bin/foodcritic . --exclude spec -f any -P
- /opt/chefdk/embedded/bin/rspec
- KITCHEN_LOCAL_YAML=.kitchen.docker.yml /opt/chefdk/embedded/bin/kitchen verify ${INSTANCE}
38 changes: 11 additions & 27 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,13 @@
source 'https://rubygems.org'

group :rake do
gem 'rake'
gem 'tomlrb'
end

group :lint do
gem 'foodcritic', '~> 5.0'
gem 'rubocop', '~> 0.34'
end

group :unit do
gem 'berkshelf', '~> 4.0'
gem 'chefspec', '~> 4.4'
end

group :kitchen_common do
gem 'test-kitchen', '~> 1.4'
end

group :kitchen_vagrant do
gem 'kitchen-vagrant', '~> 0.19'
end

group :kitchen_cloud do
gem 'kitchen-digitalocean'
gem 'kitchen-ec2'
end
gem 'berkshelf', '>= 4.3'
gem 'chefspec', '~> 4.6'
gem 'cookstyle'
gem 'foodcritic', '~> 7.0'
gem 'kitchen-dokken'
gem 'kitchen-inspec', '>= 0.14'
gem 'kitchen-vagrant', '>= 0.20'
gem 'rake'
gem 'stove'
gem 'test-kitchen', '>= 1.10'
gem 'tomlrb'
Loading

0 comments on commit 1feeb80

Please sign in to comment.