Skip to content

Commit 5b48090

Browse files
authored
Merge pull request #211 from voxpupuli/modulesync
modulesync 2.5.1 and drop puppet 4
2 parents 507b034 + 7e641e3 commit 5b48090

28 files changed

+134
-341
lines changed

.editorconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# editorconfig.org
2+
3+
# MANAGED BY MODULESYNC
4+
5+
root = true
6+
7+
[*]
8+
charset = utf-8
9+
end_of_line = lf
10+
indent_size = 2
11+
tab_width = 2
12+
indent_style = space
13+
insert_final_newline = true
14+
trim_trailing_whitespace = true

.github/CONTRIBUTING.md

Lines changed: 18 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
@@ -109,6 +109,21 @@ To run a specific spec test set the `SPEC` variable:
109109
bundle exec rake spec SPEC=spec/foo_spec.rb
110110
```
111111

112+
### Unit tests in docker
113+
114+
Some people don't want to run the dependencies locally or don't want to install
115+
ruby. We ship a Dockerfile that enables you to run all unit tests and linting.
116+
You only need to run:
117+
118+
```sh
119+
docker build .
120+
```
121+
122+
Please ensure that a docker daemon is running and that your user has the
123+
permission to talk to it. You can specify a remote docker host by setting the
124+
`DOCKER_HOST` environment variable. it will copy the content of the module into
125+
the docker image. So it will not work if a Gemfile.lock exists.
126+
112127
## Integration tests
113128

114129
The unit tests just check the code runs, not that it does exactly what

.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.2.0'
1+
modulesync_config_version: '2.5.1'

.pmtignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ Puppetfile.lock
1818
*.iml
1919
.*.sw?
2020
.yardoc/
21+
Dockerfile

.sync.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
- set: ubuntu1404-64
99
- set: ubuntu1604-64
1010
spec/spec_helper.rb:
11-
mock_with: :rspec
12-
spec_overrides:
11+
mock_with: ':rspec'
12+
spec_overrides:
1313
- "require 'splunk_data.rb'"
1414
- "$LOAD_PATH.unshift File.dirname(__FILE__) + '/fixtures/modules/inifile/lib'"

.travis.yml

Lines changed: 36 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,120 +1,88 @@
11
---
2-
sudo: false
3-
dist: trusty
2+
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
2624
bundler_args: --without system_tests development release
2725
env: PUPPET_VERSION="~> 5.0" CHECK=build DEPLOY_TO_FORGE=yes
28-
- rvm: 2.5.1
26+
- rvm: 2.5.3
2927
bundler_args: --without development release
30-
dist: trusty
31-
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=centos6-64{hypervisor=docker} CHECK=beaker
28+
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=centos6-64 BEAKER_HYPERVISOR=docker CHECK=beaker
3229
services: docker
33-
sudo: required
34-
- rvm: 2.5.1
30+
- rvm: 2.5.3
3531
bundler_args: --without development release
36-
dist: trusty
37-
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=centos6-64{hypervisor=docker} CHECK=beaker
32+
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=centos6-64 BEAKER_HYPERVISOR=docker CHECK=beaker
3833
services: docker
39-
sudo: required
40-
- rvm: 2.5.1
34+
- rvm: 2.5.3
4135
bundler_args: --without development release
42-
dist: trusty
43-
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6-nightly BEAKER_debug=true BEAKER_setfile=centos6-64{hypervisor=docker} CHECK=beaker
36+
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6-nightly BEAKER_debug=true BEAKER_setfile=centos6-64 BEAKER_HYPERVISOR=docker CHECK=beaker
4437
services: docker
45-
sudo: required
46-
- rvm: 2.5.1
38+
- rvm: 2.5.3
4739
bundler_args: --without development release
48-
dist: trusty
49-
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=centos7-64{hypervisor=docker} CHECK=beaker
40+
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=centos7-64 BEAKER_HYPERVISOR=docker CHECK=beaker
5041
services: docker
51-
sudo: required
52-
- rvm: 2.5.1
42+
- rvm: 2.5.3
5343
bundler_args: --without development release
54-
dist: trusty
55-
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=centos7-64{hypervisor=docker} CHECK=beaker
44+
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=centos7-64 BEAKER_HYPERVISOR=docker CHECK=beaker
5645
services: docker
57-
sudo: required
58-
- rvm: 2.5.1
46+
- rvm: 2.5.3
5947
bundler_args: --without development release
60-
dist: trusty
61-
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6-nightly BEAKER_debug=true BEAKER_setfile=centos7-64{hypervisor=docker} CHECK=beaker
48+
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6-nightly BEAKER_debug=true BEAKER_setfile=centos7-64 BEAKER_HYPERVISOR=docker CHECK=beaker
6249
services: docker
63-
sudo: required
64-
- rvm: 2.5.1
50+
- rvm: 2.5.3
6551
bundler_args: --without development release
66-
dist: trusty
67-
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=debian8-64{hypervisor=docker} CHECK=beaker
52+
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=debian8-64 BEAKER_HYPERVISOR=docker CHECK=beaker
6853
services: docker
69-
sudo: required
70-
- rvm: 2.5.1
54+
- rvm: 2.5.3
7155
bundler_args: --without development release
72-
dist: trusty
73-
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=debian8-64{hypervisor=docker} CHECK=beaker
56+
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=debian8-64 BEAKER_HYPERVISOR=docker CHECK=beaker
7457
services: docker
75-
sudo: required
76-
- rvm: 2.5.1
58+
- rvm: 2.5.3
7759
bundler_args: --without development release
78-
dist: trusty
79-
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6-nightly BEAKER_debug=true BEAKER_setfile=debian8-64{hypervisor=docker} CHECK=beaker
60+
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6-nightly BEAKER_debug=true BEAKER_setfile=debian8-64 BEAKER_HYPERVISOR=docker CHECK=beaker
8061
services: docker
81-
sudo: required
82-
- rvm: 2.5.1
62+
- rvm: 2.5.3
8363
bundler_args: --without development release
84-
dist: trusty
85-
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=ubuntu1404-64{hypervisor=docker} CHECK=beaker
64+
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=ubuntu1404-64 BEAKER_HYPERVISOR=docker CHECK=beaker
8665
services: docker
87-
sudo: required
88-
- rvm: 2.5.1
66+
- rvm: 2.5.3
8967
bundler_args: --without development release
90-
dist: trusty
91-
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=ubuntu1404-64{hypervisor=docker} CHECK=beaker
68+
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=ubuntu1404-64 BEAKER_HYPERVISOR=docker CHECK=beaker
9269
services: docker
93-
sudo: required
94-
- rvm: 2.5.1
70+
- rvm: 2.5.3
9571
bundler_args: --without development release
96-
dist: trusty
97-
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6-nightly BEAKER_debug=true BEAKER_setfile=ubuntu1404-64{hypervisor=docker} CHECK=beaker
72+
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6-nightly BEAKER_debug=true BEAKER_setfile=ubuntu1404-64 BEAKER_HYPERVISOR=docker CHECK=beaker
9873
services: docker
99-
sudo: required
100-
- rvm: 2.5.1
74+
- rvm: 2.5.3
10175
bundler_args: --without development release
102-
dist: trusty
103-
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=ubuntu1604-64{hypervisor=docker} CHECK=beaker
76+
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=ubuntu1604-64 BEAKER_HYPERVISOR=docker CHECK=beaker
10477
services: docker
105-
sudo: required
106-
- rvm: 2.5.1
78+
- rvm: 2.5.3
10779
bundler_args: --without development release
108-
dist: trusty
109-
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=ubuntu1604-64{hypervisor=docker} CHECK=beaker
80+
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=ubuntu1604-64 BEAKER_HYPERVISOR=docker CHECK=beaker
11081
services: docker
111-
sudo: required
112-
- rvm: 2.5.1
82+
- rvm: 2.5.3
11383
bundler_args: --without development release
114-
dist: trusty
115-
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6-nightly BEAKER_debug=true BEAKER_setfile=ubuntu1604-64{hypervisor=docker} CHECK=beaker
84+
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6-nightly BEAKER_debug=true BEAKER_setfile=ubuntu1604-64 BEAKER_HYPERVISOR=docker CHECK=beaker
11685
services: docker
117-
sudo: required
11886
branches:
11987
only:
12088
- master

Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM ruby:2.5.1
2+
3+
WORKDIR /opt/puppet
4+
5+
# https://github.com/puppetlabs/puppet/blob/06ad255754a38f22fb3a22c7c4f1e2ce453d01cb/lib/puppet/provider/service/runit.rb#L39
6+
RUN mkdir -p /etc/sv
7+
8+
ARG PUPPET_VERSION="~> 6.0"
9+
ARG PARALLEL_TEST_PROCESSORS=4
10+
11+
# Cache gems
12+
COPY Gemfile .
13+
RUN bundle install --without system_tests development release --path=${BUNDLE_PATH:-vendor/bundle}
14+
15+
COPY . .
16+
17+
RUN bundle install
18+
RUN bundle exec release_checks
19+
20+
# Container should not saved
21+
RUN exit 1

Gemfile

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,11 @@ group :test do
2222
gem 'puppet-lint-variable_contains_upcase', :require => false
2323
gem 'metadata-json-lint', :require => false
2424
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'
25+
gem 'rubocop', '~> 0.49.1', :require => false
26+
gem 'rubocop-rspec', '~> 1.15.0', :require => false
2727
gem 'mocha', '~> 1.4.0', :require => false
2828
gem 'coveralls', :require => false
2929
gem 'simplecov-console', :require => false
30-
gem 'rack', '~> 1.0', :require => false if RUBY_VERSION < '2.2.2'
3130
gem 'parallel_tests', :require => false
3231
end
3332

@@ -43,26 +42,26 @@ group :system_tests do
4342
if beaker_version = ENV['BEAKER_VERSION']
4443
gem 'beaker', *location_for(beaker_version)
4544
else
46-
gem 'beaker', '>= 3.9.0', :require => false
45+
gem 'beaker', '>= 4.2.0', :require => false
4746
end
4847
if beaker_rspec_version = ENV['BEAKER_RSPEC_VERSION']
4948
gem 'beaker-rspec', *location_for(beaker_rspec_version)
5049
else
5150
gem 'beaker-rspec', :require => false
5251
end
5352
gem 'serverspec', :require => false
54-
gem 'beaker-hostgenerator', '>= 1.1.10', :require => false
53+
gem 'beaker-hostgenerator', '>= 1.1.22', :require => false
5554
gem 'beaker-docker', :require => false
5655
gem 'beaker-puppet', :require => false
5756
gem 'beaker-puppet_install_helper', :require => false
5857
gem 'beaker-module_install_helper', :require => false
59-
gem 'rbnacl', '>= 4', :require => false if RUBY_VERSION >= '2.2.6'
60-
gem 'rbnacl-libsodium', :require => false if RUBY_VERSION >= '2.2.6'
58+
gem 'rbnacl', '>= 4', :require => false
59+
gem 'rbnacl-libsodium', :require => false
6160
gem 'bcrypt_pbkdf', :require => false
6261
end
6362

6463
group :release do
65-
gem 'github_changelog_generator', :require => false, :git => 'https://github.com/github-changelog-generator/github-changelog-generator' if RUBY_VERSION >= '2.2.2'
64+
gem 'github_changelog_generator', :require => false, :git => 'https://github.com/github-changelog-generator/github-changelog-generator'
6665
gem 'puppet-blacksmith', :require => false
6766
gem 'voxpupuli-release', :require => false, :git => 'https://github.com/voxpupuli/voxpupuli-release-gem'
6867
gem 'puppet-strings', '>= 1.0', :require => false
@@ -76,7 +75,7 @@ else
7675
gem 'facter', :require => false, :groups => [:test]
7776
end
7877

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

8281
# vim: syntax=ruby

Rakefile

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,27 @@ RSpec::Core::RakeTask.new(:acceptance) do |t|
3737
t.pattern = 'spec/acceptance'
3838
end
3939

40-
desc 'Run tests metadata_lint, release_checks'
40+
desc 'Run tests release_checks'
4141
task test: [
42-
:metadata_lint,
4342
:release_checks,
4443
]
4544

45+
namespace :check do
46+
desc 'Check for trailing whitespace'
47+
task :trailing_whitespace do
48+
Dir.glob('**/*.md', File::FNM_DOTMATCH).sort.each do |filename|
49+
next if filename =~ %r{^((modules|acceptance|\.?vendor|spec/fixtures|pkg)/|REFERENCE.md)}
50+
File.foreach(filename).each_with_index do |line, index|
51+
if line =~ %r{\s\n$}
52+
puts "#{filename} has trailing whitespace on line #{index + 1}"
53+
exit 1
54+
end
55+
end
56+
end
57+
end
58+
end
59+
Rake::Task[:release_checks].enhance ['check:trailing_whitespace']
60+
4661
desc "Run main 'test' task and report merged results to coveralls"
4762
task test_with_coveralls: [:test] do
4863
if Dir.exist?(File.expand_path('../lib', __FILE__))

0 commit comments

Comments
 (0)