Skip to content
Snippets Groups Projects
Unverified Commit 454bd880 authored by Will Yardley's avatar Will Yardley Committed by GitHub
Browse files

Merge pull request #393 from voxpupuli/modulesync

modulesync 1.4.1
parents cd98f611 d2d8a649
No related branches found
No related tags found
No related merge requests found
This module has grown over time based on a range of contributions from This module has grown over time based on a range of contributions from
people using it. If you follow these contributing guidelines your patch people using it. If you follow these contributing guidelines your patch
will likely make it into a release a little quicker. will likely make it into a release a little more quickly.
## Contributing ## Contributing
...@@ -65,6 +65,10 @@ add tests if you're adding new functionality. If you've not used ...@@ -65,6 +65,10 @@ add tests if you're adding new functionality. If you've not used
[rspec-puppet](http://rspec-puppet.com/) before then feel free to ask [rspec-puppet](http://rspec-puppet.com/) before then feel free to ask
about how best to test your new feature. about how best to test your new feature.
To run the linter, the syntax checker and the unit tests:
bundle exec rake test
To run your all the unit tests To run your all the unit tests
bundle exec rake spec SPEC_OPTS='--format documentation' bundle exec rake spec SPEC_OPTS='--format documentation'
...@@ -73,10 +77,6 @@ To run a specific spec test set the `SPEC` variable: ...@@ -73,10 +77,6 @@ To run a specific spec test set the `SPEC` variable:
bundle exec rake spec SPEC=spec/foo_spec.rb bundle exec rake spec SPEC=spec/foo_spec.rb
To run the linter, the syntax checker and the unit tests:
bundle exec rake test
## Integration tests ## Integration tests
The unit tests just check the code runs, not that it does exactly what The unit tests just check the code runs, not that it does exactly what
...@@ -89,15 +89,20 @@ with: ...@@ -89,15 +89,20 @@ with:
bundle exec rake acceptance bundle exec rake acceptance
This will run the tests on an Ubuntu 12.04 virtual machine. You can also This will run the tests on the module's default nodeset. You can override the
run the integration tests against Centos 6.6 with. nodeset used, e.g.,
BEAKER_set=centos-7-x64 bundle exec rake acceptance
There are default rake tasks for the various acceptance test modules, e.g.,
BEAKER_set=centos-66-x64 bundle exec rake acceptances bundle exec rake beaker:centos-7-x64
bundle exec rake beaker:ssh:centos-7-x64
If you don't want to have to recreate the virtual machine every time you If you don't want to have to recreate the virtual machine every time you can
can use `BEAKER_DESTROY=no` and `BEAKER_PROVISION=no`. On the first run you will use `BEAKER_destroy=no` and `BEAKER_provision=no`. On the first run you will at
at least need `BEAKER_PROVISION` set to yes (the default). The Vagrantfile least need `BEAKER_provision` set to yes (the default). The Vagrantfile for the
for the created virtual machines will be in `.vagrant/beaker_vagrant_fies`. created virtual machines will be in `.vagrant/beaker_vagrant_files`.
The easiest way to debug in a docker container is to open a shell: The easiest way to debug in a docker container is to open a shell:
......
modulesync_config_version: '1.1.0' modulesync_config_version: '1.4.1'
...@@ -12,6 +12,7 @@ AllCops: ...@@ -12,6 +12,7 @@ AllCops:
- Gemfile - Gemfile
- Rakefile - Rakefile
- Guardfile - Guardfile
- Vagrantfile
Lint/ConditionPosition: Lint/ConditionPosition:
Enabled: True Enabled: True
...@@ -45,6 +46,9 @@ Style/HashSyntax: ...@@ -45,6 +46,9 @@ Style/HashSyntax:
Style/RedundantReturn: Style/RedundantReturn:
Enabled: True Enabled: True
Style/EndOfLine:
Enabled: False
Lint/AmbiguousOperator: Lint/AmbiguousOperator:
Enabled: True Enabled: True
...@@ -530,3 +534,12 @@ Layout/IndentHeredoc: ...@@ -530,3 +534,12 @@ Layout/IndentHeredoc:
# disable Yaml safe_load. This is needed to support ruby2.0.0 development envs # disable Yaml safe_load. This is needed to support ruby2.0.0 development envs
Security/YAMLLoad: Security/YAMLLoad:
Enabled: false Enabled: false
# This affects hiera interpolation, as well as some configs that we push.
Style/FormatStringToken:
Enabled: false
# This is useful, but sometimes a little too picky about where unit tests files
# are located.
RSpec/FilePath:
Enabled: false
...@@ -16,16 +16,16 @@ matrix: ...@@ -16,16 +16,16 @@ matrix:
fast_finish: true fast_finish: true
include: include:
- rvm: 2.1.9 - rvm: 2.1.9
bundler_args: --without system_tests development bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 4.0" CHECK=test env: PUPPET_VERSION="~> 4.0" CHECK=test
- rvm: 2.4.1 - rvm: 2.4.2
bundler_args: --without system_tests development bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=test env: PUPPET_VERSION="~> 5.0" CHECK=test_with_coveralls
- rvm: 2.4.1 - rvm: 2.4.2
bundler_args: --without system_tests development bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=rubocop env: PUPPET_VERSION="~> 5.0" CHECK=rubocop
- rvm: 2.4.1 - rvm: 2.4.2
bundler_args: --without system_tests development bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=build DEPLOY_TO_FORGE=yes env: PUPPET_VERSION="~> 5.0" CHECK=build DEPLOY_TO_FORGE=yes
branches: branches:
only: only:
...@@ -33,6 +33,11 @@ branches: ...@@ -33,6 +33,11 @@ branches:
- /^v\d/ - /^v\d/
notifications: notifications:
email: false email: false
irc:
on_success: always
on_failure: always
channels:
- "chat.freenode.org#voxpupuli-notifications"
deploy: deploy:
provider: puppetforge provider: puppetforge
user: puppet user: puppet
......
...@@ -11,7 +11,7 @@ def location_for(place, fake_version = nil) ...@@ -11,7 +11,7 @@ def location_for(place, fake_version = nil)
end end
group :test do group :test do
gem 'puppetlabs_spec_helper', '~> 2.2.0', :require => false gem 'puppetlabs_spec_helper', '~> 2.4.0', :require => false
gem 'rspec-puppet', '~> 2.5', :require => false gem 'rspec-puppet', '~> 2.5', :require => false
gem 'rspec-puppet-facts', :require => false gem 'rspec-puppet-facts', :require => false
gem 'rspec-puppet-utils', :require => false gem 'rspec-puppet-utils', :require => false
...@@ -22,18 +22,13 @@ group :test do ...@@ -22,18 +22,13 @@ group :test do
gem 'puppet-lint-unquoted_string-check', :require => false gem 'puppet-lint-unquoted_string-check', :require => false
gem 'puppet-lint-variable_contains_upcase', :require => false gem 'puppet-lint-variable_contains_upcase', :require => false
gem 'metadata-json-lint', :require => false gem 'metadata-json-lint', :require => false
gem 'puppet-blacksmith', :require => false
gem 'voxpupuli-release', :require => false, :git => 'https://github.com/voxpupuli/voxpupuli-release-gem'
gem 'puppet-strings', '~> 1.0', :require => false
gem 'redcarpet', :require => false gem 'redcarpet', :require => false
gem 'rubocop', '~> 0.49.1', :require => false if RUBY_VERSION >= '2.3.0' gem 'rubocop', '~> 0.49.1', :require => false if RUBY_VERSION >= '2.3.0'
gem 'rubocop-rspec', '~> 1.15.0', :require => false if RUBY_VERSION >= '2.3.0' gem 'rubocop-rspec', '~> 1.15.0', :require => false if RUBY_VERSION >= '2.3.0'
gem 'mocha', '>= 1.2.1', :require => false gem 'mocha', '>= 1.2.1', :require => false
gem 'coveralls', :require => false gem 'coveralls', :require => false
gem 'simplecov-console', :require => false gem 'simplecov-console', :require => false
gem 'github_changelog_generator', '~> 1.13.0', :require => false if RUBY_VERSION < '2.2.2'
gem 'rack', '~> 1.0', :require => false if RUBY_VERSION < '2.2.2' gem 'rack', '~> 1.0', :require => false if RUBY_VERSION < '2.2.2'
gem 'github_changelog_generator', :require => false if RUBY_VERSION >= '2.2.2'
gem 'parallel_tests', :require => false gem 'parallel_tests', :require => false
end end
...@@ -45,8 +40,11 @@ group :development do ...@@ -45,8 +40,11 @@ group :development do
end end
group :system_tests do group :system_tests do
gem 'winrm', :require => false
if beaker_version = ENV['BEAKER_VERSION'] if beaker_version = ENV['BEAKER_VERSION']
gem 'beaker', *location_for(beaker_version) gem 'beaker', *location_for(beaker_version)
else
gem 'beaker', '>= 3.9.0', :require => false
end end
if beaker_rspec_version = ENV['BEAKER_RSPEC_VERSION'] if beaker_rspec_version = ENV['BEAKER_RSPEC_VERSION']
gem 'beaker-rspec', *location_for(beaker_rspec_version) gem 'beaker-rspec', *location_for(beaker_rspec_version)
...@@ -55,6 +53,14 @@ group :system_tests do ...@@ -55,6 +53,14 @@ group :system_tests do
end end
gem 'serverspec', :require => false gem 'serverspec', :require => false
gem 'beaker-puppet_install_helper', :require => false gem 'beaker-puppet_install_helper', :require => false
gem 'beaker-module_install_helper', :require => false
end
group :release do
gem 'github_changelog_generator', :require => false if RUBY_VERSION >= '2.2.2'
gem 'puppet-blacksmith', :require => false
gem 'voxpupuli-release', :require => false, :git => 'https://github.com/voxpupuli/voxpupuli-release-gem'
gem 'puppet-strings', '~> 1.0', :require => false
end end
......
require 'puppetlabs_spec_helper/rake_tasks' require 'puppetlabs_spec_helper/rake_tasks'
# load optional tasks for releases
# only available if gem group releases is installed
begin
require 'puppet_blacksmith/rake_tasks' require 'puppet_blacksmith/rake_tasks'
require 'voxpupuli/release/rake_tasks' require 'voxpupuli/release/rake_tasks'
require 'puppet-strings/tasks' require 'puppet-strings/tasks'
rescue LoadError
end
PuppetLint.configuration.log_format = '%{path}:%{line}:%{check}:%{KIND}:%{message}' PuppetLint.configuration.log_format = '%{path}:%{line}:%{check}:%{KIND}:%{message}'
PuppetLint.configuration.fail_on_warnings = true PuppetLint.configuration.fail_on_warnings = true
...@@ -31,6 +37,17 @@ task test: [ ...@@ -31,6 +37,17 @@ task test: [
:release_checks, :release_checks,
] ]
desc "Run main 'test' task and report merged results to coveralls"
task test_with_coveralls: [:test] do
if Dir.exist?(File.expand_path('../lib', __FILE__))
require 'coveralls/rake/task'
Coveralls::RakeTask.new
Rake::Task['coveralls:push'].invoke
else
puts 'Skipping reporting to coveralls. Module has no lib dir'
end
end
begin begin
require 'github_changelog_generator/task' require 'github_changelog_generator/task'
GitHubChangelogGenerator::RakeTask.new :changelog do |config| GitHubChangelogGenerator::RakeTask.new :changelog do |config|
...@@ -39,6 +56,9 @@ begin ...@@ -39,6 +56,9 @@ begin
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." 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."
config.exclude_labels = %w{duplicate question invalid wontfix wont-fix modulesync skip-changelog} config.exclude_labels = %w{duplicate question invalid wontfix wont-fix modulesync skip-changelog}
config.user = 'voxpupuli' config.user = 'voxpupuli'
metadata_json = File.join(File.dirname(__FILE__), 'metadata.json')
metadata = JSON.load(File.read(metadata_json))
config.project = metadata['name']
end end
rescue LoadError rescue LoadError
end end
......
...@@ -10,7 +10,6 @@ HOSTS: ...@@ -10,7 +10,6 @@ HOSTS:
docker_preserve_image: true docker_preserve_image: true
docker_cmd: '["/sbin/init"]' docker_cmd: '["/sbin/init"]'
docker_image_commands: docker_image_commands:
- 'echo deb http://ftp.debian.org/debian wheezy-backports main >> /etc/apt/sources.list'
- 'apt-get update && apt-get install -y cron locales-all net-tools wget' - 'apt-get update && apt-get install -y cron locales-all net-tools wget'
CONFIG: CONFIG:
trace_limit: 200 trace_limit: 200
......
...@@ -10,7 +10,6 @@ HOSTS: ...@@ -10,7 +10,6 @@ HOSTS:
docker_preserve_image: true docker_preserve_image: true
docker_cmd: '["/sbin/init"]' docker_cmd: '["/sbin/init"]'
docker_image_commands: docker_image_commands:
- 'echo deb http://ftp.debian.org/debian jessie-backports main >> /etc/apt/sources.list'
- 'apt-get update && apt-get install -y cron locales-all net-tools wget' - 'apt-get update && apt-get install -y cron locales-all net-tools wget'
- 'rm -f /usr/sbin/policy-rc.d' - 'rm -f /usr/sbin/policy-rc.d'
- 'systemctl mask getty@tty1.service getty-static.service' - 'systemctl mask getty@tty1.service getty-static.service'
......
---
# This file is managed via modulesync
# https://github.com/voxpupuli/modulesync
# https://github.com/theforeman/foreman-installer-modulesync
HOSTS:
debian-9-x64:
platform: debian-9-amd64
hypervisor: docker
image: debian:9
docker_preserve_image: true
docker_cmd: '["/sbin/init"]'
docker_image_commands:
- 'apt-get update && apt-get install -y cron locales-all net-tools wget systemd-sysv'
- 'rm -f /usr/sbin/policy-rc.d'
- 'systemctl mask getty@tty1.service getty-static.service'
CONFIG:
trace_limit: 200
masterless: true
...
# vim: syntax=yaml
...@@ -8,8 +8,7 @@ if Dir.exist?(File.expand_path('../../lib', __FILE__)) ...@@ -8,8 +8,7 @@ if Dir.exist?(File.expand_path('../../lib', __FILE__))
require 'simplecov-console' require 'simplecov-console'
SimpleCov.formatters = [ SimpleCov.formatters = [
SimpleCov::Formatter::HTMLFormatter, SimpleCov::Formatter::HTMLFormatter,
SimpleCov::Formatter::Console, SimpleCov::Formatter::Console
Coveralls::SimpleCov::Formatter
] ]
SimpleCov.start do SimpleCov.start do
track_files 'lib/**/*.rb' track_files 'lib/**/*.rb'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment