Skip to content

Commit ec76fe3

Browse files
authored
Merge pull request #183 from voxpupuli/modulesync
modulesync 2.1.0 and allow puppet 6.x
2 parents b629ee3 + 036febc commit ec76fe3

File tree

6 files changed

+82
-25
lines changed

6 files changed

+82
-25
lines changed

.fixtures.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
fixtures:
2-
symlinks:
3-
gluster: "#{source_dir}"
42
repositories:
53
apt: "https://github.com/puppetlabs/puppetlabs-apt.git"
64
stdlib: "https://github.com/puppetlabs/puppetlabs-stdlib.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.1.0'

.travis.yml

Lines changed: 16 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=centos7-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=centos7-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=debian9-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=debian9-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

Gemfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ 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
14+
gem 'puppetlabs_spec_helper', '>= 2.11.0', :require => false
1615
gem 'rspec-puppet-facts', :require => false
1716
gem 'rspec-puppet-utils', :require => false
1817
gem 'puppet-lint-leading_zero-check', :require => false

metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"requirements": [
4444
{
4545
"name": "puppet",
46-
"version_requirement": ">= 4.10.0 < 6.0.0"
46+
"version_requirement": ">= 4.10.0 < 7.0.0"
4747
}
4848
]
4949
}

0 commit comments

Comments
 (0)