puppet-catalog-test 0.3.1 → 0.3.2.pre

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -15,13 +15,15 @@ For a more detailed insight into the puppet-compiler, you can take a look at <ht
15
15
  ## Usage
16
16
  ```bash
17
17
  $ puppet-catalog-test -h
18
-
19
18
  USAGE: puppet-catalog-test [options]
20
19
  -m, --module-paths PATHS Location of puppet modules, separated by collon
21
20
  -M, --manifest-path PATH Location of the puppet manifests (site.pp)
21
+ -H, --hiera-config PATH Location of hiera.yaml file
22
22
  -i, --include-pattern PATTERN Include only test cases that match pattern
23
23
  -e, --exclude-pattern PATTERN Exclude test cases that match pattern
24
24
  -s, --scenario FILE Scenario definition to use
25
+ -v, --verbose Verbose
26
+ -x, --xml Use xml report
25
27
  -h, --help Show this message
26
28
  ```
27
29
  ## Examples
@@ -184,6 +186,25 @@ namespace :catalog do
184
186
  end
185
187
  ```
186
188
 
189
+ ## Testing with hiera
190
+
191
+ Hiera configuration is loaded by setting the **config_dir** parameter in rake task or using the **-H, --hiera-config PATH** switch.
192
+
193
+ ```ruby
194
+ require 'puppet-catalog-test'
195
+ require 'puppet-catalog-test/junit_xml_reporter'
196
+
197
+ namespace :catalog do
198
+ PuppetCatalogTest::RakeTask.new(:all) do |t|
199
+ t.module_paths = [File.join("modules")]
200
+ t.manifest_path = File.join("scripts", "site.pp")
201
+ t.config_dir = File.join("data") # expects hiera.yaml to be included in directory
202
+
203
+ t.reporter = PuppetCatalogTest::JunitXmlReporter.new("puppet-vagrant-playground", "reports/puppet_catalog.xml")
204
+ end
205
+ end
206
+ ```
207
+
187
208
  # Credits
188
209
 
189
210
  Code is based upon the previous work done on https://github.com/oldNoakes/puppetTesting
@@ -22,12 +22,11 @@ module PuppetCatalogTest
22
22
  @exit_on_fail = true
23
23
  @out = stdout_target
24
24
 
25
-
26
25
  if puppet_config[:xml]
27
- require 'puppet-catalog-test/junit_xml_reporter'
28
- @reporter = PuppetCatalogTest::JunitXmlReporter.new("puppet-catalog-test", "puppet_catalogs.xml")
26
+ require 'puppet-catalog-test/junit_xml_reporter'
27
+ @reporter = PuppetCatalogTest::JunitXmlReporter.new("puppet-catalog-test", "puppet_catalogs.xml")
29
28
  else
30
- @reporter = StdoutReporter.new(stdout_target)
29
+ @reporter = StdoutReporter.new(stdout_target)
31
30
  end
32
31
 
33
32
  @total_duration = nil
@@ -51,8 +50,8 @@ module PuppetCatalogTest
51
50
  end
52
51
 
53
52
  if verbose == 1
54
- Puppet::Util::Log.newdestination(:console)
55
- Puppet::Util::Log.level = :debug
53
+ Puppet::Util::Log.newdestination(:console)
54
+ Puppet::Util::Log.level = :debug
56
55
  end
57
56
 
58
57
  Puppet.settings.handlearg("--config", ".")
@@ -119,7 +118,7 @@ module PuppetCatalogTest
119
118
  end
120
119
 
121
120
  def collect_puppet_nodes(filter)
122
- parser = Puppet::Parser::Parser.new("environment")
121
+ parser = Puppet::Parser::Parser.new(Puppet::Node::Environment.new)
123
122
  nodes = parser.environment.known_resource_types.nodes.keys
124
123
 
125
124
  if filter.exclude_pattern
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'puppet-catalog-test'
3
- s.version = '0.3.1'
3
+ s.version = '0.3.2.pre'
4
4
  s.homepage = 'https://github.com/invadersmustdie/puppet-catalog-test/'
5
5
  s.summary = 'Test all your puppet catalogs for compiler warnings and errors'
6
6
  s.description = 'Test all your puppet catalogs for compiler warnings and errors.'
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet-catalog-test
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
5
- prerelease:
4
+ version: 0.3.2.pre
5
+ prerelease: 6
6
6
  platform: ruby
7
7
  authors:
8
8
  - Rene Lengwinat
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-10-20 00:00:00.000000000 Z
12
+ date: 2014-11-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: puppet
@@ -90,18 +90,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
90
90
  - - ! '>='
91
91
  - !ruby/object:Gem::Version
92
92
  version: '0'
93
- segments:
94
- - 0
95
- hash: 2284989213780776549
96
93
  required_rubygems_version: !ruby/object:Gem::Requirement
97
94
  none: false
98
95
  requirements:
99
- - - ! '>='
96
+ - - ! '>'
100
97
  - !ruby/object:Gem::Version
101
- version: '0'
98
+ version: 1.3.1
102
99
  requirements: []
103
100
  rubyforge_project:
104
- rubygems_version: 1.8.24
101
+ rubygems_version: 1.8.23.2
105
102
  signing_key:
106
103
  specification_version: 3
107
104
  summary: Test all your puppet catalogs for compiler warnings and errors