aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/PULL_REQUEST_TEMPLATE.md10
-rw-r--r--.msync.yml2
-rw-r--r--.travis.yml10
-rw-r--r--.travis/setup.sh12
-rw-r--r--Gemfile16
-rw-r--r--Rakefile19
-rw-r--r--metadata.json2
-rw-r--r--spec/default_facts.yml13
-rw-r--r--spec/spec_helper.rb14
9 files changed, 55 insertions, 43 deletions
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index ef25cdb..342807b 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -8,13 +8,13 @@ Thank you for contributing to this project!
-->
#### Pull Request (PR) description
<!--
- Replace this comment with a description of your pull request.
+Replace this comment with a description of your pull request.
-->
#### This Pull Request (PR) fixes the following issues
<!--
- Replace this comment with the list of issues or n/a.
- Use format:
- Fixes #123
- Fixes #124
+Replace this comment with the list of issues or n/a.
+Use format:
+Fixes #123
+Fixes #124
-->
diff --git a/.msync.yml b/.msync.yml
index fa528f5..4c6463a 100644
--- a/.msync.yml
+++ b/.msync.yml
@@ -1 +1 @@
-modulesync_config_version: '2.4.0'
+modulesync_config_version: '2.5.1'
diff --git a/.travis.yml b/.travis.yml
index 3968ef0..77f89e5 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,25 +1,21 @@
---
-sudo: false
dist: xenial
language: ruby
cache: bundler
before_install:
- - rm -f Gemfile.lock
+ - sh ./.travis/setup.sh
script:
- 'bundle exec rake $CHECK'
matrix:
fast_finish: true
include:
- - rvm: 2.1.9
- bundler_args: --without system_tests development release
- env: PUPPET_VERSION="~> 4.0" CHECK=test PARALLEL_TEST_PROCESSORS=12
- rvm: 2.4.4
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=test
- - rvm: 2.5.1
+ - rvm: 2.5.3
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 6.0" CHECK=test_with_coveralls
- - rvm: 2.5.1
+ - rvm: 2.5.3
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 6.0" CHECK=rubocop
- rvm: 2.4.4
diff --git a/.travis/setup.sh b/.travis/setup.sh
new file mode 100644
index 0000000..ae1a043
--- /dev/null
+++ b/.travis/setup.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# THIS FILE IS MANAGED BY MODULESYNC
+
+rm -f Gemfile.lock
+if [ "${PUPPET_VERSION}" = '~> 4.0' ]; then
+ gem install bundler -v '< 2' --no-rdoc --no-ri;
+else
+ gem update --system;
+ gem update bundler;
+ bundle --version;
+fi
diff --git a/Gemfile b/Gemfile
index 9648d7d..9524f1a 100644
--- a/Gemfile
+++ b/Gemfile
@@ -22,14 +22,12 @@ group :test do
gem 'puppet-lint-variable_contains_upcase', :require => false
gem 'metadata-json-lint', :require => false
gem 'redcarpet', :require => false
- gem 'rubocop', '~> 0.49.1', :require => false if RUBY_VERSION >= '2.3.0'
- gem 'rubocop-rspec', '~> 1.15.0', :require => false if RUBY_VERSION >= '2.3.0'
+ gem 'rubocop', '~> 0.49.1', :require => false
+ gem 'rubocop-rspec', '~> 1.15.0', :require => false
gem 'mocha', '~> 1.4.0', :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', '2.24.0', :require => false if RUBY_VERSION < '2.2.0'
- gem 'parallel_tests', :require => false if RUBY_VERSION >= '2.2.0'
+ gem 'parallel_tests', :require => false
end
group :development do
@@ -57,13 +55,13 @@ group :system_tests do
gem 'beaker-puppet', :require => false
gem 'beaker-puppet_install_helper', :require => false
gem 'beaker-module_install_helper', :require => false
- gem 'rbnacl', '>= 4', :require => false if RUBY_VERSION >= '2.2.6'
- gem 'rbnacl-libsodium', :require => false if RUBY_VERSION >= '2.2.6'
+ gem 'rbnacl', '>= 4', :require => false
+ gem 'rbnacl-libsodium', :require => false
gem 'bcrypt_pbkdf', :require => false
end
group :release do
- gem 'github_changelog_generator', :require => false, :git => 'https://github.com/github-changelog-generator/github-changelog-generator' if RUBY_VERSION >= '2.2.2'
+ gem 'github_changelog_generator', :require => false, :git => 'https://github.com/github-changelog-generator/github-changelog-generator'
gem 'puppet-blacksmith', :require => false
gem 'voxpupuli-release', :require => false, :git => 'https://github.com/voxpupuli/voxpupuli-release-gem'
gem 'puppet-strings', '>= 1.0', :require => false
@@ -77,7 +75,7 @@ else
gem 'facter', :require => false, :groups => [:test]
end
-ENV['PUPPET_VERSION'].nil? ? puppetversion = '~> 5.0' : puppetversion = ENV['PUPPET_VERSION'].to_s
+ENV['PUPPET_VERSION'].nil? ? puppetversion = '~> 6.0' : puppetversion = ENV['PUPPET_VERSION'].to_s
gem 'puppet', puppetversion, :require => false, :groups => [:test]
# vim: syntax=ruby
diff --git a/Rakefile b/Rakefile
index 279580a..13ef17c 100644
--- a/Rakefile
+++ b/Rakefile
@@ -37,12 +37,27 @@ RSpec::Core::RakeTask.new(:acceptance) do |t|
t.pattern = 'spec/acceptance'
end
-desc 'Run tests metadata_lint, release_checks'
+desc 'Run tests release_checks'
task test: [
- :metadata_lint,
:release_checks,
]
+namespace :check do
+ desc 'Check for trailing whitespace'
+ task :trailing_whitespace do
+ Dir.glob('**/*.md', File::FNM_DOTMATCH).sort.each do |filename|
+ next if filename =~ %r{^((modules|acceptance|\.?vendor|spec/fixtures|pkg)/|REFERENCE.md)}
+ File.foreach(filename).each_with_index do |line, index|
+ if line =~ %r{\s\n$}
+ puts "#{filename} has trailing whitespace on line #{index + 1}"
+ exit 1
+ end
+ end
+ end
+ end
+end
+Rake::Task[:release_checks].enhance ['check:trailing_whitespace']
+
desc "Run main 'test' task and report merged results to coveralls"
task test_with_coveralls: [:test] do
if Dir.exist?(File.expand_path('../lib', __FILE__))
diff --git a/metadata.json b/metadata.json
index c9f1c00..be03e0a 100644
--- a/metadata.json
+++ b/metadata.json
@@ -68,7 +68,7 @@
"requirements": [
{
"name": "puppet",
- "version_requirement": ">= 4.10.0 < 7.0.0"
+ "version_requirement": ">= 5.5.8 < 7.0.0"
}
]
}
diff --git a/spec/default_facts.yml b/spec/default_facts.yml
deleted file mode 100644
index 2f6698d..0000000
--- a/spec/default_facts.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-# This file is managed via modulesync
-# https://github.com/voxpupuli/modulesync
-# https://github.com/voxpupuli/modulesync_config
-#
-# use default_module_facts.yaml for module specific
-# facts.
-#
-# Hint if using with rspec-puppet-facts ("on_supported_os.each"):
-# if a same named fact exists in facterdb it will be overridden.
----
-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 88bca59..2f2279d 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -5,6 +5,15 @@ require 'puppetlabs_spec_helper/module_spec_helper'
require 'rspec-puppet-facts'
include RspecPuppetFacts
+if File.exist?(File.join(__dir__, 'default_module_facts.yml'))
+ facts = YAML.load(File.read(File.join(__dir__, 'default_module_facts.yml')))
+ if facts
+ facts.each do |name, value|
+ add_custom_fact name.to_sym, value
+ end
+ end
+end
+
if Dir.exist?(File.expand_path('../../lib', __FILE__))
require 'coveralls'
require 'simplecov'
@@ -22,11 +31,6 @@ if Dir.exist?(File.expand_path('../../lib', __FILE__))
end
RSpec.configure do |c|
- 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
-
# Coverage generation
c.after(:suite) do
RSpec::Puppet::Coverage.report!