Commit 1d9d24ed authored by Markus Frosch's avatar Markus Frosch 📣

testing: Replace validate and use test meta task for travis

parent eef6a068
......@@ -17,27 +17,31 @@ matrix:
fast_finish: true
include:
- rvm: 2.4.0
env: PUPPET_VERSION="~> 4.0" CHECK=spec
env: PUPPET_VERSION="~> 4.0" CHECK=test
- rvm: 2.3.3
env: PUPPET_VERSION="~> 4.0" CHECK=spec
env: PUPPET_VERSION="~> 4.0" CHECK=test
- rvm: 2.2.6
env: PUPPET_VERSION="~> 4.0" CHECK=spec
env: PUPPET_VERSION="~> 4.0" CHECK=test
- rvm: 2.1.9
env: PUPPET_VERSION="~> 4.0" CHECK=spec
env: PUPPET_VERSION="~> 4.0" CHECK=test
- rvm: 2.1.9
env: PUPPET_VERSION="~> 3.8" STRICT_VARIABLES="yes" FUTURE_PARSER="yes" CHECK=spec
env: PUPPET_VERSION="~> 3.8" STRICT_VARIABLES="yes" FUTURE_PARSER="yes" CHECK=test
- rvm: 2.1.9
env: PUPPET_VERSION="~> 3.8" STRICT_VARIABLES="yes" CHECK=spec
env: PUPPET_VERSION="~> 3.8" STRICT_VARIABLES="yes" CHECK=test
- rvm: 1.9.3
env: PUPPET_VERSION="~> 3.8" STRICT_VARIABLES="yes" CHECK=spec
env: PUPPET_VERSION="~> 3.8" STRICT_VARIABLES="yes" CHECK=test
- rvm: 1.9.3
env: PUPPET_VERSION="~> 3.8" STRICT_VARIABLES="yes" FUTURE_PARSER="yes" CHECK=spec
env: PUPPET_VERSION="~> 3.8" STRICT_VARIABLES="yes" FUTURE_PARSER="yes" CHECK=test
- rvm: 1.9.3
env: PUPPET_VERSION="~> 3.6.0" CHECK=spec
env: PUPPET_VERSION="~> 3.6.0" CHECK=test
- rvm: 2.1.9
env: PUPPET_VERSION="~> 3.6.0" CHECK=spec
env: PUPPET_VERSION="~> 3.6.0" CHECK=test
allow_failures:
- rvm: 2.4.0
branches:
only:
- master
- /^v\d/
notifications:
email: false
#deploy:
......
require 'rubygems'
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-lint/tasks/puppet-lint'
PuppetLint.configuration.log_format = '%{path}:%{line}:%{check}:%{KIND}:%{message}'
PuppetLint.configuration.fail_on_warnings = true
PuppetLint.configuration.send('disable_80chars')
PuppetLint.configuration.send('disable_class_inherits_from_params_class')
PuppetLint.configuration.send('disable_selector_inside_resource')
PuppetLint.configuration.send('disable_only_variable_string')
PuppetLint.configuration.ignore_paths = [
exclude_paths = [
"spec/**/*.pp",
"serverspec/**/*.pp",
"pkg/**/*.pp",
......@@ -13,15 +16,8 @@ PuppetLint.configuration.ignore_paths = [
"vendor/**/*.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 =~ /spec\/fixtures/
end
Dir['templates/**/*.erb'].each do |template|
sh "erb -P -x -T '-' #{template} | ruby -c"
end
end
PuppetLint.configuration.ignore_paths = exclude_paths
PuppetSyntax.exclude_paths = exclude_paths
desc 'Run validate, spec, lint'
task test: %w(validate spec lint)
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