Skip to content

Commit 11f0d8c

Browse files
committed
modulesync 1.4.1
1 parent aa6d88d commit 11f0d8c

File tree

10 files changed

+101
-35
lines changed

10 files changed

+101
-35
lines changed

.github/CONTRIBUTING.md

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
This module has grown over time based on a range of contributions from
22
people using it. If you follow these contributing guidelines your patch
3-
will likely make it into a release a little quicker.
3+
will likely make it into a release a little more quickly.
44

55
## Contributing
66

@@ -65,6 +65,10 @@ add tests if you're adding new functionality. If you've not used
6565
[rspec-puppet](http://rspec-puppet.com/) before then feel free to ask
6666
about how best to test your new feature.
6767

68+
To run the linter, the syntax checker and the unit tests:
69+
70+
bundle exec rake test
71+
6872
To run your all the unit tests
6973

7074
bundle exec rake spec SPEC_OPTS='--format documentation'
@@ -73,10 +77,6 @@ To run a specific spec test set the `SPEC` variable:
7377

7478
bundle exec rake spec SPEC=spec/foo_spec.rb
7579

76-
To run the linter, the syntax checker and the unit tests:
77-
78-
bundle exec rake test
79-
8080
## Integration tests
8181

8282
The unit tests just check the code runs, not that it does exactly what
@@ -89,15 +89,20 @@ with:
8989

9090
bundle exec rake acceptance
9191

92-
This will run the tests on an Ubuntu 12.04 virtual machine. You can also
93-
run the integration tests against Centos 6.6 with.
92+
This will run the tests on the module's default nodeset. You can override the
93+
nodeset used, e.g.,
94+
95+
BEAKER_set=centos-7-x64 bundle exec rake acceptance
96+
97+
There are default rake tasks for the various acceptance test modules, e.g.,
9498

95-
BEAKER_set=centos-66-x64 bundle exec rake acceptances
99+
bundle exec rake beaker:centos-7-x64
100+
bundle exec rake beaker:ssh:centos-7-x64
96101

97-
If you don't want to have to recreate the virtual machine every time you
98-
can use `BEAKER_DESTROY=no` and `BEAKER_PROVISION=no`. On the first run you will
99-
at least need `BEAKER_PROVISION` set to yes (the default). The Vagrantfile
100-
for the created virtual machines will be in `.vagrant/beaker_vagrant_fies`.
102+
If you don't want to have to recreate the virtual machine every time you can
103+
use `BEAKER_destroy=no` and `BEAKER_provision=no`. On the first run you will at
104+
least need `BEAKER_provision` set to yes (the default). The Vagrantfile for the
105+
created virtual machines will be in `.vagrant/beaker_vagrant_files`.
101106

102107
The easiest way to debug in a docker container is to open a shell:
103108

.msync.yml

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

.rubocop.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ AllCops:
1212
- Gemfile
1313
- Rakefile
1414
- Guardfile
15+
- Vagrantfile
1516
Lint/ConditionPosition:
1617
Enabled: True
1718

@@ -45,6 +46,9 @@ Style/HashSyntax:
4546
Style/RedundantReturn:
4647
Enabled: True
4748

49+
Style/EndOfLine:
50+
Enabled: False
51+
4852
Lint/AmbiguousOperator:
4953
Enabled: True
5054

@@ -530,3 +534,12 @@ Layout/IndentHeredoc:
530534
# disable Yaml safe_load. This is needed to support ruby2.0.0 development envs
531535
Security/YAMLLoad:
532536
Enabled: false
537+
538+
# This affects hiera interpolation, as well as some configs that we push.
539+
Style/FormatStringToken:
540+
Enabled: false
541+
542+
# This is useful, but sometimes a little too picky about where unit tests files
543+
# are located.
544+
RSpec/FilePath:
545+
Enabled: false

.travis.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,28 @@ matrix:
1616
fast_finish: true
1717
include:
1818
- rvm: 2.1.9
19-
bundler_args: --without system_tests development
19+
bundler_args: --without system_tests development release
2020
env: PUPPET_VERSION="~> 4.0" CHECK=test
21-
- rvm: 2.4.1
22-
bundler_args: --without system_tests development
23-
env: PUPPET_VERSION="~> 5.0" CHECK=test
24-
- rvm: 2.4.1
25-
bundler_args: --without system_tests development
21+
- rvm: 2.4.2
22+
bundler_args: --without system_tests development release
23+
env: PUPPET_VERSION="~> 5.0" CHECK=test_with_coveralls
24+
- rvm: 2.4.2
25+
bundler_args: --without system_tests development release
2626
env: PUPPET_VERSION="~> 5.0" CHECK=rubocop
27-
- rvm: 2.4.1
28-
bundler_args: --without system_tests development
27+
- rvm: 2.4.2
28+
bundler_args: --without system_tests development release
2929
env: PUPPET_VERSION="~> 5.0" CHECK=build DEPLOY_TO_FORGE=yes
3030
branches:
3131
only:
3232
- master
3333
- /^v\d/
3434
notifications:
3535
email: false
36+
irc:
37+
on_success: always
38+
on_failure: always
39+
channels:
40+
- "chat.freenode.org#voxpupuli-notifications"
3641
deploy:
3742
provider: puppetforge
3843
user: puppet

Gemfile

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

1313
group :test do
14-
gem 'puppetlabs_spec_helper', '~> 2.2.0', :require => false
14+
gem 'puppetlabs_spec_helper', '~> 2.4.0', :require => false
1515
gem 'rspec-puppet', '~> 2.5', :require => false
1616
gem 'rspec-puppet-facts', :require => false
1717
gem 'rspec-puppet-utils', :require => false
@@ -22,18 +22,13 @@ group :test do
2222
gem 'puppet-lint-unquoted_string-check', :require => false
2323
gem 'puppet-lint-variable_contains_upcase', :require => false
2424
gem 'metadata-json-lint', :require => false
25-
gem 'puppet-blacksmith', :require => false
26-
gem 'voxpupuli-release', :require => false, :git => 'https://github.com/voxpupuli/voxpupuli-release-gem'
27-
gem 'puppet-strings', '~> 1.0', :require => false
2825
gem 'redcarpet', :require => false
2926
gem 'rubocop', '~> 0.49.1', :require => false if RUBY_VERSION >= '2.3.0'
3027
gem 'rubocop-rspec', '~> 1.15.0', :require => false if RUBY_VERSION >= '2.3.0'
3128
gem 'mocha', '>= 1.2.1', :require => false
3229
gem 'coveralls', :require => false
3330
gem 'simplecov-console', :require => false
34-
gem 'github_changelog_generator', '~> 1.13.0', :require => false if RUBY_VERSION < '2.2.2'
3531
gem 'rack', '~> 1.0', :require => false if RUBY_VERSION < '2.2.2'
36-
gem 'github_changelog_generator', :require => false if RUBY_VERSION >= '2.2.2'
3732
gem 'parallel_tests', :require => false
3833
gem 'ipaddress', :require => false
3934
gem 'rspec-its', :require => false
@@ -47,8 +42,11 @@ group :development do
4742
end
4843

4944
group :system_tests do
45+
gem 'winrm', :require => false
5046
if beaker_version = ENV['BEAKER_VERSION']
5147
gem 'beaker', *location_for(beaker_version)
48+
else
49+
gem 'beaker', '>= 3.9.0', :require => false
5250
end
5351
if beaker_rspec_version = ENV['BEAKER_RSPEC_VERSION']
5452
gem 'beaker-rspec', *location_for(beaker_rspec_version)
@@ -57,14 +55,22 @@ group :system_tests do
5755
end
5856
gem 'serverspec', :require => false
5957
gem 'beaker-puppet_install_helper', :require => false
58+
gem 'beaker-module_install_helper', :require => false
59+
end
60+
61+
group :release do
62+
gem 'github_changelog_generator', :require => false if RUBY_VERSION >= '2.2.2'
63+
gem 'puppet-blacksmith', :require => false
64+
gem 'voxpupuli-release', :require => false, :git => 'https://github.com/voxpupuli/voxpupuli-release-gem'
65+
gem 'puppet-strings', '~> 1.0', :require => false
6066
end
6167

6268

6369

6470
if facterversion = ENV['FACTER_GEM_VERSION']
6571
gem 'facter', facterversion.to_s, :require => false, :groups => [:test]
6672
else
67-
gem 'facter', :require => false, :groups => [:test]
73+
gem 'facter', :require => false, :groups => [:test]
6874
end
6975

7076
ENV['PUPPET_VERSION'].nil? ? puppetversion = '~> 5.0' : puppetversion = ENV['PUPPET_VERSION'].to_s

Rakefile

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
require 'puppetlabs_spec_helper/rake_tasks'
2-
require 'puppet_blacksmith/rake_tasks'
3-
require 'voxpupuli/release/rake_tasks'
4-
require 'puppet-strings/tasks'
2+
3+
# load optional tasks for releases
4+
# only available if gem group releases is installed
5+
begin
6+
require 'puppet_blacksmith/rake_tasks'
7+
require 'voxpupuli/release/rake_tasks'
8+
require 'puppet-strings/tasks'
9+
rescue LoadError
10+
end
511

612
PuppetLint.configuration.log_format = '%{path}:%{line}:%{check}:%{KIND}:%{message}'
713
PuppetLint.configuration.fail_on_warnings = true
@@ -31,6 +37,17 @@ task test: [
3137
:release_checks,
3238
]
3339

40+
desc "Run main 'test' task and report merged results to coveralls"
41+
task test_with_coveralls: [:test] do
42+
if Dir.exist?(File.expand_path('../lib', __FILE__))
43+
require 'coveralls/rake/task'
44+
Coveralls::RakeTask.new
45+
Rake::Task['coveralls:push'].invoke
46+
else
47+
puts 'Skipping reporting to coveralls. Module has no lib dir'
48+
end
49+
end
50+
3451
begin
3552
require 'github_changelog_generator/task'
3653
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
@@ -39,6 +56,9 @@ begin
3956
config.header = "# Changelog\n\nAll notable changes to this project will be documented in this file.\nEach new release typically also includes the latest modulesync defaults.\nThese should not affect the functionality of the module."
4057
config.exclude_labels = %w{duplicate question invalid wontfix wont-fix modulesync skip-changelog}
4158
config.user = 'voxpupuli'
59+
metadata_json = File.join(File.dirname(__FILE__), 'metadata.json')
60+
metadata = JSON.load(File.read(metadata_json))
61+
config.project = metadata['name']
4262
end
4363
rescue LoadError
4464
end

spec/acceptance/nodesets/docker/debian-7.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ HOSTS:
1010
docker_preserve_image: true
1111
docker_cmd: '["/sbin/init"]'
1212
docker_image_commands:
13-
- 'echo deb http://ftp.debian.org/debian wheezy-backports main >> /etc/apt/sources.list'
1413
- 'apt-get update && apt-get install -y cron locales-all net-tools wget'
1514
CONFIG:
1615
trace_limit: 200

spec/acceptance/nodesets/docker/debian-8.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ HOSTS:
1010
docker_preserve_image: true
1111
docker_cmd: '["/sbin/init"]'
1212
docker_image_commands:
13-
- 'echo deb http://ftp.debian.org/debian jessie-backports main >> /etc/apt/sources.list'
1413
- 'apt-get update && apt-get install -y cron locales-all net-tools wget'
1514
- 'rm -f /usr/sbin/policy-rc.d'
1615
- 'systemctl mask [email protected] getty-static.service'
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
# This file is managed via modulesync
3+
# https://github.com/voxpupuli/modulesync
4+
# https://github.com/theforeman/foreman-installer-modulesync
5+
HOSTS:
6+
debian-9-x64:
7+
platform: debian-9-amd64
8+
hypervisor: docker
9+
image: debian:9
10+
docker_preserve_image: true
11+
docker_cmd: '["/sbin/init"]'
12+
docker_image_commands:
13+
- 'apt-get update && apt-get install -y cron locales-all net-tools wget systemd-sysv'
14+
- 'rm -f /usr/sbin/policy-rc.d'
15+
- 'systemctl mask [email protected] getty-static.service'
16+
CONFIG:
17+
trace_limit: 200
18+
masterless: true
19+
...
20+
# vim: syntax=yaml

spec/spec_helper.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
require 'simplecov-console'
99
SimpleCov.formatters = [
1010
SimpleCov::Formatter::HTMLFormatter,
11-
SimpleCov::Formatter::Console,
12-
Coveralls::SimpleCov::Formatter
11+
SimpleCov::Formatter::Console
1312
]
1413
SimpleCov.start do
1514
track_files 'lib/**/*.rb'

0 commit comments

Comments
 (0)