From 26302eff4d471af607c0a9a67ef3025f4a2542eb Mon Sep 17 00:00:00 2001 From: varac Date: Mon, 18 Apr 2016 16:42:13 +0200 Subject: initial Rakefile and Gemfile for tests --- Gemfile | 13 +++++++++++++ Rakefile | 20 ++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 Gemfile create mode 100644 Rakefile diff --git a/Gemfile b/Gemfile new file mode 100644 index 00000000..8925a904 --- /dev/null +++ b/Gemfile @@ -0,0 +1,13 @@ +source "https://rubygems.org" + +group :test do + gem "rake" + gem "rspec", '< 3.2.0' + gem "puppet", ENV['PUPPET_VERSION'] || ENV['GEM_PUPPET_VERSION'] || ENV['PUPPET_GEM_VERSION'] || '~> 3.7.0' + gem "facter", ENV['FACTER_VERSION'] || ENV['GEM_FACTER_VERSION'] || ENV['FACTER_GEM_VERSION'] || '~> 2.2.0' + gem "rspec-puppet" + gem "puppetlabs_spec_helper" + gem "metadata-json-lint" + gem "rspec-puppet-facts" + gem "mocha" +end diff --git a/Rakefile b/Rakefile new file mode 100644 index 00000000..5a3936f8 --- /dev/null +++ b/Rakefile @@ -0,0 +1,20 @@ +require 'puppetlabs_spec_helper/rake_tasks' +require 'puppet-lint/tasks/puppet-lint' +require 'puppet-syntax/tasks/puppet-syntax' + +# redefine lint task with specific configuration +Rake::Task[:lint].clear +PuppetLint::RakeTask.new :lint do |config| + # Pattern of files to check, defaults to `**/*.pp` + config.pattern = ['puppet/modules/site_*/**/*.pp'] + #config.ignore_paths = ['puppet/modules/apache/**/*.pp'] + config.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp"] + config.disable_checks = ['documentation', '80chars'] + config.fail_on_warnings = false +end + +# rake syntax::* tasks +PuppetSyntax.exclude_paths = ["**/vendor/**/*"] + +desc "Run all puppet checks required for CI" +task :test => [:lint, :syntax , :validate, :spec] -- cgit v1.2.3