Skip to content

Commit

Permalink
Upgrade to latest puppet-skeleton version from garethr
Browse files Browse the repository at this point in the history
  • Loading branch information
aerostitch committed Oct 13, 2016
1 parent f54f4d5 commit 70f4e7f
Show file tree
Hide file tree
Showing 7 changed files with 163 additions and 66 deletions.
8 changes: 3 additions & 5 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
Joseph Herlant (aerostitch)
Evan Brewer
Jeff Gage (jeffgage)
Evan Breznyik (evanbreznyik)
Alina Alexeeva
Joseph Herlant
Daniel Forsberg
Johan Bloemberg
10 changes: 1 addition & 9 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
source "https://rubygems.org"
source ENV['GEM_SOURCE'] || 'https://rubygems.org'

group :test do
gem "json_pure", '2.0.1' if RUBY_VERSION < '2.0'
Expand All @@ -15,12 +15,4 @@ end
group :development do
gem "travis"
gem "travis-lint"
gem "vagrant-wrapper"
gem "puppet-blacksmith"
gem "guard-rake"
end

group :development, :system_tests do
gem "beaker"
gem "beaker-rspec"
end
118 changes: 118 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (2.2.8)
addressable (2.4.0)
ast (2.3.0)
backports (3.6.8)
connection_pool (2.2.0)
diff-lcs (1.2.5)
ethon (0.9.1)
ffi (>= 1.3.0)
facter (2.4.6)
CFPropertyList (~> 2.2.6)
faraday (0.9.2)
multipart-post (>= 1.2, < 3)
faraday_middleware (0.10.0)
faraday (>= 0.7.4, < 0.10)
ffi (1.9.14)
gh (0.14.0)
addressable
backports
faraday (~> 0.8)
multi_json (~> 1.0)
net-http-persistent (>= 2.7)
net-http-pipeline
hiera (3.2.1)
highline (1.7.8)
json (2.0.2)
json_pure (1.8.3)
launchy (2.4.3)
addressable (~> 2.3)
metaclass (0.0.4)
metadata-json-lint (0.0.11)
json
spdx-licenses (~> 1.0)
mocha (1.2.0)
metaclass (~> 0.0.1)
multi_json (1.12.1)
multipart-post (2.0.0)
net-http-persistent (3.0.0)
connection_pool (~> 2.2)
net-http-pipeline (1.0.1)
parser (2.3.1.4)
ast (~> 2.2)
powerpack (0.1.1)
puppet (4.7.0)
CFPropertyList (~> 2.2.6)
facter (> 2.0, < 4)
hiera (>= 2.0, < 4)
json_pure (~> 1.8)
puppet-lint (2.0.2)
puppet-syntax (2.1.0)
rake
puppetlabs_spec_helper (1.2.2)
mocha (~> 1.0)
puppet-lint (~> 2.0)
puppet-syntax (~> 2.0)
rspec-puppet (~> 2.0)
pusher-client (0.6.2)
json
websocket (~> 1.0)
rainbow (2.1.0)
rake (11.3.0)
rspec (3.5.0)
rspec-core (~> 3.5.0)
rspec-expectations (~> 3.5.0)
rspec-mocks (~> 3.5.0)
rspec-core (3.5.4)
rspec-support (~> 3.5.0)
rspec-expectations (3.5.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.5.0)
rspec-mocks (3.5.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.5.0)
rspec-puppet (2.4.0)
rspec
rspec-support (3.5.0)
rubocop (0.44.1)
parser (>= 2.3.1.1, < 3.0)
powerpack (~> 0.1)
rainbow (>= 1.99.1, < 3.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
ruby-progressbar (1.8.1)
spdx-licenses (1.1.0)
travis (1.8.2)
backports
faraday (~> 0.9)
faraday_middleware (~> 0.9, >= 0.9.1)
gh (~> 0.13)
highline (~> 1.6)
launchy (~> 2.1)
pusher-client (~> 0.4)
typhoeus (~> 0.6, >= 0.6.8)
travis-lint (2.0.0)
json
typhoeus (0.8.0)
ethon (>= 0.8.0)
unicode-display_width (1.1.1)
websocket (1.2.3)

PLATFORMS
ruby

DEPENDENCIES
facter (>= 1.7.0)
metadata-json-lint
puppet (>= 3.3)
puppet-lint (>= 1.0.0)
puppetlabs_spec_helper (>= 1.0.0)
rspec-puppet
rubocop
travis
travis-lint

BUNDLED WITH
1.13.3
69 changes: 24 additions & 45 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,53 +1,32 @@
require 'puppet/version'
# Does not work with Puppet <= 3.5
# Seems the same error as: https://github.com/maestrodev/puppet-blacksmith/issues/14
require 'puppet/vendor/semantic/lib/semantic' unless Puppet.version.to_f <3.6
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-lint/tasks/puppet-lint'
require 'puppet-syntax/tasks/puppet-syntax'
require 'metadata-json-lint/rake_task'

# These gems aren't always present, for instance
# on Travis with --without development
begin
require 'puppet_blacksmith/rake_tasks'
rescue LoadError
if RUBY_VERSION >= '1.9'
require 'rubocop/rake_task'
RuboCop::RakeTask.new
end

Rake::Task[:lint].clear

PuppetLint.configuration.send('disable_80chars')
PuppetLint.configuration.relative = true
PuppetLint.configuration.send("disable_80chars")
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('disable_class_inherits_from_params_class')

exclude_paths = [
"bundle/**/*",
"pkg/**/*",
"vendor/**/*",
"spec/**/*",
]
PuppetLint.configuration.ignore_paths = exclude_paths
PuppetSyntax.exclude_paths = exclude_paths

desc "Run acceptance tests"
RSpec::Core::RakeTask.new(:acceptance) do |t|
t.pattern = 'spec/acceptance'
PuppetLint.configuration.ignore_paths = ['spec/**/*.pp', 'pkg/**/*.pp']

desc 'Validate manifests, templates, and ruby files'
task :validate do
Dir['manifests/**/*.pp'].each do |manifest|
sh "puppet parser validate --noop #{manifest}"
end
Dir['spec/**/*.rb', 'lib/**/*.rb'].each do |ruby_file|
sh "ruby -c #{ruby_file}" unless ruby_file =~ %r{spec/fixtures}
end
Dir['templates/**/*.erb'].each do |template|
sh "erb -P -x -T '-' #{template} | ruby -c"
end
end

# task :metadata do
# sh "metadata-json-lint metadata.json"
# end

desc "Run syntax, lint, and spec tests."
task :test => [
:syntax,
:lint,
:spec,
# :metadata,
]
desc 'Run metadata_lint, lint, validate, and spec tests.'
task :test do
[:metadata_lint, :lint, :validate, :spec].each do |test|
Rake::Task[test].invoke
end
end
12 changes: 12 additions & 0 deletions examples/init.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# The baseline for module testing used by Puppet Labs is that each manifest
# should have a corresponding test manifest that declares that class or defined
# type.
#
# Tests are then run by using puppet apply --noop (to check for compilation
# errors and view a log of events) or by fully applying the test in a virtual
# environment (to compare the resulting system state to the desired state).
#
# Learn more about module testing here:
# https://docs.puppet.com/guides/tests_smoke.html
#
include ::maxscale
6 changes: 3 additions & 3 deletions spec/acceptance/class_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ class { 'maxscale': }
end

describe package('maxscale') do
it { should be_installed }
it { is_expected.to be_installed }
end

describe service('maxscale') do
it { should be_enabled }
it { should be_running }
it { is_expected.to be_enabled }
it { is_expected.to be_running }
end
end
end
6 changes: 2 additions & 4 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
require 'beaker-rspec/spec_helper'
require 'beaker-rspec/helpers/serverspec'
require 'beaker/puppet_install_helper'

hosts.each do |host|
# Install Puppet
install_puppet
end
run_puppet_install_helper unless ENV['BEAKER_provision'] == 'no'

RSpec.configure do |c|
# Project root
Expand Down

0 comments on commit 70f4e7f

Please sign in to comment.