Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

WIP: Add additional resources #405

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
4d40518
Use chef standard .gitignore file
tas50 Apr 6, 2016
b15b2f5
Add long_description to the metadata
tas50 Apr 6, 2016
9b69715
Add a chefignore file
tas50 Apr 6, 2016
2e6f866
Exclude ExtraSpacing rule which tries to fix 1 of many extra spaces
tas50 Apr 6, 2016
1db3c5d
Don't pin versions of cookbooks used for integration tests
tas50 Apr 6, 2016
ae4c752
Expand the platforms in test kitchen
tas50 Apr 6, 2016
f9cb9b8
Add a kitchen.docker file
tas50 Apr 6, 2016
bf2df93
Test via kitchen-docker in Travis
tas50 Apr 6, 2016
351d803
Remove backwards compat around use_inline_resources
tas50 Apr 6, 2016
e927d93
Add nginx_install custom resource
tas50 Apr 6, 2016
3455328
Use standard Chef rubocop file
tas50 Apr 6, 2016
7d8d45e
Remove apt from Berks / test recipe
tas50 Apr 6, 2016
980ac93
Add .foodcritic file to workaround FC016 false positives
tas50 Apr 6, 2016
c8f7124
Remove the old repo test recipe
tas50 Apr 6, 2016
d9cb709
Use the install resource in all the test recipes
tas50 Apr 6, 2016
8e3b6fe
Install coveralls
tas50 Apr 6, 2016
3059e41
Move templates out of the default dir
tas50 Apr 6, 2016
78bad37
Remove specs that don't apply now
tas50 Apr 6, 2016
ac502c0
Switch to kitchen dokken
tas50 Aug 2, 2016
a2f3f9a
Install the latest test kitchen in Circle CI
tas50 Aug 2, 2016
cc7a8df
Update travis to use the Rake task, cookstyle, and trusty
tas50 Aug 2, 2016
830f1f8
Include test deps in a Gemfile
tas50 Aug 2, 2016
302090f
Update the rakefile
tas50 Aug 2, 2016
dffe16b
Remove the rubocop file
tas50 Aug 2, 2016
333d645
Update platforms to test on locally
tas50 Aug 2, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .foodcritic
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
~FC016
62 changes: 44 additions & 18 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,22 +1,48 @@
.*.sw[a-z]
*.rbc
.config
coverage
InstalledFiles
lib/bundler/man
pkg
rdoc
spec/reports
test/tmp
test/version_tmp
tmp
_Store
*~
*#
.#*
\#*#
.*.sw[a-z]
*.un~
*.tmp
*.bk
*.bkup

# ruby/bundler files
.ruby-version
.ruby-gemset
.rvmrc
Gemfile.lock
.bundle
.cache
.coverage
.env
.envrc
*.gem

# YARD artifacts
.yardoc
_yardoc
doc/
.idea

#chef stuff
Berksfile.lock
.kitchen
.kitchen.local.yml
vendor/
.coverage/
.zero-knife.rb

#vagrant stuff
.vagrant/
.vagrant.d/
.kitchen/
.ruby-gemset
.ruby-version
.vagrant
.yardoc/
*.un~
*#
*~
\#*#
Berksfile.lock
bin
coverage/
doc/
Gemfile.lock
124 changes: 106 additions & 18 deletions .kitchen.docker.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,109 @@
driver:
name: docker
use_sudo: false
name: dokken
chef_version: latest
privileged: true # because Docker and SystemD/Upstart

transport:
name: dokken

provisioner:
name: dokken

verifier:
name: inspec

platforms:
# - name: debian-7

<% %w(12.04 14.04).each do |ubver| %>
- name: ubuntu-<%= ubver %>
driver:
platform: ubuntu
# Testing starting/stopping services inside a container needs an init
image: ubuntu-upstart:<%= ubver %>
disable_upstart: false
run_command: /sbin/init
<% end %>

# @todo figure out how to run service via systemd
# - name: ubuntu-15.04
# driver:
# run_command: /lib/systemd/systemd
- 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
pid_one_command: /sbin/init
intermediate_instructions:
- RUN yum -y install which initscripts

- name: centos-7
driver:
image: centos:7
platform: rhel
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
pid_one_command: /sbin/init
intermediate_instructions:
- RUN /usr/bin/apt-get update

- name: ubuntu-14.04
driver:
image: ubuntu-upstart:14.04
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: example
run_list:
- recipe[nginx::example]

- name: service_single
run_list:
- recipe[nginx_service_test::single]

- name: service_multi
run_list:
- recipe[nginx_service_test::multi]
30 changes: 19 additions & 11 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,27 @@ driver:
provisioner:
name: chef_zero

verifier:
name: inspec

platforms:
- name: debian-7
- name: centos-5.11
- name: centos-6.8
- name: centos-7.2
- name: debian-7.11
run_list: apt::default
- name: debian-8.5
run_list: apt::default
- name: fedora-24
run_list: yum::dnf_yum_compat
- name: opensuse-13.2
- name: opensuse-42.1
- name: ubuntu-12.04
run_list: apt::default
- name: ubuntu-14.04
# - name: ubuntu-15.04
# - name: centos-5.11
# - name: centos-6.6
# - name: centos-7
run_list: apt::default
- name: ubuntu-16.04
run_list: apt::default

suites:
- name: example
Expand All @@ -24,9 +37,4 @@ suites:

- name: service_multi
run_list:
- recipe[nginx_service_test::multi]

- name: service_single_upstream
run_list:
- recipe[nginx_service_test::nginx_repo]
- recipe[nginx_service_test::single]
- recipe[nginx_service_test::multi]
10 changes: 0 additions & 10 deletions .rubocop.yml

This file was deleted.

35 changes: 23 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,39 @@
sudo: false
sudo: required
dist: trusty

# install the pre-release chef-dk. Use chef-stable-precise to install the stable release
addons:
apt:
sources:
- chef-stable-precise
- chef-current-trusty
packages:
- chefdk

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

env:
matrix:
- INSTANCE=example-ubuntu-1204
- INSTANCE=example-ubuntu-1404
- INSTANCE=example-ubuntu-1604
- INSTANCE=example-centos-6
- INSTANCE=example-centos-7

fast_finish: true

# Ensure we make ChefDK's Ruby the default
before_script:
- sudo iptables -L DOCKER || ( echo "DOCKER iptables chain missing" ; sudo iptables -N DOCKER )
- eval "$(/opt/chefdk/bin/chef shell-init bash)"
# update foodcritic version to prevent false-postiive detection
# https://github.com/acrmp/foodcritic/pull/423
# TODO: Remove when 6.0.1 is included in ChefDK stable
- chef gem install foodcritic -v '6.0.1'
- chef gem install coveralls -v '~> 0.8.13'

- /opt/chefdk/embedded/bin/chef gem install coveralls
script:
- chef --version
- gem query -d chefspec rubocop foodcritic rake
- rake
- /opt/chefdk/embedded/bin/chef --version
- /opt/chefdk/embedded/bin/cookstyle --version
- /opt/chefdk/embedded/bin/foodcritic --version
- /opt/chefdk/bin/chef exec rake
- KITCHEN_LOCAL_YAML=.kitchen.docker.yml /opt/chefdk/embedded/bin/kitchen verify ${INSTANCE}

notifications:
webhooks:
Expand Down
2 changes: 0 additions & 2 deletions Berksfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ source 'https://supermarket.chef.io'
metadata

group :integration do
cookbook 'apt', '~> 2.6.1'

cookbook 'nginx_service_test', path: 'test/fixtures/cookbooks/nginx_service_test'

# Or include an entire directory, once we have more test cookbooks:
Expand Down
13 changes: 13 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
source 'https://rubygems.org'

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