Commit 8bf4d145 authored by Christopher Huhn's avatar Christopher Huhn
Browse files

Add testsuite

parent 4bf43491
---
driver:
name: vagrant
box_check_update: true
# network:
# - ["forwarded_port", {guest: 80, host: 8977}]
# synced_folders:
# - ["data/%{instance_name}", "/tmp/data", "type: :rsync"]
provisioner:
require_chef_omnibus: false
install_strategy: skip
log_level: warn
#name: chef-solo
#chef_solo_path: /usr/bin/chef-solo
name: chef_zero
chef_client_path: /usr/bin/chef-client
data_bags_path: test/integration/data_bags
verifier:
name: busser
ruby_bindir: /usr/bin
platforms:
- name: buster64
driver:
box: debian/buster64
provider: libvirt
provision: true
vagrantfiles:
- vagrant.rb
- name: stretch64
driver:
box: debian/stretch64
provider: libvirt
provision: true
vagrantfiles:
- vagrant.rb
suites:
- name: debmirror
run_list:
- recipe[debmirror]
attributes:
# -*- ruby -*-
source 'https://supermarket.chef.io'
metadata
# cookbook 'cernvm-fs', git: 'git@git.gsi.de:chef/cookbooks/cernvm-fs.git'
# cookbook 'gsi_cvmfs', git: 'git@git.gsi.de:chef/cookbooks/gsi_cvmfs.git'
# cookbook 'gsi-sys', git: 'git@git.gsi.de:chef/cookbooks/gsi-sys.git'
# cookbook 'gsi-webserver',
# git: 'git@git.gsi.de:chef/cookbooks/gsi-webserver.git'
# cookbook 'sys', git: 'https://git.gsi.de/chef/cookbooks/sys.git'
begin
require 'rubocop/rake_task'
RuboCop::RakeTask.new do |task|
task.options = %w[--display-cop-names --display-style-guide] # --lint
end
rescue LoadError
desc 'rubocop rake task not available'
task :rubocop do
abort 'Rubocop rake task is not available. Be sure to install rubocop'
end
end
begin
require 'foodcritic'
FoodCritic::Rake::LintTask.new do |task|
task.options = {
exclude_paths: ['example_config/**/*']
}
end
rescue LoadError
desc 'foodcritic rake task not available'
task :foodcritic do
abort 'Foodcritic rake task is not available. Be sure to install foodcritic'
end
end
begin
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:chefspec) do |task|
task.pattern = 'test/unit/**/*_spec.rb'
task.rspec_opts = '--backtrace --color --format documentation '\
'--require spec_helper --default-path test/unit'
end
rescue LoadError
desc 'chefspec rake task not available'
task :chefspec do
abort 'Chefspec rake task is not available. Be sure to install chefspec'
end
end
begin
require 'kitchen/rake_tasks'
Kitchen::RakeTasks.new do
Kitchen.logger = Kitchen.default_logger
end
rescue LoadError
desc 'kitchen rake task not available'
task :kitchen do
abort 'kitchen rake task is not available. Be sure to install test-kitchen'
end
end
begin
require 'yard'
YARD::Config.load_plugin 'chef'
YARD::Rake::YardocTask.new do |t|
t.files = ['**/*.rb']
t.options = ['--debug']
end
rescue LoadError
desc 'yard rake task not available'
task :yard do
abort 'yard rake task is not available. '\
'Be sure to install yard and yard-chef'
end
end
task default: %w[rubocop foodcritic chefspec kitchen:all]
source 'http://rubygems.org'
group :jessie do
# net-ssh >= 5 requires ruby 2.2
if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.2.0')
gem 'net-ssh', '< 5'
end
end
require 'serverspec'
set :backend, :exec
require 'chefspec'
## deprecated:
# ChefSpec::Coverage.start!
RSpec.configure do |config|
# Specify the path for Chef Solo to find cookbooks (default: [inferred from
# the location of the calling spec file])
config.cookbook_path =
File.expand_path("#{File.dirname(__FILE__)}/../../../")
# Specify the path for Chef Solo to find roles (default: [ascending search])
# config.role_path = '/var/roles'
# Specify the Chef log_level (default: :warn)
# config.log_level = :debug
# Specify the path to a local JSON file with Ohai data (default: nil)
# config.path = 'ohai.json'
# Specify the operating platform to mock Ohai data from (default: nil)
config.platform = 'debian'
# Specify the operating version to mock Ohai data from (default: nil)
config.version = '9.2'
end
Vagrant.configure(2) do |config|
# install the Debian-provided Chef package
config.vm.provision 'shell', inline: <<-SHELL
sudo apt-get -qq update
sudo DEBIAN_FRONTEND=noninteractive apt-get -q -y install chef
SHELL
end
Supports Markdown
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