File tree Expand file tree Collapse file tree 6 files changed +36
-16
lines changed Expand file tree Collapse file tree 6 files changed +36
-16
lines changed Original file line number Diff line number Diff line change @@ -51,19 +51,34 @@ You can install all needed gems for spec tests into the modules directory by
5151running:
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
5757If 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
6363Our 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`.
160175Beaker also supports docker containers. We also use that in our automated CI
161176pipeline at [ travis-ci] ( http://travis-ci.org ) . To use that instead of Vagrant:
162177
163- ```
178+ ``` sh
164179PUPPET_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
Original file line number Diff line number Diff line change 1- modulesync_config_version : ' 2.7 .0'
1+ modulesync_config_version : ' 2.8 .0'
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 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' ) .
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' ) .
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' )
Original file line number Diff line number Diff line change 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' ) }
Original file line number Diff line number Diff line change 77
88require 'puppetlabs_spec_helper/module_spec_helper'
99require 'rspec-puppet-facts'
10+ require 'bundler'
1011include RspecPuppetFacts
1112
1213if File . exist? ( File . join ( __dir__ , 'default_module_facts.yml' ) )
3132 add_filter '/spec'
3233 add_filter '/vendor'
3334 add_filter '/.vendor'
35+ add_filter Bundler . configured_bundle_path . path
3436 end
3537end
3638
You can’t perform that action at this time.
0 commit comments