Commit f3f5019a authored by Dennis Hoppe's avatar Dennis Hoppe

Update based on voxpupuli/modulesync_config

parent ba3f24cf
......@@ -5,5 +5,7 @@ spec/fixtures/
.vagrant/
.bundle/
coverage/
*.iml
log/
.idea/
*.iml
.*.sw
--format documentation
--color
\ No newline at end of file
--color
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
# Class length is not necessarily an indicator of code quality
Metrics/ClassLength:
Enabled: false
# dealbreaker:
Style/TrailingComma:
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
---
spec/spec_helper_acceptance.rb:
dependencies:
- puppetlabs-stdlib
- puppetlabs-java
spec/acceptance/nodesets/windows-2008R2-serverstandard-x64.yml:
unmanaged: true
.travis.yml:
secure: "j/Db/NnuJUwyFWGVwZEciC/0Xrhaes647UK49ZnlZTjUppUeTsqY/rKE8Pc4jpiW8DsfeGijCYP1O02tquH+KSKSwiwxIBjbToFjhNNJ6Qgh0DGIR29VZkiyirh5ZkK1yLMx9Ciyn8opwOXHqTRMk6JwAY05Gux1sD2T7Eu2c4w="
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: 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
......
This diff is collapsed.
# 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 '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.35.0', :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 "puppet-blacksmith"
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.8.4' : puppetversion = ENV['PUPPET_VERSION'].to_s
gem 'puppet', puppetversion, :require => false, :groups => [:test]
# vim:ft=ruby
# 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.
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-lint/tasks/puppet-lint'
require 'puppet-syntax/tasks/puppet-syntax'
require 'metadata-json-lint/rake_task'
require 'puppet_blacksmith/rake_tasks'
require 'voxpupuli/release/rake_tasks'
require 'rubocop/rake_task'
# These two gems aren't always present, for instance
# on Travis with --without development
begin
require 'puppet_blacksmith/rake_tasks'
rescue LoadError
end
RuboCop::RakeTask.new
PuppetLint.configuration.relative = true
PuppetLint.configuration.send("disable_80chars")
PuppetLint.configuration.log_format = "%{path}:%{linenumber}:%{check}:%{KIND}:%{message}"
PuppetLint.configuration.log_format = '%{path}:%{linenumber}:%{check}:%{KIND}:%{message}'
PuppetLint.configuration.fail_on_warnings = true
# Forsake support for Puppet 2.6.2 for the benefit of cleaner code.
# http://puppet-lint.com/checks/class_parameter_defaults/
PuppetLint.configuration.send('disable_class_parameter_defaults')
# http://puppet-lint.com/checks/class_inherits_from_params_class/
PuppetLint.configuration.send('relative')
PuppetLint.configuration.send('disable_80chars')
PuppetLint.configuration.send('disable_class_inherits_from_params_class')
PuppetLint.configuration.send('disable_documentation')
PuppetLint.configuration.send('disable_single_quote_string_with_variables')
exclude_paths = [
"pkg/**/*",
"vendor/**/*",
"spec/**/*",
]
exclude_paths = %w(
pkg/**/*
vendor/**/*
spec/**/*
)
PuppetLint.configuration.ignore_paths = exclude_paths
PuppetSyntax.exclude_paths = exclude_paths
desc "Run acceptance tests"
desc 'Run acceptance tests'
RSpec::Core::RakeTask.new(:acceptance) do |t|
t.pattern = 'spec/acceptance'
end
desc "Run syntax, lint, and spec tests."
task :test => [
:syntax,
desc 'Run metadata_lint, lint, syntax, and spec tests.'
task test: [
:metadata_lint,
:lint,
:syntax,
:spec,
]
......@@ -2,7 +2,7 @@
"name": "puppet-kafka",
"version": "1.0.3",
"author": "puppet",
"license": "Apache 2.0",
"license": "Apache-2.0",
"summary": "Module for managing apache kafka",
"source": "https://github.com/puppet-community/puppet-kafka",
"project_page": "https://github.com/puppet-community/puppet-kafka",
......
require 'spec_helper_acceptance'
describe 'kafka::broker class' do
context 'default parameters' do
# Using puppet_apply as a helper
it 'should work with no errors' do
......@@ -62,9 +61,9 @@ describe 'kafka::broker class' do
describe file('/opt/kafka/config/server.properties') do
it { should be_file }
its(:content) { should match /broker\.id=0/ }
its(:content) { should match /log\.dirs=\/tmp\/kafka-logs/ }
its(:content) { should match /port=6667/ }
its(:content) { should match(/broker\.id=0/) }
its(:content) { should match %r{ /log\.dirs=\/tmp\/kafka-logs/ } }
its(:content) { should match(/port=6667/) }
end
describe file('/etc/init.d/kafka') do
......@@ -74,6 +73,5 @@ describe 'kafka::broker class' do
describe service('kafka') do
it { should be_running }
end
end
end
require 'spec_helper_acceptance'
describe 'kafka class' do
context 'default parameters' do
it 'should work with no errors' do
if fact('osfamily') == 'RedHat'
......
......@@ -4,8 +4,6 @@ HOSTS:
- master
platform: el-5-x86_64
box: puppetlabs/centos-5.11-64-nocm
box_url: puppetlabs/centos-5.11-64-nocm
hypervisor: vagrant
CONFIG:
log_level: verbose
type: git
type: foss
HOSTS:
centos-66-x64:
roles:
- master
- database
- dashboard
platform: el-6-x86_64
box: puppetlabs/centos-6.6-64-puppet-enterprise
hypervisor: vagrant
CONFIG:
type: pe
......@@ -3,8 +3,7 @@ HOSTS:
roles:
- master
platform: el-6-x86_64
box : puppetlabs/centos-6.6-64-nocm
box_url : puppetlabs/centos-6.6-64-nocm
hypervisor : vagrant
box: puppetlabs/centos-6.6-64-nocm
hypervisor: vagrant
CONFIG:
type: foss
HOSTS:
centos-72-x64:
roles:
- master
platform: el-7-x86_64
box: puppetlabs/centos-7.2-64-nocm
hypervisor: vagrant
CONFIG:
type: foss
HOSTS:
debian-78-x64:
roles:
- master
platform: debian-7-amd64
box: puppetlabs/debian-7.8-64-nocm
hypervisor: vagrant
CONFIG:
type: foss
HOSTS:
debian-82-x64:
roles:
- master
platform: debian-8-amd64
box: puppetlabs/debian-8.2-64-nocm
hypervisor: vagrant
CONFIG:
type: foss
HOSTS:
ubuntu-1204-x64:
ubuntu-server-1204-x64:
roles:
- master
platform: ubuntu-12.04-amd64
box: puppetlabs/ubuntu-12.04-64-nocm
box_url: puppetlabs/ubuntu-12.04-64-nocm
hypervisor: vagrant
CONFIG:
type: foss
HOSTS:
ubuntu-1404-x64:
ubuntu-server-1404-x64:
roles:
- master
platform: ubuntu-14.04-amd64
box: puppetlabs/ubuntu-14.04-64-nocm
box_url: puppetlabs/ubuntu-14.04-64-nocm
hypervisor: vagrant
CONFIG:
log_level: debug
type: git
type: foss
......@@ -2,17 +2,19 @@ require 'spec_helper'
describe 'kafka::broker' do
context 'supported operating systems' do
describe "kafka class without any parameters on Debian" do
let(:params) {{ }}
let(:facts) {{
:osfamily => 'Debian',
:operatingsystem => 'ubuntu',
:operatingsystemrelease => '14.04',
:lsbdistcodename => 'lucid',
:architecture => 'amd64'
}}
#it { should compile.with_all_deps }
describe 'kafka class without any parameters on Debian' do
let(:params) { {} }
let(:facts) do
{
:osfamily => 'Debian',
:operatingsystem => 'ubuntu',
:operatingsystemrelease => '14.04',
:lsbdistcodename => 'lucid',
:architecture => 'amd64'
}
end
# it { should compile.with_all_deps }
it { should contain_class('kafka::broker::install').that_comes_before('kafka::broker::config') }
it { should contain_class('kafka::broker::config').that_comes_before('kafka::broker::service') }
......@@ -31,22 +33,23 @@ describe 'kafka::broker' do
it { should contain_file('/opt/kafka/config/server.properties').that_notifies('Service[kafka]') }
it { should contain_file('/var/log/kafka').with('ensure' => 'directory') }
it { should contain_service('kafka') }
end
describe "kafka class without any parameters on RedHat" do
let(:params) {{ }}
let(:facts) {{
:osfamily => 'RedHat',
:operatingsystem => 'centos',
:operatingsystemrelease => '6',
:architecture => 'amd64'
}}
describe 'kafka class without any parameters on RedHat' do
let(:params) { {} }
let(:facts) do
{
:osfamily => 'RedHat',
:operatingsystem => 'centos',
:operatingsystemrelease => '6',
:architecture => 'amd64'
}
end
#it { should compile.with_all_deps }
# it { should compile.with_all_deps }
it { should contain_class('kafka::broker::install').that_comes_before('kafka::broker::config') }
it { should contain_class('kafka::broker::config').that_comes_before('kafka::broker::service') }
......@@ -72,11 +75,13 @@ describe 'kafka::broker' do
context 'unsupported operating system' do
describe 'kafka class without any parameters on Solaris/Nexenta' do
let(:facts) {{
:osfamily => 'Solaris',
:operatingsystem => 'Nexenta',
:architecture => 'amd64'
}}
let(:facts) do
{
:osfamily => 'Solaris',
:operatingsystem => 'Nexenta',
:architecture => 'amd64'
}
end
it { expect { should contain_package('kafka') }.to raise_error(Puppet::Error, /Nexenta not supported/) }
end
......
require 'beaker-rspec'
require 'beaker-rspec/spec_helper'
require 'beaker-rspec/helpers/serverspec'
unless ENV['RS_PROVISION'] == 'no' or ENV['BEAKER_provision'] == 'no'
foss_opts = { :default_action => 'gem_install' }
install_puppet( foss_opts )
hosts.each do |_host|
version = ENV['PUPPET_GEM_VERSION']
install_puppet(:version => version)
end
RSpec.configure do |c|
......@@ -15,15 +15,14 @@ RSpec.configure do |c|
hosts.each do |host|
c.host = host
path = (File.expand_path(File.dirname(__FILE__)+'/../')).split('/')
name = path[path.length-1].split('-')[1]
path = (File.expand_path(File.dirname(__FILE__) + '/../')).split('/')
name = path[path.length - 1].split('-')[1]
copy_module_to(host, :source => proj_root, :module_name => name)
on host, puppet('module install puppetlabs-stdlib --version 4.5.1'), { :acceptable_exit_codes => [0] }
on host, puppet('module install puppetlabs-java --version 1.4.2'), { :acceptable_exit_codes => [0] }
on host, puppet('module install deric-zookeeper --version 0.3.9'), { :acceptable_exit_codes => [0] }
on host, puppet('module', 'install', 'puppetlabs-stdlib'), :acceptable_exit_codes => [0, 1]
on host, puppet('module', 'install', 'puppetlabs-java'), :acceptable_exit_codes => [0, 1]
on host, puppet('module', 'install', 'deric-zookeeper'), :acceptable_exit_codes => [0, 1]
end
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment