Rakefile : Verify Puppetfile syntax

A :validate_puppetfile task has been added to Rakefile so it is possible
to detect Puppetfile syntax error before merging future pull-request
This commit is contained in:
Yanis Guenane 2014-09-30 23:21:38 -04:00
parent 0b6a8ddd1e
commit 8917220195
2 changed files with 10 additions and 3 deletions

View File

@ -9,6 +9,7 @@ group :development, :test do
gem 'rspec'
gem 'json'
gem 'webmock'
gem 'r10k'
end
if puppetversion = ENV['PUPPET_GEM_VERSION']

View File

@ -28,14 +28,20 @@ task(:default).clear
task :default => :test
desc 'Run syntax, lint and spec tests'
task :test => [:syntax,:lint,:spec]
task :test => [:syntax,:lint,:validate_puppetfile,:spec]
desc 'Run syntax, lint and spec tests (without fixture purge = train/airplane)'
task :test_keep => [:syntax,:lint,:spec_prep,:spec_standalone]
task :test_keep => [:syntax,:lint,:validate_puppetfile,:spec_prep,:spec_standalone]
if ENV['COV']
desc 'Run syntax, lint, spec tests and coverage'
task :cov => [:syntax,:lint,:spec_prep,:spec_standalone]
task :cov => [:syntax,:lint,:validate_puppetfile,:spec_prep,:spec_standalone]
end
desc "Validate the Puppetfile syntax"
task :validate_puppetfile do
$stderr.puts "---> syntax:puppetfile"
sh "r10k puppetfile check"
end
namespace :module do