Commit dbe14ef1 authored by Christopher Huhn's avatar Christopher Huhn
Browse files

Upgrade test suite

parent 7d06492f
*~
Berksfile.lock
.kitchen
.kitchen/
---
stages:
- lint
- chefspec
- kitchen
rubocop:
stage: lint
script:
- rake rubocop
foodcritic:
stage: lint
script:
- rake foodcritic
chefspec:
stage: chefspec
script:
- rake chefspec
allow_failure: true
kitchen:
stage: kitchen
resource_group: $CI_JOB_NAME-$CI_PROJECT_NAME
script:
- kitchen test $SUITE-$PLATFORM
after_script:
# make sure failed runs are cleaned up too:
- kitchen destroy $SUITE-$PLATFORM
parallel:
matrix:
- PLATFORM:
# - jessie
- stretch
- buster
SUITE:
- $CI_PROJECT_NAME
.post:
script:
- kitchen destroy
......@@ -4,6 +4,10 @@ driver:
box_check_update: true
customize:
memory: 1024
# network:
# - ["forwarded_port", {guest: 80, host: 8977}]
# synced_folders:
# - ["test/data/%{instance_name}", "/tmp/data", "type: :rsync"]
provisioner:
require_chef_omnibus: false
......@@ -20,6 +24,13 @@ verifier:
ruby_bindir: /usr/bin
platforms:
- name: buster64
driver:
box: debian/buster64
provider: libvirt
provision: true
vagrantfiles:
- vagrant.rb
- name: stretch64
driver:
box: debian/stretch64
......
begin
require 'rubocop/rake_task'
RuboCop::RakeTask.new do |task|
task.options = ['--lint']
task.options = %w[--display-cop-names --display-style-guide --lint]
end
rescue LoadError
desc 'rubocop rake task not available'
......@@ -14,7 +14,12 @@ begin
require 'foodcritic'
FoodCritic::Rake::LintTask.new do |task|
task.options = {
:exclude_paths => ['example_config/**/*']
context: true,
exclude_paths: ['example_config/**/*'],
# FC069: no standard license
# FC071: no LICENSE file
# FC079: no OSI approved license
tags: %w[~FC069 ~FC071 ~FC078]
}
end
rescue LoadError
......@@ -28,7 +33,8 @@ 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'
task.rspec_opts = '--backtrace --color --format documentation '\
'--require spec_helper --default-path test/unit'
end
rescue LoadError
desc 'chefspec rake task not available'
......@@ -59,7 +65,8 @@ begin
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'
abort 'yard rake task is not available. '\
'Be sure to install yard and yard-chef'
end
end
......
*~
.git
.gitlab-ci.yml
.kitchen/*
.kitchen.yml
Berksfile
Berksfile.lock
Rakefile
test
vagrant.rb
require 'chefspec'
ChefSpec::Coverage.start!
## 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__)}/../../../")
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'
# config.role_path = '/var/roles'
# Specify the Chef log_level (default: :warn)
#config.log_level = :debug
# config.log_level = :debug
# Specify the path to a local JSON file with Ohai data (default: nil)
#config.path = 'ohai.json'
# config.path = 'ohai.json'
# Specify the operating platform to mock Ohai data from (default: nil)
config.platform = 'debian'
......
Vagrant.configure(2) do |config|
# install the Debian-provided Chef package
config.vm.provision "shell", inline: <<-SHELL
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install chef
config.vm.provision 'shell', inline: <<-SHELL
sudo apt-get -qq update
sudo DEBIAN_FRONTEND=noninteractive apt-get -qq -y install chef
sudo gem install chef-vault --version '< 4'
SHELL
# configure proxy if required:
if Vagrant.has_plugin?('vagrant-proxyconf')
config.proxy.http = 'http://proxy.gsi.de:3128/'
config.proxy.https = 'http://proxy.gsi.de:3128/'
config.proxy.no_proxy = 'localhost,127.0.0.1,.gsi.de'
end
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