diff options
author | varac <varacanero@zeromail.org> | 2016-06-11 21:10:21 +0200 |
---|---|---|
committer | varac <varacanero@zeromail.org> | 2016-06-11 21:32:20 +0200 |
commit | 08b1237a09254382fb746162f146acb7ed109c0e (patch) | |
tree | 4339b82db02700790b3ef8466dddf02d404229d0 | |
parent | 5fb5beff4c4d97dec2fcdab78d530e2c0b1d1cc9 (diff) |
Added rake task catalog:all to test catalog compile
-rw-r--r-- | Gemfile | 4 | ||||
-rw-r--r-- | Rakefile | 30 |
2 files changed, 33 insertions, 1 deletions
@@ -3,11 +3,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 "puppet", ENV['PUPPET_VERSION'] || ENV['GEM_PUPPET_VERSION'] || ENV['PUPPET_GEM_VERSION'] || '~> 3.8' 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" + gem "puppet-catalog-test" + gem "leap_cli" end @@ -1,6 +1,7 @@ require 'puppetlabs_spec_helper/rake_tasks' require 'puppet-lint/tasks/puppet-lint' require 'puppet-syntax/tasks/puppet-syntax' +require 'puppet-catalog-test' # return list of modules, either # submodules, custom or all modules @@ -53,5 +54,34 @@ task :templates do end end +desc "Compile hiera config for test_provider" +task :test_provider_compile do + sh "cd tests/puppet/provider; bundle exec leap compile" +end + +namespace :catalog do + PuppetCatalogTest::RakeTask.new(:all) do |t| + Rake::Task["test_provider_compile"].invoke + t.module_paths = ["puppet/modules"] + t.manifest_path = File.join("puppet","manifests", "site.pp") + t.facts = { + "operatingsystem" => "Debian", + "osfamily" => "Debian", + "operatingsystemmajrelease" => "8", + "debian_release" => "stable", + "debian_codename" => "jessie", + "lsbdistcodename" => "jessie", + "concat_basedir" => "/var/lib/puppet/concat", + "interfaces" => "eth0" + } + + # crucial option for hiera integration + t.config_dir = File.join("tests/puppet") # expects hiera.yaml to be included in directory + + # t.parser = "future" + t.verbose = true + end +end + desc "Run all puppet checks required for CI (syntax , validate, spec, lint)" task :test => [:syntax , :validate, :templates, :spec, :lint] |