Unverified Commit 8ffc9dcc authored by Tim Smith's avatar Tim Smith
Browse files

Testing updates


Signed-off-by: default avatarTim Smith <tsmith@chef.io>
parent 6541caa6
......@@ -34,15 +34,16 @@ _yardoc
doc/
.idea
#chef stuff
# chef stuff
Berksfile.lock
.kitchen
.kitchen.local.yml
vendor/
.coverage/
.zero-knife.rb
Policyfile.lock.json
#vagrant stuff
# vagrant stuff
.vagrant/
.vagrant.d/
.kitchen/
---
driver:
name: dokken
chef_version: latest
......@@ -18,10 +17,10 @@ platforms:
- name: debian-7
driver:
image: debian:7
run_command: /sbin/init
pid_one_command: /sbin/init
intermediate_instructions:
- RUN /usr/bin/apt-get update
- RUN /usr/bin/apt-get install apt-transport-https net-tools -y
- RUN /usr/bin/apt-get install lsb-release procps -y
- name: debian-8
driver:
......@@ -29,38 +28,38 @@ platforms:
pid_one_command: /bin/systemd
intermediate_instructions:
- RUN /usr/bin/apt-get update
- RUN /usr/bin/apt-get install apt-transport-https net-tools -y
- RUN /usr/bin/apt-get install lsb-release -y
- name: centos-5
driver:
image: centos:5
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 install -y which initscripts
- name: centos-6
driver:
image: centos:6
platform: rhel
pid_one_command: /sbin/init
intermediate_instructions:
- RUN yum -y install tar which initscripts
- RUN yum -y install which initscripts
- name: centos-7
driver:
image: centos:7
intermediate_instructions:
- RUN yum clean all
- RUN yum -y install net-tools lsof
platform: rhel
pid_one_command: /usr/lib/systemd/systemd
intermediate_instructions:
- RUN yum -y install lsof which systemd-sysv initscripts
- name: fedora-23
- name: fedora-latest
driver:
image: fedora:23
intermediate_instructions:
- RUN yum clean all
image: fedora:latest
pid_one_command: /usr/lib/systemd/systemd
intermediate_instructions:
- RUN yum -y install tar yum
- RUN dnf -y install yum which systemd-sysv initscripts
- name: ubuntu-12.04
driver:
......@@ -68,7 +67,6 @@ platforms:
pid_one_command: /sbin/init
intermediate_instructions:
- RUN /usr/bin/apt-get update
- RUN /usr/bin/apt-get install apt-transport-https net-tools -y
- name: ubuntu-14.04
driver:
......@@ -76,7 +74,6 @@ platforms:
pid_one_command: /sbin/init
intermediate_instructions:
- RUN /usr/bin/apt-get update
- RUN /usr/bin/apt-get install apt-transport-https net-tools -y
- name: ubuntu-16.04
driver:
......@@ -84,8 +81,20 @@ platforms:
pid_one_command: /bin/systemd
intermediate_instructions:
- RUN /usr/bin/apt-get update
- RUN /usr/bin/apt-get install apt-transport-https net-tools -y
- 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 which net-tools
- 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 which hostname
suites:
- name: default
run_list:
......
......@@ -8,14 +8,14 @@ platforms:
- name: centos-5.11
- name: centos-6.8
- name: centos-7.2
- name: debian-7.10
- name: debian-7.11
run_list: apt::default
- name: debian-8.5
run_list: apt::default
- name: fedora-22
run_list: yum::dnf_yum_compat
- name: fedora-23
- name: fedora-24
run_list: yum::dnf_yum_compat
- name: opensuse-13.2
- name: opensuse-leap-42.1
- name: ubuntu-12.04
run_list: apt::default
- name: ubuntu-14.04
......@@ -36,9 +36,9 @@ suites:
gui_tools: true
excludes:
- centos-5.11
- centos-6.7
- centos-7.1
- fedora-21
- centos-6.8
- centos-7.2
- fedora-24
- name: esl
run_list:
......
......@@ -5,10 +5,17 @@ dist: trusty
addons:
apt:
sources:
- chef-current-precise
- chef-current-trusty
packages:
- chefdk
# Don't `bundle install` which takes about 1.5 mins
install: echo "skip bundle install"
branches:
only:
- master
services: docker
env:
......@@ -20,31 +27,29 @@ env:
- INSTANCE=default-centos-5
- INSTANCE=default-centos-6
- INSTANCE=default-centos-7
- INSTANCE=default-fedora-23
- INSTANCE=default-fedora-latest
- INSTANCE=source-ubuntu-1204
- INSTANCE=source-ubuntu-1404
- INSTANCE=source-ubuntu-1604
- INSTANCE=source-debian-8
- INSTANCE=source-centos-5
- INSTANCE=source-centos-6
- INSTANCE=source-fedora-23
- INSTANCE=source-fedora-latest
- INSTANCE=source-centos-7
# Don't `bundle install`
install: echo "skip bundle install"
# 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-dokken
script:
- /opt/chefdk/embedded/bin/chef --version
- /opt/chefdk/embedded/bin/cookstyle --version
- /opt/chefdk/embedded/bin/cookstyle
- /opt/chefdk/embedded/bin/foodcritic --version
- /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}
script: KITCHEN_LOCAL_YAML=.kitchen.docker.yml /opt/chefdk/embedded/bin/kitchen verify ${INSTANCE}
matrix:
include:
- before_script:
- eval "$(/opt/chefdk/bin/chef shell-init bash)"
- /opt/chefdk/embedded/bin/chef --version
- /opt/chefdk/embedded/bin/cookstyle --version
- /opt/chefdk/embedded/bin/foodcritic --version
- script:
- /opt/chefdk/bin/chef exec rake
env: UNIT_AND_LINT=1
# 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 'tomlrb'
......
#!/usr/bin/env rake
require_relative 'tasks/maintainers'
# Style tests. cookstyle (rubocop) and Foodcritic
namespace :style do
begin
......@@ -47,8 +49,8 @@ namespace :integration do
desc 'Run kitchen integration tests'
Kitchen::RakeTasks.new
rescue LoadError => e
puts ">>> Gem load error: #{e}, omitting #{task.name}" unless ENV['CI']
rescue StandardError => e
puts ">>> Kitchen error: #{e}, omitting #{task.name}" unless ENV['CI']
end
end
......
......@@ -23,3 +23,5 @@ end
source_url 'https://github.com/chef-cookbooks/erlang' if respond_to?(:source_url)
issues_url 'https://github.com/chef-cookbooks/erlang/issues' if respond_to?(:issues_url)
chef_version '>= 11' if respond_to?(:chef_version)
......@@ -4,6 +4,5 @@ require 'chefspec/berkshelf'
RSpec.configure do |config|
config.color = true # Use color in STDOUT
config.formatter = :documentation # Use the specified formatter
config.log_level = :error # Avoid deprecation notice SPAM
end
at_exit { ChefSpec::Coverage.report! }
......@@ -29,7 +29,7 @@ describe 'erlang::package' do
context 'gui_tools is true' do
it 'installs erlang-x11 package' do
chef_run_debian.node.set['erlang']['gui_tools'] = true
chef_run_debian.node.normal['erlang']['gui_tools'] = true
gui_tools_run = chef_run_debian.converge('erlang::package')
expect(gui_tools_run).to install_package('erlang-x11')
end
......
#
# Copyright:: Copyright (c) 2015 Chef Software, Inc.
# Copyright:: Copyright (c) 2015-2016 Chef Software, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
......@@ -41,7 +41,7 @@ begin
end
rescue LoadError
STDERR.puts "\n*** TomlRb not available.\n\n"
STDERR.puts "\n*** TomlRb not available. Skipping the Maintainers Rake task\n\n"
end
private
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment