--- /dev/null
+# editorconfig.org
+
+# MANAGED BY MODULESYNC
+
+root = true
+
+[*]
+charset = utf-8
+end_of_line = lf
+indent_size = 2
+tab_width = 2
+indent_style = space
+insert_final_newline = true
+trim_trailing_whitespace = true
bundle exec rake spec SPEC=spec/foo_spec.rb
```
+### Unit tests in docker
+
+Some people don't want to run the dependencies locally or don't want to install
+ruby. We ship a Dockerfile that enables you to run all unit tests and linting.
+You only need to run:
+
+```sh
+docker build .
+```
+
+Please ensure that a docker daemon is running and that your user has the
+permission to talk to it. You can specify a remote docker host by setting the
+`DOCKER_HOST` environment variable. it will copy the content of the module into
+the docker image. So it will not work if a Gemfile.lock exists.
+
## Integration tests
The unit tests just check the code runs, not that it does exactly what
-modulesync_config_version: '2.1.0'
+modulesync_config_version: '2.3.1'
*.iml
.*.sw?
.yardoc/
+Dockerfile
--- /dev/null
+FROM ruby:2.5.1
+
+WORKDIR /opt/puppet
+
+# https://github.com/puppetlabs/puppet/blob/06ad255754a38f22fb3a22c7c4f1e2ce453d01cb/lib/puppet/provider/service/runit.rb#L39
+RUN mkdir -p /etc/sv
+
+ARG PUPPET_VERSION="~> 6.0"
+ARG PARALLEL_TEST_PROCESSORS=4
+
+# Cache gems
+COPY Gemfile .
+RUN bundle install --without system_tests development release --path=${BUNDLE_PATH:-vendor/bundle}
+
+COPY . .
+
+RUN bundle install
+RUN bundle exec release_checks
+
+# Container should not saved
+RUN exit 1
group :test do
gem 'puppetlabs_spec_helper', '>= 2.11.0', :require => false
- gem 'rspec-puppet-facts', :require => false
+ gem 'rspec-puppet-facts', '>= 1.8.0', :require => false
gem 'rspec-puppet-utils', :require => false
gem 'puppet-lint-leading_zero-check', :require => false
gem 'puppet-lint-trailing_comma-check', :require => false
gem 'coveralls', :require => false
gem 'simplecov-console', :require => false
gem 'rack', '~> 1.0', :require => false if RUBY_VERSION < '2.2.2'
- gem 'parallel_tests', :require => false
+ gem 'parallel_tests', '2.24.0', :require => false if RUBY_VERSION < '2.2.0'
+ gem 'parallel_tests', :require => false if RUBY_VERSION >= '2.2.0'
end
group :development do
if beaker_version = ENV['BEAKER_VERSION']
gem 'beaker', *location_for(beaker_version)
else
- gem 'beaker', '>= 3.9.0', :require => false
+ gem 'beaker', '>= 4.2.0', :require => false
end
if beaker_rspec_version = ENV['BEAKER_RSPEC_VERSION']
gem 'beaker-rspec', *location_for(beaker_rspec_version)
gem 'beaker-rspec', :require => false
end
gem 'serverspec', :require => false
- gem 'beaker-hostgenerator', '>= 1.1.10', :require => false
+ gem 'beaker-hostgenerator', '>= 1.1.22', :require => false
gem 'beaker-docker', :require => false
gem 'beaker-puppet', :require => false
gem 'beaker-puppet_install_helper', :require => false
+++ /dev/null
----
-# This file is managed via modulesync
-# https://github.com/voxpupuli/modulesync
-# https://github.com/voxpupuli/modulesync_config
-HOSTS:
- centos-511-x64:
- roles:
- - master
- platform: el-5-x86_64
- box: puppetlabs/centos-5.11-64-nocm
- hypervisor: vagrant
-CONFIG:
- type: foss
-...
-# vim: syntax=yaml
+++ /dev/null
----
-# This file is managed via modulesync
-# https://github.com/voxpupuli/modulesync
-# https://github.com/voxpupuli/modulesync_config
-HOSTS:
- centos-6-x64:
- roles:
- - master
- platform: el-6-x86_64
- box: centos/6
- hypervisor: vagrant
-CONFIG:
- type: aio
-...
-# vim: syntax=yaml
+++ /dev/null
----
-# This file is managed via modulesync
-# https://github.com/voxpupuli/modulesync
-# https://github.com/voxpupuli/modulesync_config
-HOSTS:
- centos-66-x64:
- roles:
- - master
- - database
- - dashboard
- platform: el-6-x86_64
- box: puppetlabs/centos-6.6-64-puppet-enterprise
- hypervisor: vagrant
-CONFIG:
- type: pe
-...
-# vim: syntax=yaml
+++ /dev/null
----
-# This file is managed via modulesync
-# https://github.com/voxpupuli/modulesync
-# https://github.com/voxpupuli/modulesync_config
-HOSTS:
- centos-7-x64:
- roles:
- - master
- platform: el-7-x86_64
- box: centos/7
- hypervisor: vagrant
-CONFIG:
- type: aio
-...
-# vim: syntax=yaml
+++ /dev/null
----
-# This file is managed via modulesync
-# https://github.com/voxpupuli/modulesync
-# https://github.com/voxpupuli/modulesync_config
-HOSTS:
- debian-78-x64:
- roles:
- - master
- platform: debian-7-amd64
- box: puppetlabs/debian-7.8-64-nocm
- hypervisor: vagrant
-CONFIG:
- type: foss
-...
-# vim: syntax=yaml
+++ /dev/null
----
-# This file is managed via modulesync
-# https://github.com/voxpupuli/modulesync
-# https://github.com/voxpupuli/modulesync_config
-HOSTS:
- debian-82-x64:
- roles:
- - master
- platform: debian-8-amd64
- box: puppetlabs/debian-8.2-64-nocm
- hypervisor: vagrant
-CONFIG:
- type: foss
-...
-# vim: syntax=yaml
+++ /dev/null
----
-# This file is managed via modulesync
-# https://github.com/voxpupuli/modulesync
-# https://github.com/voxpupuli/modulesync_config
-#
-HOSTS:
- fedora-25-x64:
- roles:
- - master
- platform: fedora-25-x86_64
- box: fedora/25-cloud-base
- hypervisor: vagrant
-CONFIG:
- type: aio
-...
-# vim: syntax=yaml
+++ /dev/null
----
-# This file is managed via modulesync
-# https://github.com/voxpupuli/modulesync
-# https://github.com/voxpupuli/modulesync_config
-#
-HOSTS:
- fedora-26-x64:
- roles:
- - master
- platform: fedora-26-x86_64
- box: fedora/26-cloud-base
- hypervisor: vagrant
-CONFIG:
- type: aio
-...
-# vim: syntax=yaml
+++ /dev/null
----
-# This file is managed via modulesync
-# https://github.com/voxpupuli/modulesync
-# https://github.com/voxpupuli/modulesync_config
-#
-# platform is fedora 26 because there is no puppet-agent
-# for fedora 27 as of 2017-11-17
-HOSTS:
- fedora-27-x64:
- roles:
- - master
- platform: fedora-26-x86_64
- box: fedora/27-cloud-base
- hypervisor: vagrant
-CONFIG:
- type: aio
-...
-# vim: syntax=yaml
+++ /dev/null
----
-# This file is managed via modulesync
-# https://github.com/voxpupuli/modulesync
-# https://github.com/voxpupuli/modulesync_config
-HOSTS:
- ubuntu-server-1204-x64:
- roles:
- - master
- platform: ubuntu-12.04-amd64
- box: puppetlabs/ubuntu-12.04-64-nocm
- hypervisor: vagrant
-CONFIG:
- type: foss
-...
-# vim: syntax=yaml
+++ /dev/null
----
-# This file is managed via modulesync
-# https://github.com/voxpupuli/modulesync
-# https://github.com/voxpupuli/modulesync_config
-HOSTS:
- ubuntu-server-1404-x64:
- roles:
- - master
- platform: ubuntu-14.04-amd64
- box: puppetlabs/ubuntu-14.04-64-nocm
- hypervisor: vagrant
-CONFIG:
- type: foss
-...
-# vim: syntax=yaml
+++ /dev/null
----
-# This file is managed via modulesync
-# https://github.com/voxpupuli/modulesync
-# https://github.com/voxpupuli/modulesync_config
-HOSTS:
- ubuntu-server-1604-x64:
- roles:
- - master
- platform: ubuntu-16.04-amd64
- box: puppetlabs/ubuntu-16.04-64-nocm
- hypervisor: vagrant
-CONFIG:
- type: foss
-...
-# vim: syntax=yaml
+++ /dev/null
-require 'rspec-puppet'
-
-at_exit { RSpec::Puppet::Coverage.report! }
-# vim: syntax=ruby
# Hint if using with rspec-puppet-facts ("on_supported_os.each"):
# if a same named fact exists in facterdb it will be overridden.
---
-concat_basedir: "/tmp"
ipaddress: "172.16.254.254"
is_pe: false
macaddress: "AA:AA:AA:AA:AA:AA"
-require 'puppetlabs_spec_helper/module_spec_helper'
-require 'rspec-puppet-facts'
-include RspecPuppetFacts
-
# This file is managed via modulesync
# https://github.com/voxpupuli/modulesync
# https://github.com/voxpupuli/modulesync_config
+require 'puppetlabs_spec_helper/module_spec_helper'
+require 'rspec-puppet-facts'
+include RspecPuppetFacts
if Dir.exist?(File.expand_path('../../lib', __FILE__))
require 'coveralls'
end
RSpec.configure do |c|
- default_facts = {
- puppetversion: Puppet.version,
- facterversion: Facter.version
- }
+ default_facts = {}
default_facts.merge!(YAML.load(File.read(File.expand_path('../default_facts.yml', __FILE__)))) if File.exist?(File.expand_path('../default_facts.yml', __FILE__))
default_facts.merge!(YAML.load(File.read(File.expand_path('../default_module_facts.yml', __FILE__)))) if File.exist?(File.expand_path('../default_module_facts.yml', __FILE__))
c.default_facts = default_facts
-end
-# vim: syntax=ruby
+ # Coverage generation
+ c.after(:suite) do
+ RSpec::Puppet::Coverage.report!
+ end
+end