Skip to content

Commit a01a4e4

Browse files
authored
Merge pull request #435 from voxpupuli/modulesync
modulesync 2.2.0 and allow puppet 6.x
2 parents 2f16648 + 2f81024 commit a01a4e4

File tree

9 files changed

+118
-45
lines changed

9 files changed

+118
-45
lines changed

.fixtures.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
fixtures:
22
repositories:
3-
stdlib:
4-
repo: 'https://github.com/puppetlabs/puppetlabs-stdlib.git'
5-
epel:
6-
repo: 'https://github.com/stahnma/puppet-module-epel.git'
7-
symlinks:
8-
python: "#{source_dir}"
3+
stdlib: 'https://github.com/puppetlabs/puppetlabs-stdlib.git'
4+
epel: 'https://github.com/stahnma/puppet-module-epel.git'
5+
yumrepo_core:
6+
repo: https://github.com/puppetlabs/puppetlabs-yumrepo_core.git
7+
puppet_version: ">= 6.0.0"

.github/CONTRIBUTING.md

Lines changed: 60 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,20 @@ By participating in this project you agree to abide by its terms.
1212

1313
1. Create a separate branch for your change.
1414

15-
1. Run the tests. We only take pull requests with passing tests, and
16-
documentation.
15+
1. We only take pull requests with passing tests, and documentation. [travis-ci](http://travis-ci.org)
16+
runs the tests for us. You can also execute them locally. This is explained
17+
in a later section.
18+
19+
1. Checkout [our docs](https://voxpupuli.org/docs/#reviewing-a-module-pr) we
20+
use to review a module and the [official styleguide](https://puppet.com/docs/puppet/6.0/style_guide.html).
21+
They provide some guidance for new code that might help you before you submit a pull request.
1722

1823
1. Add a test for your change. Only refactoring and documentation
1924
changes require no new tests. If you are adding functionality
2025
or fixing a bug, please add a test.
2126

2227
1. Squash your commits down into logical components. Make sure to rebase
23-
against the current master.
28+
against our current master.
2429

2530
1. Push the branch to your fork and submit a pull request.
2631

@@ -38,7 +43,9 @@ By default the tests use a baseline version of Puppet.
3843
If you have Ruby 2.x or want a specific version of Puppet,
3944
you must set an environment variable such as:
4045

41-
export PUPPET_VERSION="~> 4.2.0"
46+
```sh
47+
export PUPPET_VERSION="~> 5.5.6"
48+
```
4249

4350
You can install all needed gems for spec tests into the modules directory by
4451
running:
@@ -65,13 +72,17 @@ The test suite will run [Puppet Lint](http://puppet-lint.com/) and
6572
[Puppet Syntax](https://github.com/gds-operations/puppet-syntax) to
6673
check various syntax and style things. You can run these locally with:
6774

68-
bundle exec rake lint
69-
bundle exec rake validate
75+
```sh
76+
bundle exec rake lint
77+
bundle exec rake validate
78+
```
7079

7180
It will also run some [Rubocop](http://batsov.com/rubocop/) tests
7281
against it. You can run those locally ahead of time with:
7382

74-
bundle exec rake rubocop
83+
```sh
84+
bundle exec rake rubocop
85+
```
7586

7687
## Running the unit tests
7788

@@ -82,15 +93,21 @@ about how best to test your new feature.
8293

8394
To run the linter, the syntax checker and the unit tests:
8495

85-
bundle exec rake test
96+
```sh
97+
bundle exec rake test
98+
```
8699

87100
To run your all the unit tests
88101

89-
bundle exec rake spec SPEC_OPTS='--format documentation'
102+
```sh
103+
bundle exec rake spec
104+
```
90105

91106
To run a specific spec test set the `SPEC` variable:
92107

93-
bundle exec rake spec SPEC=spec/foo_spec.rb
108+
```sh
109+
bundle exec rake spec SPEC=spec/foo_spec.rb
110+
```
94111

95112
## Integration tests
96113

@@ -102,23 +119,51 @@ This fires up a new virtual machine (using vagrant) and runs a series of
102119
simple tests against it after applying the module. You can run this
103120
with:
104121

105-
bundle exec rake acceptance
122+
```sh
123+
bundle exec rake acceptance
124+
```
106125

107126
This will run the tests on the module's default nodeset. You can override the
108127
nodeset used, e.g.,
109128

110-
BEAKER_set=centos-7-x64 bundle exec rake acceptance
129+
```sh
130+
BEAKER_set=centos-7-x64 bundle exec rake acceptance
131+
```
111132

112133
There are default rake tasks for the various acceptance test modules, e.g.,
113134

114-
bundle exec rake beaker:centos-7-x64
115-
bundle exec rake beaker:ssh:centos-7-x64
135+
```sh
136+
bundle exec rake beaker:centos-7-x64
137+
bundle exec rake beaker:ssh:centos-7-x64
138+
```
116139

117140
If you don't want to have to recreate the virtual machine every time you can
118141
use `BEAKER_destroy=no` and `BEAKER_provision=no`. On the first run you will at
119142
least need `BEAKER_provision` set to yes (the default). The Vagrantfile for the
120143
created virtual machines will be in `.vagrant/beaker_vagrant_files`.
121144

145+
Beaker also supports docker containers. We also use that in our automated CI
146+
pipeline at [travis-ci](http://travis-ci.org). To use that instead of Vagrant:
147+
148+
```
149+
PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=debian9-64{hypervisor=docker} BEAKER_destroy=yes bundle exec rake beaker
150+
```
151+
152+
You can replace the string `debian9` with any common operating system.
153+
The following strings are known to work:
154+
155+
* ubuntu1604
156+
* ubuntu1804
157+
* debian8
158+
* debian9
159+
* centos6
160+
* centos7
161+
122162
The easiest way to debug in a docker container is to open a shell:
123163

124-
docker exec -it -u root ${container_id_or_name} bash
164+
```sh
165+
docker exec -it -u root ${container_id_or_name} bash
166+
```
167+
168+
The source of this file is in our [modulesync_config](https://github.com/voxpupuli/modulesync_config/blob/master/moduleroot/.github/CONTRIBUTING.md.erb)
169+
repository.

.msync.yml

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

.travis.yml

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ matrix:
1818
env: PUPPET_VERSION="~> 5.0" CHECK=test
1919
- rvm: 2.5.1
2020
bundler_args: --without system_tests development release
21-
env: PUPPET_VERSION="~> 5.0" CHECK=test_with_coveralls
22-
- rvm: 2.4.4
23-
bundler_args: --without system_tests development release
24-
env: PUPPET_VERSION="~> 5.0" CHECK=rubocop
21+
env: PUPPET_VERSION="~> 6.0" CHECK=test_with_coveralls
2522
- rvm: 2.5.1
23+
bundler_args: --without system_tests development release
24+
env: PUPPET_VERSION="~> 6.0" CHECK=rubocop
25+
- rvm: 2.4.4
2626
bundler_args: --without system_tests development release
2727
env: PUPPET_VERSION="~> 5.0" CHECK=build DEPLOY_TO_FORGE=yes
2828
- rvm: 2.5.1
@@ -31,6 +31,12 @@ matrix:
3131
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=ubuntu1404-64{hypervisor=docker} CHECK=beaker
3232
services: docker
3333
sudo: required
34+
- rvm: 2.5.1
35+
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=ubuntu1404-64{hypervisor=docker} CHECK=beaker
38+
services: docker
39+
sudo: required
3440
- rvm: 2.5.1
3541
bundler_args: --without development release
3642
dist: trusty
@@ -43,6 +49,12 @@ matrix:
4349
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=ubuntu1604-64{hypervisor=docker} CHECK=beaker
4450
services: docker
4551
sudo: required
52+
- rvm: 2.5.1
53+
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=ubuntu1604-64{hypervisor=docker} CHECK=beaker
56+
services: docker
57+
sudo: required
4658
- rvm: 2.5.1
4759
bundler_args: --without development release
4860
dist: trusty
@@ -55,6 +67,12 @@ matrix:
5567
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=ubuntu1804-64{hypervisor=docker} CHECK=beaker
5668
services: docker
5769
sudo: required
70+
- rvm: 2.5.1
71+
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=ubuntu1804-64{hypervisor=docker} CHECK=beaker
74+
services: docker
75+
sudo: required
5876
- rvm: 2.5.1
5977
bundler_args: --without development release
6078
dist: trusty
@@ -67,6 +85,12 @@ matrix:
6785
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=debian8-64{hypervisor=docker} CHECK=beaker
6886
services: docker
6987
sudo: required
88+
- rvm: 2.5.1
89+
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=debian8-64{hypervisor=docker} CHECK=beaker
92+
services: docker
93+
sudo: required
7094
- rvm: 2.5.1
7195
bundler_args: --without development release
7296
dist: trusty
@@ -79,6 +103,12 @@ matrix:
79103
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=debian9-64{hypervisor=docker} CHECK=beaker
80104
services: docker
81105
sudo: required
106+
- rvm: 2.5.1
107+
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=debian9-64{hypervisor=docker} CHECK=beaker
110+
services: docker
111+
sudo: required
82112
- rvm: 2.5.1
83113
bundler_args: --without development release
84114
dist: trusty
@@ -91,6 +121,12 @@ matrix:
91121
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=centos7-64{hypervisor=docker} CHECK=beaker
92122
services: docker
93123
sudo: required
124+
- rvm: 2.5.1
125+
bundler_args: --without development release
126+
dist: trusty
127+
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=centos7-64{hypervisor=docker} CHECK=beaker
128+
services: docker
129+
sudo: required
94130
- rvm: 2.5.1
95131
bundler_args: --without development release
96132
dist: trusty

Gemfile

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

1313
group :test do
14-
gem 'puppetlabs_spec_helper', '~> 2.6', :require => false
15-
gem 'rspec-puppet', '~> 2.5', :require => false
16-
gem 'rspec-puppet-facts', :require => false
14+
gem 'puppetlabs_spec_helper', '>= 2.11.0', :require => false
15+
gem 'rspec-puppet-facts', '>= 1.8.0', :require => false
1716
gem 'rspec-puppet-utils', :require => false
1817
gem 'puppet-lint-leading_zero-check', :require => false
1918
gem 'puppet-lint-trailing_comma-check', :require => false

metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"requirements": [
5151
{
5252
"name": "puppet",
53-
"version_requirement": ">= 4.10.0 < 6.0.0"
53+
"version_requirement": ">= 4.10.0 < 7.0.0"
5454
}
5555
],
5656
"dependencies": [

spec/classes/coverage_spec.rb

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

spec/default_facts.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
# Hint if using with rspec-puppet-facts ("on_supported_os.each"):
99
# if a same named fact exists in facterdb it will be overridden.
1010
---
11-
concat_basedir: "/tmp"
1211
ipaddress: "172.16.254.254"
1312
is_pe: false
1413
macaddress: "AA:AA:AA:AA:AA:AA"

spec/spec_helper.rb

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
require 'puppetlabs_spec_helper/module_spec_helper'
2-
require 'rspec-puppet-facts'
3-
include RspecPuppetFacts
4-
51
# This file is managed via modulesync
62
# https://github.com/voxpupuli/modulesync
73
# https://github.com/voxpupuli/modulesync_config
4+
require 'puppetlabs_spec_helper/module_spec_helper'
5+
require 'rspec-puppet-facts'
6+
include RspecPuppetFacts
87

98
if Dir.exist?(File.expand_path('../../lib', __FILE__))
109
require 'coveralls'
@@ -23,13 +22,13 @@
2322
end
2423

2524
RSpec.configure do |c|
26-
default_facts = {
27-
puppetversion: Puppet.version,
28-
facterversion: Facter.version
29-
}
25+
default_facts = {}
3026
default_facts.merge!(YAML.load(File.read(File.expand_path('../default_facts.yml', __FILE__)))) if File.exist?(File.expand_path('../default_facts.yml', __FILE__))
3127
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__))
3228
c.default_facts = default_facts
33-
end
3429

35-
# vim: syntax=ruby
30+
# Coverage generation
31+
c.after(:suite) do
32+
RSpec::Puppet::Coverage.report!
33+
end
34+
end

0 commit comments

Comments
 (0)