Skip to content

Commit 9cd2efe

Browse files
committedDec 10, 2014
tests: start using puppetlabs defaults
1 parent a3e6146 commit 9cd2efe

File tree

3 files changed

+33
-68
lines changed

3 files changed

+33
-68
lines changed
 

‎.travis.yml

+13-19
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,17 @@
11
---
22
language: ruby
3-
bundler_args: --without development
4-
before_install: rm Gemfile.lock || true
5-
rvm:
6-
- 1.8.7
7-
- 1.9.3
8-
- 2.0.0
9-
script: bundle exec rake test
10-
env:
11-
- PUPPET_VERSION="~> 2.7.0"
12-
- PUPPET_VERSION="~> 3.1.0"
13-
- PUPPET_VERSION="~> 3.2.0"
14-
- PUPPET_VERSION="~> 3.3.0"
15-
- PUPPET_VERSION="~> 3.4.0"
3+
bundler_args: --without system_tests
4+
script: "bundle exec rake validate && bundle exec rake lint && bundle exec rake spec SPEC_OPTS='--color --format documentation'"
165
matrix:
17-
exclude:
18-
- rvm: 2.0.0
19-
env: PUPPET_VERSION="~> 2.7.0"
20-
- rvm: 2.0.0
21-
env: PUPPET_VERSION="~> 3.1.0"
6+
fast_finish: true
7+
include:
8+
- rvm: 1.8.7
9+
env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.6.0"
10+
- rvm: 1.8.7
11+
env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.7.0"
2212
- rvm: 1.9.3
23-
env: PUPPET_VERSION="~> 2.7.0"
13+
env: PUPPET_GEM_VERSION="~> 3.0"
14+
- rvm: 2.0.0
15+
env: PUPPET_GEM_VERSION="~> 3.0"
16+
notifications:
17+
email: false

‎Gemfile

+6-28
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,7 @@
1-
source ENV['GEM_SOURCE'] || "https://rubygems.org"
1+
source 'https://rubygems.org'
22

3-
group :development, :test do
4-
gem 'rake', :require => false
5-
gem "rspec-puppet", :git => 'https://github.com/rodjek/rspec-puppet.git'
6-
gem 'puppetlabs_spec_helper', :require => false
7-
gem 'serverspec', :require => false
8-
gem 'puppet-lint', :require => false
9-
gem 'beaker', :require => false
10-
gem 'beaker-rspec', :require => false
11-
gem 'pry', :require => false
12-
gem 'simplecov', :require => false
13-
gem 'vagrant-wrapper', :require => false
14-
gem "puppet-syntax", :require => false
15-
end
16-
17-
if facterversion = ENV['FACTER_GEM_VERSION']
18-
gem 'facter', facterversion, :require => false
19-
else
20-
gem 'facter', :require => false
21-
end
22-
23-
if puppetversion = ENV['PUPPET_GEM_VERSION']
24-
gem 'puppet', puppetversion, :require => false
25-
else
26-
gem 'puppet', :require => false
27-
end
28-
29-
# vim:ft=ruby
3+
puppetversion = ENV.key?('PUPPET_VERSION') ? "= #{ENV['PUPPET_VERSION']}" : ['>= 3.3']
4+
gem 'puppet', puppetversion
5+
gem 'puppetlabs_spec_helper', '>= 0.1.0'
6+
gem 'puppet-lint', '>= 0.3.2'
7+
gem 'facter', '>= 1.7.0'

‎Rakefile

+14-21
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,18 @@
1+
require 'rubygems'
12
require 'puppetlabs_spec_helper/rake_tasks'
23
require 'puppet-lint/tasks/puppet-lint'
3-
require 'puppet-syntax/tasks/puppet-syntax'
4-
5-
PuppetLint.configuration.fail_on_warnings
6-
PuppetLint.configuration.send('relative')
74
PuppetLint.configuration.send('disable_80chars')
8-
PuppetLint.configuration.send('disable_class_inherits_from_params_class')
9-
PuppetLint.configuration.send('disable_class_parameter_defaults')
10-
PuppetLint.configuration.send('disable_documentation')
11-
PuppetLint.configuration.send('disable_single_quote_string_with_variables')
12-
exclude_paths = [
13-
"pkg/**/*",
14-
"vendor/**/*",
15-
"spec/**/*",
16-
]
17-
PuppetLint.configuration.ignore_paths = exclude_paths
18-
PuppetSyntax.exclude_paths = exclude_paths
5+
PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp"]
196

20-
desc "Run syntax, lint, and spec tests."
21-
task :test => [
22-
:syntax,
23-
:lint,
24-
:spec,
25-
]
7+
desc "Validate manifests, templates, and ruby files in lib."
8+
task :validate do
9+
Dir['manifests/**/*.pp'].each do |manifest|
10+
sh "puppet parser validate --noop #{manifest}"
11+
end
12+
Dir['lib/**/*.rb'].each do |lib_file|
13+
sh "ruby -c #{lib_file}"
14+
end
15+
Dir['templates/**/*.erb'].each do |template|
16+
sh "erb -P -x -T '-' #{template} | ruby -c"
17+
end
18+
end

0 commit comments

Comments
 (0)
Please sign in to comment.