Skip to content

Commit e7b53d7

Browse files
authored
Merge pull request #192 from voxpupuli/modulesync
modulesync 2.8.0
2 parents 2eb48c9 + eed510e commit e7b53d7

File tree

6 files changed

+36
-16
lines changed

6 files changed

+36
-16
lines changed

.github/CONTRIBUTING.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,34 @@ 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 system_tests release
54+
bundle install --path .vendor/ --without development system_tests release --jobs "$(nproc)"
5555
```
5656

5757
If you also want to run acceptance tests:
5858

5959
```sh
60-
bundle install --path .vendor/ --with system_tests --without development release
60+
bundle install --path .vendor/ --with system_tests --without development release --jobs "$(nproc)"
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/ --with system_tests --without development release; bundle update; bundle clean
66+
bundle install --path .vendor/ --with system_tests --without development release --jobs "$(nproc)"; bundle update; bundle clean
67+
```
68+
69+
As an alternative to the `--jobs "$(nproc)` parameter, you can set an
70+
environment variable:
71+
72+
```sh
73+
BUNDLE_JOBS="$(nproc)"
74+
```
75+
76+
### Note for OS X users
77+
78+
`nproc` isn't a valid command unter OS x. As an alternative, you can do:
79+
80+
```sh
81+
--jobs "$(sysctl -n hw.ncpu)"
6782
```
6883

6984
## Syntax and style
@@ -160,7 +175,7 @@ created virtual machines will be in `.vagrant/beaker_vagrant_files`.
160175
Beaker also supports docker containers. We also use that in our automated CI
161176
pipeline at [travis-ci](http://travis-ci.org). To use that instead of Vagrant:
162177

163-
```
178+
```sh
164179
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
165180
```
166181

.msync.yml

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

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ group :test do
2121
gem 'puppet-lint-unquoted_string-check', :require => false
2222
gem 'puppet-lint-variable_contains_upcase', :require => false
2323
gem 'puppet-lint-absolute_classname-check', :require => false
24+
gem 'puppet-lint-topscope-variable-check', :require => false
2425
gem 'metadata-json-lint', :require => false
2526
gem 'redcarpet', :require => false
2627
gem 'rubocop', '~> 0.49.1', :require => false

spec/classes/letsencrypt_spec.rb

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
describe 'with defaults' do
1616
it { is_expected.to compile }
1717

18-
epel = facts[:osfamily] == 'RedHat'
18+
epel = facts[:osfamily] == 'RedHat' && facts[:operatingsystem] != 'Fedora'
1919

2020
it 'contains File[/usr/local/sbin/letsencrypt-domain-validation]' do
2121
is_expected.to contain_file('/usr/local/sbin/letsencrypt-domain-validation').
@@ -46,8 +46,7 @@
4646
cron_monthday: ['*'])
4747
is_expected.to contain_cron('letsencrypt-renew').with_ensure('absent')
4848

49-
case facts[:operatingsystem]
50-
when 'FreeBSD'
49+
if facts[:osfamily] == 'FreeBSD'
5150
is_expected.to contain_ini_setting('/usr/local/etc/letsencrypt/cli.ini email [email protected]')
5251
is_expected.to contain_ini_setting('/usr/local/etc/letsencrypt/cli.ini server https://acme-v01.api.letsencrypt.org/directory')
5352
is_expected.to contain_file('letsencrypt-renewal-hooks-puppet').
@@ -64,8 +63,12 @@
6463
is_expected.to contain_file('letsencrypt-renewal-hooks-puppet').with_path('/etc/letsencrypt/renewal-hooks-puppet')
6564
end
6665

67-
if facts[:osfamily] == 'RedHat' && facts[:operatingsystemmajrelease] == '7'
68-
is_expected.to contain_class('epel').that_comes_before('Package[letsencrypt]')
66+
if facts[:osfamily] == 'RedHat'
67+
if facts[:operatingsystem] == 'Fedora'
68+
is_expected.not_to contain_class('epel')
69+
else
70+
is_expected.to contain_class('epel').that_comes_before('Package[letsencrypt]')
71+
end
6972
is_expected.to contain_class('letsencrypt::install').with(install_method: 'package')
7073
is_expected.to contain_class('letsencrypt').with(package_command: 'certbot')
7174
is_expected.to contain_package('letsencrypt').with(name: 'certbot')

spec/defines/letsencrypt_certonly_spec.rb

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,15 @@
2323
it { is_expected.to contain_class('Letsencrypt::Config') }
2424
it { is_expected.to contain_class('Letsencrypt::Params') }
2525

26-
case facts[:kernel]
27-
when 'Linux'
26+
if facts[:osfamily] == 'FreeBSD'
27+
it { is_expected.to contain_file('/usr/local/etc/letsencrypt') }
28+
it { is_expected.to contain_ini_setting('/usr/local/etc/letsencrypt/cli.ini email [email protected]') }
29+
it { is_expected.to contain_ini_setting('/usr/local/etc/letsencrypt/cli.ini server https://acme-v01.api.letsencrypt.org/directory') }
30+
else
2831
it { is_expected.to contain_file('/etc/letsencrypt') }
2932
it { is_expected.to contain_package('letsencrypt') } unless facts[:os]['release']['full'] == '14.04'
3033
it { is_expected.to contain_ini_setting('/etc/letsencrypt/cli.ini email [email protected]') }
3134
it { is_expected.to contain_ini_setting('/etc/letsencrypt/cli.ini server https://acme-v01.api.letsencrypt.org/directory') }
32-
else
33-
it { is_expected.to contain_file('/usr/local/etc/letsencrypt') }
34-
it { is_expected.to contain_ini_setting('/usr/local/etc/letsencrypt/cli.ini email [email protected]') }
35-
it { is_expected.to contain_ini_setting('/usr/local/etc/letsencrypt/cli.ini server https://acme-v01.api.letsencrypt.org/directory') }
3635
end
3736
it { is_expected.to contain_exec('initialize letsencrypt') }
3837
it { is_expected.to contain_exec('letsencrypt certonly foo.example.com') }

spec/spec_helper.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
require 'puppetlabs_spec_helper/module_spec_helper'
99
require 'rspec-puppet-facts'
10+
require 'bundler'
1011
include RspecPuppetFacts
1112

1213
if File.exist?(File.join(__dir__, 'default_module_facts.yml'))
@@ -31,6 +32,7 @@
3132
add_filter '/spec'
3233
add_filter '/vendor'
3334
add_filter '/.vendor'
35+
add_filter Bundler.configured_bundle_path.path
3436
end
3537
end
3638

0 commit comments

Comments
 (0)