Sebastien Badia d28a4026b7 [spec] Update rake tasks (refs: #372)
Update the default task to clean fixtures, and don't run coverage report
(asked by @EmilienM).

New tasks:
  rake           => run all tests and clean fixtures (alias on :test)
  rake test      => run all tests and clean fixtures
  rake test_keep => run all tests and don't clean fixtures
  COV=y rake cov => run all tests, run coverage repo, and don't clean fixtures

Refs: #372
2014-03-21 10:29:42 +01:00

32 lines
1.1 KiB
Ruby

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')
# for manifest loadbalancer.pp +39 (default value as an array of variables)
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
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 => :test
desc 'Run syntax, lint and spec tests'
task :test => [:syntax,:lint,:spec]
desc 'Run syntax, lint and spec tests (without fixture purge = train/airplane)'
task :test_keep => [:syntax,:lint,:spec_prep,:spec_standalone]
if ENV['COV']
desc 'Run syntax, lint, spec tests and coverage'
task :cov => [:syntax,:lint,:spec_prep,:spec_standalone]
end