Skip to content

Commit d8c8069

Browse files
authored
Merge pull request bfraser#78 from voxpupuli/modulesync
modulesync 1.5.0
2 parents d7e1991 + f06a7c9 commit d8c8069

File tree

10 files changed

+105
-40
lines changed

10 files changed

+105
-40
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.5.0'

.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: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,36 +15,41 @@ script:
1515
matrix:
1616
fast_finish: true
1717
include:
18-
- rvm: 2.4.1
19-
bundler_args: --without development
18+
- rvm: 2.4.2
19+
bundler_args: --without development release
2020
dist: trusty
21-
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/ubuntu-14.04 CHECK=beaker
21+
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/ubuntu-16.04 CHECK=beaker
2222
services: docker
2323
sudo: required
24-
- rvm: 2.4.1
25-
bundler_args: --without development
24+
- rvm: 2.4.2
25+
bundler_args: --without development release
2626
dist: trusty
2727
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/centos-7 CHECK=beaker
2828
services: docker
2929
sudo: required
3030
- rvm: 2.1.9
31-
bundler_args: --without system_tests development
32-
env: PUPPET_VERSION="~> 4.0" CHECK=test
33-
- rvm: 2.4.1
34-
bundler_args: --without system_tests development
35-
env: PUPPET_VERSION="~> 5.0" CHECK=test
36-
- rvm: 2.4.1
37-
bundler_args: --without system_tests development
31+
bundler_args: --without system_tests development release
32+
env: PUPPET_VERSION="~> 4.0" CHECK=test PARALLEL_TEST_PROCESSORS=16
33+
- rvm: 2.4.2
34+
bundler_args: --without system_tests development release
35+
env: PUPPET_VERSION="~> 5.0" CHECK=test_with_coveralls
36+
- rvm: 2.4.2
37+
bundler_args: --without system_tests development release
3838
env: PUPPET_VERSION="~> 5.0" CHECK=rubocop
39-
- rvm: 2.4.1
40-
bundler_args: --without system_tests development
39+
- rvm: 2.4.2
40+
bundler_args: --without system_tests development release
4141
env: PUPPET_VERSION="~> 5.0" CHECK=build DEPLOY_TO_FORGE=yes
4242
branches:
4343
only:
4444
- master
4545
- /^v\d/
4646
notifications:
4747
email: false
48+
irc:
49+
on_success: always
50+
on_failure: always
51+
channels:
52+
- "chat.freenode.org#voxpupuli-notifications"
4853
deploy:
4954
provider: puppetforge
5055
user: puppet

Gemfile

Lines changed: 11 additions & 6 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.5.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 'toml', :require => false
3934
end
@@ -46,8 +41,11 @@ group :development do
4641
end
4742

4843
group :system_tests do
44+
gem 'winrm', :require => false
4945
if beaker_version = ENV['BEAKER_VERSION']
5046
gem 'beaker', *location_for(beaker_version)
47+
else
48+
gem 'beaker', '>= 3.9.0', :require => false
5149
end
5250
if beaker_rspec_version = ENV['BEAKER_RSPEC_VERSION']
5351
gem 'beaker-rspec', *location_for(beaker_rspec_version)
@@ -59,6 +57,13 @@ group :system_tests do
5957
gem 'beaker-module_install_helper', :require => false
6058
end
6159

60+
group :release do
61+
gem 'github_changelog_generator', :require => false if RUBY_VERSION >= '2.2.2'
62+
gem 'puppet-blacksmith', :require => false
63+
gem 'voxpupuli-release', :require => false, :git => 'https://github.com/voxpupuli/voxpupuli-release-gem'
64+
gem 'puppet-strings', '~> 1.0', :require => false
65+
end
66+
6267

6368

6469
if facterversion = ENV['FACTER_GEM_VERSION']

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 getty@tty1.service 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 getty@tty1.service 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)