aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.editorconfig14
-rw-r--r--.github/CONTRIBUTING.md15
-rw-r--r--.msync.yml2
-rw-r--r--.pmtignore1
-rw-r--r--Dockerfile21
-rw-r--r--Gemfile9
-rw-r--r--spec/acceptance/nodesets/centos-511-x64.yml15
-rw-r--r--spec/acceptance/nodesets/centos-6-x64.yml15
-rw-r--r--spec/acceptance/nodesets/centos-66-x64-pe.yml17
-rw-r--r--spec/acceptance/nodesets/centos-7-x64.yml15
-rw-r--r--spec/acceptance/nodesets/debian-78-x64.yml15
-rw-r--r--spec/acceptance/nodesets/debian-82-x64.yml15
-rw-r--r--spec/acceptance/nodesets/fedora-25-x64.yml16
-rw-r--r--spec/acceptance/nodesets/fedora-26-x64.yml16
-rw-r--r--spec/acceptance/nodesets/fedora-27-x64.yml18
-rw-r--r--spec/acceptance/nodesets/ubuntu-server-1204-x64.yml15
-rw-r--r--spec/acceptance/nodesets/ubuntu-server-1404-x64.yml15
-rw-r--r--spec/acceptance/nodesets/ubuntu-server-1604-x64.yml15
-rw-r--r--spec/classes/coverage_spec.rb4
-rw-r--r--spec/default_facts.yml1
-rw-r--r--spec/spec_helper.rb19
21 files changed, 66 insertions, 207 deletions
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..d77700e
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,14 @@
+# 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
diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
index 832578e..4a51969 100644
--- a/.github/CONTRIBUTING.md
+++ b/.github/CONTRIBUTING.md
@@ -109,6 +109,21 @@ To run a specific spec test set the `SPEC` variable:
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
diff --git a/.msync.yml b/.msync.yml
index e1f48ca..648cf24 100644
--- a/.msync.yml
+++ b/.msync.yml
@@ -1 +1 @@
-modulesync_config_version: '2.1.0'
+modulesync_config_version: '2.3.1'
diff --git a/.pmtignore b/.pmtignore
index fb58957..4e6d54b 100644
--- a/.pmtignore
+++ b/.pmtignore
@@ -18,3 +18,4 @@ Puppetfile.lock
*.iml
.*.sw?
.yardoc/
+Dockerfile
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..27a33cf
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,21 @@
+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
diff --git a/Gemfile b/Gemfile
index dd1b03a..9648d7d 100644
--- a/Gemfile
+++ b/Gemfile
@@ -12,7 +12,7 @@ end
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
@@ -28,7 +28,8 @@ group :test do
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
@@ -43,7 +44,7 @@ group :system_tests 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)
@@ -51,7 +52,7 @@ group :system_tests do
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
diff --git a/spec/acceptance/nodesets/centos-511-x64.yml b/spec/acceptance/nodesets/centos-511-x64.yml
deleted file mode 100644
index 089d646..0000000
--- a/spec/acceptance/nodesets/centos-511-x64.yml
+++ /dev/null
@@ -1,15 +0,0 @@
----
-# 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
diff --git a/spec/acceptance/nodesets/centos-6-x64.yml b/spec/acceptance/nodesets/centos-6-x64.yml
deleted file mode 100644
index 16abc8f..0000000
--- a/spec/acceptance/nodesets/centos-6-x64.yml
+++ /dev/null
@@ -1,15 +0,0 @@
----
-# 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
diff --git a/spec/acceptance/nodesets/centos-66-x64-pe.yml b/spec/acceptance/nodesets/centos-66-x64-pe.yml
deleted file mode 100644
index 1e7aea6..0000000
--- a/spec/acceptance/nodesets/centos-66-x64-pe.yml
+++ /dev/null
@@ -1,17 +0,0 @@
----
-# 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
diff --git a/spec/acceptance/nodesets/centos-7-x64.yml b/spec/acceptance/nodesets/centos-7-x64.yml
deleted file mode 100644
index e05a3ae..0000000
--- a/spec/acceptance/nodesets/centos-7-x64.yml
+++ /dev/null
@@ -1,15 +0,0 @@
----
-# 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
diff --git a/spec/acceptance/nodesets/debian-78-x64.yml b/spec/acceptance/nodesets/debian-78-x64.yml
deleted file mode 100644
index 6ef6de8..0000000
--- a/spec/acceptance/nodesets/debian-78-x64.yml
+++ /dev/null
@@ -1,15 +0,0 @@
----
-# 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
diff --git a/spec/acceptance/nodesets/debian-82-x64.yml b/spec/acceptance/nodesets/debian-82-x64.yml
deleted file mode 100644
index 9897a8f..0000000
--- a/spec/acceptance/nodesets/debian-82-x64.yml
+++ /dev/null
@@ -1,15 +0,0 @@
----
-# 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
diff --git a/spec/acceptance/nodesets/fedora-25-x64.yml b/spec/acceptance/nodesets/fedora-25-x64.yml
deleted file mode 100644
index 54dd330..0000000
--- a/spec/acceptance/nodesets/fedora-25-x64.yml
+++ /dev/null
@@ -1,16 +0,0 @@
----
-# 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
diff --git a/spec/acceptance/nodesets/fedora-26-x64.yml b/spec/acceptance/nodesets/fedora-26-x64.yml
deleted file mode 100644
index 598822b..0000000
--- a/spec/acceptance/nodesets/fedora-26-x64.yml
+++ /dev/null
@@ -1,16 +0,0 @@
----
-# 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
diff --git a/spec/acceptance/nodesets/fedora-27-x64.yml b/spec/acceptance/nodesets/fedora-27-x64.yml
deleted file mode 100644
index c2b61eb..0000000
--- a/spec/acceptance/nodesets/fedora-27-x64.yml
+++ /dev/null
@@ -1,18 +0,0 @@
----
-# 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
diff --git a/spec/acceptance/nodesets/ubuntu-server-1204-x64.yml b/spec/acceptance/nodesets/ubuntu-server-1204-x64.yml
deleted file mode 100644
index 29102c5..0000000
--- a/spec/acceptance/nodesets/ubuntu-server-1204-x64.yml
+++ /dev/null
@@ -1,15 +0,0 @@
----
-# 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
diff --git a/spec/acceptance/nodesets/ubuntu-server-1404-x64.yml b/spec/acceptance/nodesets/ubuntu-server-1404-x64.yml
deleted file mode 100644
index 054e658..0000000
--- a/spec/acceptance/nodesets/ubuntu-server-1404-x64.yml
+++ /dev/null
@@ -1,15 +0,0 @@
----
-# 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
diff --git a/spec/acceptance/nodesets/ubuntu-server-1604-x64.yml b/spec/acceptance/nodesets/ubuntu-server-1604-x64.yml
deleted file mode 100644
index bc85e0e..0000000
--- a/spec/acceptance/nodesets/ubuntu-server-1604-x64.yml
+++ /dev/null
@@ -1,15 +0,0 @@
----
-# 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
diff --git a/spec/classes/coverage_spec.rb b/spec/classes/coverage_spec.rb
deleted file mode 100644
index de44654..0000000
--- a/spec/classes/coverage_spec.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-require 'rspec-puppet'
-
-at_exit { RSpec::Puppet::Coverage.report! }
-# vim: syntax=ruby
diff --git a/spec/default_facts.yml b/spec/default_facts.yml
index 13c4165..2f6698d 100644
--- a/spec/default_facts.yml
+++ b/spec/default_facts.yml
@@ -8,7 +8,6 @@
# 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"
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index ea74a52..88bca59 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,10 +1,9 @@
-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'
@@ -23,13 +22,13 @@ if Dir.exist?(File.expand_path('../../lib', __FILE__))
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