Skip to content
This repository was archived by the owner on May 5, 2023. It is now read-only.

Commit e3a7f1d

Browse files
authored
Merge pull request #168 from voxpupuli/modulesync
modulesync 2.7.0 and drop puppet 4
2 parents 1c76482 + 2749b9f commit e3a7f1d

File tree

15 files changed

+68
-86
lines changed

15 files changed

+68
-86
lines changed

.github/CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,19 @@ You can install all needed gems for spec tests into the modules directory by
5151
running:
5252

5353
```sh
54-
bundle install --path .vendor/ --without development --without system_tests --without release
54+
bundle install --path .vendor/ --without development system_tests release
5555
```
5656

5757
If you also want to run acceptance tests:
5858

5959
```sh
60-
bundle install --path .vendor/ --without development --with system_tests --without release
60+
bundle install --path .vendor/ --with system_tests --without development release
6161
```
6262

6363
Our all in one solution if you don't know if you need to install or update gems:
6464

6565
```sh
66-
bundle install --path .vendor/ --without development --with system_tests --without release; bundle update; bundle clean
66+
bundle install --path .vendor/ --with system_tests --without development release; bundle update; bundle clean
6767
```
6868

6969
## Syntax and style

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ Thank you for contributing to this project!
88
-->
99
#### Pull Request (PR) description
1010
<!--
11-
Replace this comment with a description of your pull request.
11+
Replace this comment with a description of your pull request.
1212
-->
1313

1414
#### This Pull Request (PR) fixes the following issues
1515
<!--
16-
Replace this comment with the list of issues or n/a.
17-
Use format:
18-
Fixes #123
19-
Fixes #124
16+
Replace this comment with the list of issues or n/a.
17+
Use format:
18+
Fixes #123
19+
Fixes #124
2020
-->

.msync.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
modulesync_config_version: '2.4.0'
1+
modulesync_config_version: '2.7.0'

.travis.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
11
---
2-
sudo: false
32
dist: xenial
43
language: ruby
54
cache: bundler
65
before_install:
7-
- rm -f Gemfile.lock
6+
- gem update --system
7+
- gem update bundler
8+
- bundle --version
89
script:
910
- 'bundle exec rake $CHECK'
1011
matrix:
1112
fast_finish: true
1213
include:
13-
- rvm: 2.1.9
14-
bundler_args: --without system_tests development release
15-
env: PUPPET_VERSION="~> 4.0" CHECK=test PARALLEL_TEST_PROCESSORS=12
1614
- rvm: 2.4.4
1715
bundler_args: --without system_tests development release
1816
env: PUPPET_VERSION="~> 5.0" CHECK=test
19-
- rvm: 2.5.1
17+
- rvm: 2.5.3
2018
bundler_args: --without system_tests development release
2119
env: PUPPET_VERSION="~> 6.0" CHECK=test_with_coveralls
22-
- rvm: 2.5.1
20+
- rvm: 2.5.3
2321
bundler_args: --without system_tests development release
2422
env: PUPPET_VERSION="~> 6.0" CHECK=rubocop
2523
- rvm: 2.4.4

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ruby:2.5.1
1+
FROM ruby:2.5.3
22

33
WORKDIR /opt/puppet
44

Gemfile

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def location_for(place, fake_version = nil)
1111
end
1212

1313
group :test do
14-
gem 'puppetlabs_spec_helper', '>= 2.11.0', :require => false
14+
gem 'puppetlabs_spec_helper', '>= 2.14.0', :require => false
1515
gem 'rspec-puppet-facts', '>= 1.8.0', :require => false
1616
gem 'rspec-puppet-utils', :require => false
1717
gem 'puppet-lint-leading_zero-check', :require => false
@@ -20,16 +20,15 @@ group :test do
2020
gem 'puppet-lint-classes_and_types_beginning_with_digits-check', :require => false
2121
gem 'puppet-lint-unquoted_string-check', :require => false
2222
gem 'puppet-lint-variable_contains_upcase', :require => false
23+
gem 'puppet-lint-absolute_classname-check', :require => false
2324
gem 'metadata-json-lint', :require => false
2425
gem 'redcarpet', :require => false
25-
gem 'rubocop', '~> 0.49.1', :require => false if RUBY_VERSION >= '2.3.0'
26-
gem 'rubocop-rspec', '~> 1.15.0', :require => false if RUBY_VERSION >= '2.3.0'
26+
gem 'rubocop', '~> 0.49.1', :require => false
27+
gem 'rubocop-rspec', '~> 1.15.0', :require => false
2728
gem 'mocha', '~> 1.4.0', :require => false
2829
gem 'coveralls', :require => false
2930
gem 'simplecov-console', :require => false
30-
gem 'rack', '~> 1.0', :require => false if RUBY_VERSION < '2.2.2'
31-
gem 'parallel_tests', '2.24.0', :require => false if RUBY_VERSION < '2.2.0'
32-
gem 'parallel_tests', :require => false if RUBY_VERSION >= '2.2.0'
31+
gem 'parallel_tests', :require => false
3332
end
3433

3534
group :development do
@@ -57,16 +56,16 @@ group :system_tests do
5756
gem 'beaker-puppet', :require => false
5857
gem 'beaker-puppet_install_helper', :require => false
5958
gem 'beaker-module_install_helper', :require => false
60-
gem 'rbnacl', '>= 4', :require => false if RUBY_VERSION >= '2.2.6'
61-
gem 'rbnacl-libsodium', :require => false if RUBY_VERSION >= '2.2.6'
59+
gem 'rbnacl', '>= 4', :require => false
60+
gem 'rbnacl-libsodium', :require => false
6261
gem 'bcrypt_pbkdf', :require => false
6362
end
6463

6564
group :release do
66-
gem 'github_changelog_generator', :require => false, :git => 'https://github.com/github-changelog-generator/github-changelog-generator' if RUBY_VERSION >= '2.2.2'
65+
gem 'github_changelog_generator', :require => false, :git => 'https://github.com/github-changelog-generator/github-changelog-generator'
6766
gem 'puppet-blacksmith', :require => false
6867
gem 'voxpupuli-release', :require => false, :git => 'https://github.com/voxpupuli/voxpupuli-release-gem'
69-
gem 'puppet-strings', '>= 1.0', :require => false
68+
gem 'puppet-strings', '>= 2.2', :require => false
7069
end
7170

7271

@@ -77,7 +76,7 @@ else
7776
gem 'facter', :require => false, :groups => [:test]
7877
end
7978

80-
ENV['PUPPET_VERSION'].nil? ? puppetversion = '~> 5.0' : puppetversion = ENV['PUPPET_VERSION'].to_s
79+
ENV['PUPPET_VERSION'].nil? ? puppetversion = '~> 6.0' : puppetversion = ENV['PUPPET_VERSION'].to_s
8180
gem 'puppet', puppetversion, :require => false, :groups => [:test]
8281

8382
# vim: syntax=ruby

Rakefile

Lines changed: 24 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,12 @@ require 'puppetlabs_spec_helper/rake_tasks'
33
# load optional tasks for releases
44
# only available if gem group releases is installed
55
begin
6-
require 'puppet_blacksmith/rake_tasks'
76
require 'voxpupuli/release/rake_tasks'
8-
require 'puppet-strings/tasks'
97
rescue LoadError
108
end
119

1210
PuppetLint.configuration.log_format = '%{path}:%{line}:%{check}:%{KIND}:%{message}'
13-
PuppetLint.configuration.fail_on_warnings = true
14-
PuppetLint.configuration.send('relative')
15-
PuppetLint.configuration.send('disable_140chars')
16-
PuppetLint.configuration.send('disable_class_inherits_from_params_class')
17-
PuppetLint.configuration.send('disable_documentation')
18-
PuppetLint.configuration.send('disable_single_quote_string_with_variables')
11+
PuppetLint.configuration.absolute_classname_reverse = true
1912

2013
exclude_paths = %w(
2114
pkg/**/*
@@ -28,20 +21,32 @@ PuppetSyntax.exclude_paths = exclude_paths
2821

2922
desc 'Auto-correct puppet-lint offenses'
3023
task 'lint:auto_correct' do
31-
PuppetLint.configuration.fix = true
32-
Rake::Task[:lint].invoke
24+
Rake::Task[:lint_fix].invoke
3325
end
3426

3527
desc 'Run acceptance tests'
3628
RSpec::Core::RakeTask.new(:acceptance) do |t|
3729
t.pattern = 'spec/acceptance'
3830
end
3931

40-
desc 'Run tests metadata_lint, release_checks'
41-
task test: [
42-
:metadata_lint,
43-
:release_checks,
44-
]
32+
desc 'Run tests'
33+
task test: [:release_checks]
34+
35+
namespace :check do
36+
desc 'Check for trailing whitespace'
37+
task :trailing_whitespace do
38+
Dir.glob('**/*.md', File::FNM_DOTMATCH).sort.each do |filename|
39+
next if filename =~ %r{^((modules|acceptance|\.?vendor|spec/fixtures|pkg)/|REFERENCE.md)}
40+
File.foreach(filename).each_with_index do |line, index|
41+
if line =~ %r{\s\n$}
42+
puts "#{filename} has trailing whitespace on line #{index + 1}"
43+
exit 1
44+
end
45+
end
46+
end
47+
end
48+
end
49+
Rake::Task[:release_checks].enhance ['check:trailing_whitespace']
4550

4651
desc "Run main 'test' task and report merged results to coveralls"
4752
task test_with_coveralls: [:test] do
@@ -54,25 +59,10 @@ task test_with_coveralls: [:test] do
5459
end
5560
end
5661

57-
desc "Print supported beaker sets"
58-
task 'beaker_sets', [:directory] do |t, args|
59-
directory = args[:directory]
60-
61-
metadata = JSON.load(File.read('metadata.json'))
62-
63-
(metadata['operatingsystem_support'] || []).each do |os|
64-
(os['operatingsystemrelease'] || []).each do |release|
65-
if directory
66-
beaker_set = "#{directory}/#{os['operatingsystem'].downcase}-#{release}"
67-
else
68-
beaker_set = "#{os['operatingsystem'].downcase}-#{release}-x64"
69-
end
70-
71-
filename = "spec/acceptance/nodesets/#{beaker_set}.yml"
72-
73-
puts beaker_set if File.exists? filename
74-
end
75-
end
62+
desc 'Generate REFERENCE.md'
63+
task :reference, [:debug, :backtrace] do |t, args|
64+
patterns = ''
65+
Rake::Task['strings:generate:reference'].invoke(patterns, args[:debug], args[:backtrace])
7666
end
7767

7868
begin

examples/extract.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
$caller_module_name = 'demo'
22

3-
class { '::staging':
3+
class { 'staging':
44
path => '/tmp/staging',
55
}
66

examples/file.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
$caller_module_name = 'demo'
22

3-
class { '::staging':
3+
class { 'staging':
44
path => '/tmp/staging',
55
}
66

examples/init.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
include ::staging
1+
include staging

manifests/extract.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
$subdir = $caller_module_name #: subdir per module in staging directory.
1616
) {
1717

18-
include ::staging
18+
include staging
1919

2020
if $source {
2121
$source_path = $source

manifests/file.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
$novalidate = false #: Whether to bypass https validation - powershell only
2929
) {
3030

31-
include ::staging
31+
include staging
3232

3333
$quoted_source = shellquote($source)
3434

metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
"requirements": [
9191
{
9292
"name": "puppet",
93-
"version_requirement": ">= 4.10.0 < 7.0.0"
93+
"version_requirement": ">= 5.5.8 < 7.0.0"
9494
}
9595
],
9696
"name": "puppet-staging",

spec/default_facts.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

spec/spec_helper.rb

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,23 @@
11
# This file is managed via modulesync
22
# https://github.com/voxpupuli/modulesync
33
# https://github.com/voxpupuli/modulesync_config
4+
RSpec.configure do |c|
5+
c.mock_with :rspec
6+
end
7+
48
require 'puppetlabs_spec_helper/module_spec_helper'
59
require 'rspec-puppet-facts'
610
include RspecPuppetFacts
711

12+
if File.exist?(File.join(__dir__, 'default_module_facts.yml'))
13+
facts = YAML.load(File.read(File.join(__dir__, 'default_module_facts.yml')))
14+
if facts
15+
facts.each do |name, value|
16+
add_custom_fact name.to_sym, value
17+
end
18+
end
19+
end
20+
821
if Dir.exist?(File.expand_path('../../lib', __FILE__))
922
require 'coveralls'
1023
require 'simplecov'
@@ -22,11 +35,6 @@
2235
end
2336

2437
RSpec.configure do |c|
25-
default_facts = {}
26-
default_facts.merge!(YAML.load(File.read(File.expand_path('../default_facts.yml', __FILE__)))) if File.exist?(File.expand_path('../default_facts.yml', __FILE__))
27-
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__))
28-
c.default_facts = default_facts
29-
3038
# Coverage generation
3139
c.after(:suite) do
3240
RSpec::Puppet::Coverage.report!

0 commit comments

Comments
 (0)