Skip to content

Commit aefc377

Browse files
author
William Yardley
committed
modulesync 1.3.0
1 parent 09ae0f6 commit aefc377

8 files changed

Lines changed: 69 additions & 26 deletions

File tree

.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.3.0'

.rubocop.yml

Lines changed: 1 addition & 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

.travis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ matrix:
1818
- rvm: 2.1.9
1919
bundler_args: --without system_tests development
2020
env: PUPPET_VERSION="~> 4.0" CHECK=test
21-
- rvm: 2.4.1
21+
- rvm: 2.4.2
2222
bundler_args: --without system_tests development
23-
env: PUPPET_VERSION="~> 5.0" CHECK=test
24-
- rvm: 2.4.1
23+
env: PUPPET_VERSION="~> 5.0" CHECK=test_with_coveralls
24+
- rvm: 2.4.2
2525
bundler_args: --without system_tests development
2626
env: PUPPET_VERSION="~> 5.0" CHECK=rubocop
27-
- rvm: 2.4.1
27+
- rvm: 2.4.2
2828
bundler_args: --without system_tests development
2929
env: PUPPET_VERSION="~> 5.0" CHECK=build DEPLOY_TO_FORGE=yes
3030
branches:

Gemfile

Lines changed: 11 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
end
3934

@@ -45,6 +40,7 @@ group :development do
4540
end
4641

4742
group :system_tests do
43+
gem 'winrm', :require => false
4844
if beaker_version = ENV['BEAKER_VERSION']
4945
gem 'beaker', *location_for(beaker_version)
5046
end
@@ -55,14 +51,22 @@ group :system_tests do
5551
end
5652
gem 'serverspec', :require => false
5753
gem 'beaker-puppet_install_helper', :require => false
54+
gem 'beaker-module_install_helper', :require => false
55+
end
56+
57+
group :release do
58+
gem 'github_changelog_generator', :require => false if RUBY_VERSION >= '2.2.2'
59+
gem 'puppet-blacksmith', :require => false
60+
gem 'voxpupuli-release', :require => false, :git => 'https://github.com/voxpupuli/voxpupuli-release-gem'
61+
gem 'puppet-strings', '~> 1.0', :require => false
5862
end
5963

6064

6165

6266
if facterversion = ENV['FACTER_GEM_VERSION']
6367
gem 'facter', facterversion.to_s, :require => false, :groups => [:test]
6468
else
65-
gem 'facter', :require => false, :groups => [:test]
69+
gem 'facter', :require => false, :groups => [:test]
6670
end
6771

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

Rakefile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,17 @@ task test: [
3131
:release_checks,
3232
]
3333

34+
desc "Run main 'test' task and report merged results to coveralls"
35+
task test_with_coveralls: [:test] do
36+
if Dir.exist?(File.expand_path('../lib', __FILE__))
37+
require 'coveralls/rake/task'
38+
Coveralls::RakeTask.new
39+
Rake::Task['coveralls:push'].invoke
40+
else
41+
puts 'Skipping reporting to coveralls. Module has no lib dir'
42+
end
43+
end
44+
3445
begin
3546
require 'github_changelog_generator/task'
3647
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
@@ -39,6 +50,9 @@ begin
3950
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."
4051
config.exclude_labels = %w{duplicate question invalid wontfix wont-fix modulesync skip-changelog}
4152
config.user = 'voxpupuli'
53+
metadata_json = File.join(File.dirname(__FILE__), 'metadata.json')
54+
metadata = JSON.load(File.read(metadata_json))
55+
config.project = metadata['name']
4256
end
4357
rescue LoadError
4458
end
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)