[rakefile] Add code coverage and enable syntax checks (refs: #372)

This commit is contained in:
Sebastien Badia
2014-03-21 00:48:52 +01:00
parent 638b960441
commit 2b6b0d022f
2 changed files with 11 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-lint/tasks/puppet-lint'
require 'puppet-syntax/tasks/puppet-syntax'
PuppetLint.configuration.fail_on_warnings = true
PuppetLint.configuration.send('disable_80chars')
@@ -8,7 +9,15 @@ PuppetLint.configuration.send('disable_class_parameter_defaults')
# For stonith-enabled (it's a string not a bool)
PuppetLint.configuration.send('disable_quoted_booleans')
# Ignore all upstream modules
PuppetLint.configuration.ignore_paths = ['spec/fixtures/modules/**/*.pp','examples/*.pp']
exclude_paths = ['spec/**/*','pkg/**/*','vendor/**/*']
exclude_lint_paths = exclude_paths + ['examples/*.pp']
PuppetLint.configuration.ignore_paths = exclude_lint_paths
PuppetSyntax.exclude_paths = exclude_paths
task(:default).clear
task :default => [:spec_prep, :spec_standalone, :lint]
desc 'Run syntax, lint and spec tests'
task :test => [:syntax,:lint,:spec]

View File

@@ -0,0 +1 @@
at_exit { RSpec::Puppet::Coverage.report! }