Skip to content

Commit

Permalink
Update from voxpupuli modulesync_config
Browse files Browse the repository at this point in the history
  • Loading branch information
Joseph Yaworski committed Mar 17, 2016
1 parent 457495a commit 50cdf18
Show file tree
Hide file tree
Showing 22 changed files with 382 additions and 159 deletions.
13 changes: 8 additions & 5 deletions .gitignore
@@ -1,8 +1,11 @@
*.swp
*.swo
*.swn
pkg/
Gemfile.lock
vendor/
spec/fixtures/
.vagrant/
.bundle/
vendor/
Gemfile.lock
coverage/
log/
.idea/
*.iml
.*.sw
2 changes: 2 additions & 0 deletions .rspec
@@ -0,0 +1,2 @@
--format documentation
--color
70 changes: 70 additions & 0 deletions .rubocop.yml
@@ -0,0 +1,70 @@
AllCops:
Include:
- ./**/*.rb
Exclude:
- vendor/**/*
- pkg/**/*
- spec/fixtures/**/*

# Configuration parameters: AllowURI, URISchemes.
Metrics/LineLength:
Max: 328

# 'Complexity' is very relative
Metrics/PerceivedComplexity:
Enabled: false

# 'Complexity' is very relative
Metrics/CyclomaticComplexity:
Enabled: false

# 'Complexity' is very relative
Metrics/AbcSize:
Enabled: false

# Method length is not necessarily an indicator of code quality
Metrics/MethodLength:
Enabled: false

# Module length is not necessarily an indicator of code quality
Metrics/ModuleLength:
Enabled: false

# Class length is not necessarily an indicator of code quality
Metrics/ClassLength:
Enabled: false

# dealbreaker:
Style/TrailingCommaInArguments:
Enabled: false
Style/TrailingCommaInLiteral:
Enabled: false
Style/ClosingParenthesisIndentation:
Enabled: false

# we still support ruby 1.8
Style/HashSyntax:
Enabled: false

Lint/AmbiguousRegexpLiteral:
Enabled: true
Style/RegexpLiteral:
Enabled: true
Style/WordArray:
Enabled: true

# this catches the cases of using `module` for parser functions, types, or
# providers
Style/ClassAndModuleChildren:
Enabled: false

Style/Documentation:
Description: 'Document classes and non-namespace modules.'
Enabled: false

# More comfortable block layouts
Style/BlockDelimiters:
Enabled: False

Style/MultilineBlockLayout:
Enabled: False
3 changes: 3 additions & 0 deletions .sync.yml
@@ -0,0 +1,3 @@
---
.travis.yml:
secure: "Hw0ScFZ+tANSuxXvkQlHOtbnV+9O6FyIxY4e8ZuNiE+4E045olgGjqus+ffo0MoHOHzCPPbThF107yQIXXHCwIy3wzOVIjQ7KQ/yVeamCl4K9A4AFP1Pcr/zMTRdK16zrgxBH+6wDkjSxHGonT8AyUKBrT7AeET+pqxwVHvHCfo="
44 changes: 28 additions & 16 deletions .travis.yml
@@ -1,32 +1,44 @@
notifications:
email: false
language: ruby
bundler_args: --without development system_tests
---
sudo: false
language: ruby
cache: bundler
bundler_args: --without system_tests
before_install: rm Gemfile.lock || true
script: bundle exec rake test
script:
- 'bundle exec rake $CHECK'
matrix:
fast_finish: true
include:
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 3.0" FACTER_GEM_VERSION="~> 1.7.0"
- rvm: 1.9.3
env: PUPPET_GEM_VERSION="~> 3.0"
- rvm: 2.0.0
env: PUPPET_GEM_VERSION="~> 3.0"
- rvm: 2.0.0
env: PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER="yes"
- rvm: 2.1.0
env: PUPPET_GEM_VERSION="~> 3.0" STRICT_VARIABLES=yes FUTURE_PARSER="yes"

env: PUPPET_VERSION="~> 3.0" STRICT_VARIABLES="yes" CHECK=test
- rvm: 2.1.8
env: PUPPET_VERSION="~> 3.0" STRICT_VARIABLES="yes" CHECK=test
- rvm: 1.9.3
env: PUPPET_VERSION="~> 3.0" STRICT_VARIABLES="yes" CHECK=test FUTURE_PARSER=yes
- rvm: 2.1.8
env: PUPPET_VERSION="~> 3.0" STRICT_VARIABLES="yes" CHECK=test FUTURE_PARSER=yes
- rvm: 2.1.8
env: PUPPET_VERSION="~> 4.0" STRICT_VARIABLES="yes" CHECK=test
- rvm: 2.2.4
env: PUPPET_VERSION="~> 4.0" STRICT_VARIABLES="yes" CHECK=test
- rvm: 2.2.4
env: PUPPET_VERSION="~> 4.0" STRICT_VARIABLES="yes" CHECK=rubocop
- rvm: 2.3.0
env: PUPPET_VERSION="~> 4.0" STRICT_VARIABLES="yes" CHECK=test
allow_failures:
- rvm: 2.3.0
env: PUPPET_VERSION="~> 4.0" STRICT_VARIABLES="yes" CHECK=test
notifications:
email: false
deploy:
provider: puppetforge
user: puppet
password:
secure: "Hw0ScFZ+tANSuxXvkQlHOtbnV+9O6FyIxY4e8ZuNiE+4E045olgGjqus+ffo0MoHOHzCPPbThF107yQIXXHCwIy3wzOVIjQ7KQ/yVeamCl4K9A4AFP1Pcr/zMTRdK16zrgxBH+6wDkjSxHGonT8AyUKBrT7AeET+pqxwVHvHCfo="

on:
tags: true
# all_branches is required to use tags
all_branches: true
# Only publish if our main Ruby target builds
rvm: 1.9.3
condition: "$FUTURE_PARSER = yes"
96 changes: 96 additions & 0 deletions CONTRIBUTING.md
@@ -0,0 +1,96 @@
This module has grown over time based on a range of contributions from
people using it. If you follow these contributing guidelines your patch
will likely make it into a release a little quicker.


## Contributing

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. [Contributor Code of Conduct](https://voxpupuli.org/coc/).

1. Fork the repo.

1. Create a separate branch for your change.

1. Run the tests. We only take pull requests with passing tests, and
documentation.

1. Add a test for your change. Only refactoring and documentation
changes require no new tests. If you are adding functionality
or fixing a bug, please add a test.

1. Squash your commits down into logical components. Make sure to rebase
against the current master.

1. Push the branch to your fork and submit a pull request.

Please be prepared to repeat some of these steps as our contributors review
your code.

## Dependencies

The testing and development tools have a bunch of dependencies,
all managed by [bundler](http://bundler.io/) according to the
[Puppet support matrix](http://docs.puppetlabs.com/guides/platforms.html#ruby-versions).

By default the tests use a baseline version of Puppet.

If you have Ruby 2.x or want a specific version of Puppet,
you must set an environment variable such as:

export PUPPET_VERSION="~> 4.2.0"

Install the dependencies like so...

bundle install

## Syntax and style

The test suite will run [Puppet Lint](http://puppet-lint.com/) and
[Puppet Syntax](https://github.com/gds-operations/puppet-syntax) to
check various syntax and style things. You can run these locally with:

bundle exec rake lint
bundle exec rake validate

## Running the unit tests

The unit test suite covers most of the code, as mentioned above please
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
about how best to test your new feature.

To run your all the unit tests

bundle exec rake spec SPEC_OPTS='--format documentation'

To run a specific spec test set the `SPEC` variable:

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

The unit tests just check the code runs, not that it does exactly what
we want on a real machine. For that we're using
[beaker](https://github.com/puppetlabs/beaker).

This fires up a new virtual machine (using vagrant) and runs a series of
simple tests against it after applying the module. You can run this
with:

bundle exec rake acceptance

This will run the tests on an Ubuntu 12.04 virtual machine. You can also
run the integration tests against Centos 6.5 with.

BEAKER_set=centos-64-x64 bundle exec rake acceptances

If you don't want to have to recreate the virtual machine every time you
can use `BEAKER_DESTROY=no` and `BEAKER_PROVISION=no`. On the first run you will
at least need `BEAKER_PROVISION` set to yes (the default). The Vagrantfile
for the created virtual machines will be in `.vagrant/beaker_vagrant_fies`.

82 changes: 54 additions & 28 deletions Gemfile
@@ -1,38 +1,64 @@
# Copyright 2014 Puppet Community
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

source "https://rubygems.org"
source ENV['GEM_SOURCE'] || "https://rubygems.org"

def location_for(place, fake_version = nil)
if place =~ /^(git[:@][^#]*)#(.*)/
[fake_version, { :git => $1, :branch => $2, :require => false }].compact
elsif place =~ /^file:\/\/(.*)/
['>= 0', { :path => File.expand_path($1), :require => false }]
else
[place, { :require => false }]
end
end

group :test do
gem "rake"
gem "puppet", ENV['PUPPET_VERSION'] || '~> 3.7.0'
gem "rspec-puppet", :git => 'https://github.com/rodjek/rspec-puppet.git'
gem "puppetlabs_spec_helper"
gem "metadata-json-lint"
gem "rspec-puppet-facts"
gem "rspec", "< 3.2.0", { "platforms" => ["ruby_18"] }
gem "puppet-blacksmith", "> 3.3.0", { "platforms" => ["ruby_19", "ruby_20", "ruby_21"] }
gem 'rake', :require => false
gem 'rspec-puppet', :require => false, :git => 'https://github.com/rodjek/rspec-puppet.git'
gem 'puppet-lint', :require => false, :git => 'https://github.com/rodjek/puppet-lint.git'
gem 'metadata-json-lint', :require => false
gem 'rspec-puppet-facts', :require => false
gem 'rspec', :require => false
gem 'puppet-blacksmith', :require => false, :git => 'https://github.com/voxpupuli/puppet-blacksmith.git'
gem 'voxpupuli-release', :require => false, :git => 'https://github.com/voxpupuli/voxpupuli-release-gem.git'
gem 'rubocop', '~> 0.38', :require => false
gem 'rspec-puppet-utils', :require => false
gem 'puppetlabs_spec_helper', :require => false
gem 'puppet-lint-absolute_classname-check', :require => false
gem 'puppet-lint-leading_zero-check', :require => false
gem 'puppet-lint-trailing_comma-check', :require => false
gem 'puppet-lint-version_comparison-check', :require => false
gem 'puppet-lint-classes_and_types_beginning_with_digits-check', :require => false
gem 'puppet-lint-unquoted_string-check', :require => false
gem 'puppet-lint-variable_contains_upcase', :require => false
end

group :development do
gem "travis"
gem "travis-lint"
gem "guard-rake"
gem 'travis', :require => false
gem 'travis-lint', :require => false
gem 'guard-rake', :require => false
end

group :system_tests do
gem "beaker"
gem "beaker-rspec"
gem 'beaker', :require => false
if beaker_version = ENV['BEAKER_VERSION']
gem 'beaker', *location_for(beaker_version)
end
if beaker_rspec_version = ENV['BEAKER_RSPEC_VERSION']
gem 'beaker-rspec', *location_for(beaker_rspec_version)
else
gem 'beaker-rspec', :require => false
end
gem 'beaker-puppet_install_helper', :require => false
end



if facterversion = ENV['FACTER_GEM_VERSION']
gem 'facter', facterversion.to_s, :require => false, :groups => [:test]
else
gem 'facter', :require => false, :groups => [:test]
end

ENV['PUPPET_VERSION'].nil? ? puppetversion = '~> 3.0' : puppetversion = ENV['PUPPET_VERSION'].to_s
gem 'puppet', puppetversion, :require => false, :groups => [:test]

# vim:ft=ruby

0 comments on commit 50cdf18

Please sign in to comment.