Skip to content

Commit eb2e1c2

Browse files
authored
Merge pull request #490 from voxpupuli/modulesync
modulesync 2.1.0, allow puppet 6.x and puppetlabs/apt 6.x
2 parents 6f02139 + 498fde7 commit eb2e1c2

6 files changed

Lines changed: 70 additions & 26 deletions

File tree

.fixtures.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ fixtures:
22
repositories:
33
"stdlib": "git://github.com/puppetlabs/puppetlabs-stdlib.git"
44
"apt": "git://github.com/puppetlabs/puppetlabs-apt.git"
5-
symlinks:
6-
"mongodb": "#{source_dir}"
5+
yumrepo_core:
6+
repo: https://github.com/puppetlabs/puppetlabs-yumrepo_core.git
7+
puppet_version: ">= 6.0.0"

.github/CONTRIBUTING.md

Lines changed: 59 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,19 @@ 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 the docs we use to review a module. They provide some guidance for
20+
new code that might help you before you submit a pull request.
1721

1822
1. Add a test for your change. Only refactoring and documentation
1923
changes require no new tests. If you are adding functionality
2024
or fixing a bug, please add a test.
2125

2226
1. Squash your commits down into logical components. Make sure to rebase
23-
against the current master.
27+
against our current master.
2428

2529
1. Push the branch to your fork and submit a pull request.
2630

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

41-
export PUPPET_VERSION="~> 4.2.0"
45+
```sh
46+
export PUPPET_VERSION="~> 5.5.6"
47+
```
4248

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

68-
bundle exec rake lint
69-
bundle exec rake validate
74+
```sh
75+
bundle exec rake lint
76+
bundle exec rake validate
77+
```
7078

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

74-
bundle exec rake rubocop
82+
```sh
83+
bundle exec rake rubocop
84+
```
7585

7686
## Running the unit tests
7787

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

8393
To run the linter, the syntax checker and the unit tests:
8494

85-
bundle exec rake test
95+
```sh
96+
bundle exec rake test
97+
```
8698

8799
To run your all the unit tests
88100

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

91105
To run a specific spec test set the `SPEC` variable:
92106

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

95111
## Integration tests
96112

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

105-
bundle exec rake acceptance
121+
```sh
122+
bundle exec rake acceptance
123+
```
106124

107125
This will run the tests on the module's default nodeset. You can override the
108126
nodeset used, e.g.,
109127

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

112132
There are default rake tasks for the various acceptance test modules, e.g.,
113133

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

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

144+
Beaker also supports docker containers. We also use that in our automated CI
145+
pipeline at [travis-ci](http://travis-ci.org). To use that instead of Vagrant:
146+
147+
```
148+
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
149+
```
150+
151+
You can replace the string `debian9` with any common operating system.
152+
The following strings are known to work:
153+
154+
* ubuntu1604
155+
* ubuntu1804
156+
* debian8
157+
* debian9
158+
* centos6
159+
* centos7
160+
122161
The easiest way to debug in a docker container is to open a shell:
123162

124-
docker exec -it -u root ${container_id_or_name} bash
163+
```sh
164+
docker exec -it -u root ${container_id_or_name} bash
165+
```
166+
167+
The source of this file is in our [modulesync_config](https://github.com/voxpupuli/modulesync_config/blob/master/moduleroot/.github/CONTRIBUTING.md.erb)
168+
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: 4 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
branches:

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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@
3939
"requirements": [
4040
{
4141
"name": "puppet",
42-
"version_requirement": ">= 4.10.0 < 6.0.0"
42+
"version_requirement": ">= 4.10.0 < 7.0.0"
4343
}
4444
],
4545
"dependencies": [
4646
{
4747
"name": "puppetlabs/apt",
48-
"version_requirement": ">= 2.1.0 < 6.0.0"
48+
"version_requirement": ">= 2.1.0 < 7.0.0"
4949
},
5050
{
5151
"name": "puppetlabs/stdlib",

0 commit comments

Comments
 (0)