Bootstrap testing of Puppet modules
This change adds the necessary tooling for doing proper testing of our home-grown Puppet modules. Change-Id: I6e3ba200c19dcf40dbb53b0968351c8d63810013
This commit is contained in:
parent
b284aad7ba
commit
8f0d8d0b3e
@ -0,0 +1,24 @@
|
||||
# Copyright 2015 Mirantis, Inc.
|
||||
#
|
||||
# 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'
|
||||
|
||||
group :development, :test do
|
||||
gem 'rake'
|
||||
gem "puppet", ENV['PUPPET_VERSION'] || '~> 3.4.0'
|
||||
gem 'rspec'
|
||||
gem 'rspec-puppet'
|
||||
gem 'rspec-puppet-facts'
|
||||
gem 'puppetlabs_spec_helper'
|
||||
gem 'metadata-json-lint'
|
||||
end
|
@ -0,0 +1,62 @@
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
diff-lcs (1.2.5)
|
||||
facter (1.7.6)
|
||||
hiera (1.3.4)
|
||||
json_pure
|
||||
json (1.8.3)
|
||||
json_pure (1.8.2)
|
||||
metaclass (0.0.4)
|
||||
metadata-json-lint (0.0.6)
|
||||
json
|
||||
spdx-licenses (~> 1.0)
|
||||
mocha (1.1.0)
|
||||
metaclass (~> 0.0.1)
|
||||
puppet (3.4.3)
|
||||
facter (~> 1.6)
|
||||
hiera (~> 1.0)
|
||||
rgen (~> 0.6.5)
|
||||
puppet-lint (1.1.0)
|
||||
puppet-syntax (2.0.0)
|
||||
rake
|
||||
puppetlabs_spec_helper (0.10.3)
|
||||
mocha
|
||||
puppet-lint
|
||||
puppet-syntax
|
||||
rake
|
||||
rspec-puppet
|
||||
rake (10.4.2)
|
||||
rgen (0.6.6)
|
||||
rspec (3.3.0)
|
||||
rspec-core (~> 3.3.0)
|
||||
rspec-expectations (~> 3.3.0)
|
||||
rspec-mocks (~> 3.3.0)
|
||||
rspec-core (3.3.2)
|
||||
rspec-support (~> 3.3.0)
|
||||
rspec-expectations (3.3.1)
|
||||
diff-lcs (>= 1.2.0, < 2.0)
|
||||
rspec-support (~> 3.3.0)
|
||||
rspec-mocks (3.3.2)
|
||||
diff-lcs (>= 1.2.0, < 2.0)
|
||||
rspec-support (~> 3.3.0)
|
||||
rspec-puppet (2.2.0)
|
||||
rspec
|
||||
rspec-puppet-facts (0.12.0)
|
||||
facter
|
||||
json
|
||||
rspec-support (3.3.0)
|
||||
spdx-licenses (1.0.0)
|
||||
json
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
metadata-json-lint
|
||||
puppet (~> 3.4.0)
|
||||
puppetlabs_spec_helper
|
||||
rake
|
||||
rspec
|
||||
rspec-puppet
|
||||
rspec-puppet-facts
|
@ -0,0 +1,25 @@
|
||||
require 'puppetlabs_spec_helper/rake_tasks'
|
||||
require 'puppet-lint/tasks/puppet-lint'
|
||||
require 'puppet-syntax/tasks/puppet-syntax'
|
||||
require 'metadata-json-lint/rake_task'
|
||||
|
||||
PuppetLint.configuration.fail_on_warnings = true
|
||||
PuppetLint.configuration.send('disable_80chars')
|
||||
PuppetLint.configuration.send('disable_class_inherits_from_params_class')
|
||||
PuppetLint.configuration.send('disable_class_parameter_defaults')
|
||||
|
||||
exclude_paths = [
|
||||
"pkg/**/*",
|
||||
"vendor/**/*",
|
||||
"spec/**/*",
|
||||
]
|
||||
PuppetLint.configuration.ignore_paths = exclude_paths
|
||||
PuppetSyntax.exclude_paths = exclude_paths
|
||||
|
||||
desc "Run metadata_lint, lint, syntax, and spec tests."
|
||||
task :test => [
|
||||
:metadata_lint,
|
||||
:lint,
|
||||
:syntax,
|
||||
:spec,
|
||||
]
|
@ -0,0 +1 @@
|
||||
../../../../lib
|
@ -0,0 +1 @@
|
||||
../../../../manifests
|
@ -0,0 +1 @@
|
||||
../../../../templates
|
@ -0,0 +1,6 @@
|
||||
--format
|
||||
s
|
||||
--colour
|
||||
--loadby
|
||||
mtime
|
||||
--backtrace
|
@ -0,0 +1,22 @@
|
||||
# Copyright 2015 Mirantis, Inc.
|
||||
#
|
||||
# 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 'rspec-puppet'
|
||||
|
||||
fixture_path = File.expand_path(File.join(__FILE__, '..', 'fixtures'))
|
||||
|
||||
RSpec.configure do |c|
|
||||
c.module_path = File.join(fixture_path, 'modules')
|
||||
c.manifest_dir = File.join(fixture_path, 'manifests')
|
||||
c.environmentpath = File.join(Dir.pwd, 'spec')
|
||||
end
|
Loading…
Reference in New Issue
Block a user