puppet-catalog-test 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +1 -0
- data/bin/puppet-catalog-test +16 -1
- data/lib/puppet-catalog-test/test_runner.rb +20 -1
- data/puppet-catalog-test.gemspec +1 -1
- metadata +3 -3
data/README.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
[](https://travis-ci.org/invadersmustdie/puppet-catalog-test)
|
2
2
|
[](https://codeclimate.com/github/invadersmustdie/puppet-catalog-test)
|
3
|
+
[](http://badge.fury.io/rb/puppet-catalog-test)
|
3
4
|
|
4
5
|
# Test all your puppet catalogs for compiler warnings and errors
|
5
6
|
|
data/bin/puppet-catalog-test
CHANGED
@@ -19,6 +19,10 @@ opt_parser = OptionParser.new do |opts|
|
|
19
19
|
options[:manifest_path] = arg
|
20
20
|
end
|
21
21
|
|
22
|
+
opts.on("-H", "--hiera-config PATH", "Location of hiera.yaml file") do |arg|
|
23
|
+
options[:hiera_config] = arg
|
24
|
+
end
|
25
|
+
|
22
26
|
opts.on("-i", "--include-pattern PATTERN", "Include only test cases that match pattern") do |arg|
|
23
27
|
options[:include_pattern] = arg
|
24
28
|
end
|
@@ -31,6 +35,14 @@ opt_parser = OptionParser.new do |opts|
|
|
31
35
|
options[:scenario] = arg
|
32
36
|
end
|
33
37
|
|
38
|
+
opts.on("-v", "--verbose", "Verbose") do |arg|
|
39
|
+
options[:verbose] = 1
|
40
|
+
end
|
41
|
+
|
42
|
+
opts.on("-x", "--xml", "Use xml report") do |arg|
|
43
|
+
options[:xml] = 1
|
44
|
+
end
|
45
|
+
|
34
46
|
opts.on_tail("-h", "--help", "Show this message") do
|
35
47
|
puts opts
|
36
48
|
exit
|
@@ -46,7 +58,10 @@ end
|
|
46
58
|
|
47
59
|
pct = PuppetCatalogTest::TestRunner.new(
|
48
60
|
:manifest_path => options[:manifest_path],
|
49
|
-
:module_paths => options[:module_paths]
|
61
|
+
:module_paths => options[:module_paths],
|
62
|
+
:hiera_config => options[:hiera_config],
|
63
|
+
:verbose => options[:verbose],
|
64
|
+
:xml => options[:xml])
|
50
65
|
|
51
66
|
filter = PuppetCatalogTest::Filter.new
|
52
67
|
filter.include_pattern = options[:include_pattern] if options.has_key?(:include_pattern)
|
@@ -22,13 +22,21 @@ module PuppetCatalogTest
|
|
22
22
|
@exit_on_fail = true
|
23
23
|
@out = stdout_target
|
24
24
|
|
25
|
-
|
25
|
+
|
26
|
+
if puppet_config[:xml]
|
27
|
+
require 'puppet-catalog-test/junit_xml_reporter'
|
28
|
+
@reporter = PuppetCatalogTest::JunitXmlReporter.new("puppet-catalog-test", "puppet_catalogs.xml")
|
29
|
+
else
|
30
|
+
@reporter = StdoutReporter.new(stdout_target)
|
31
|
+
end
|
26
32
|
|
27
33
|
@total_duration = nil
|
28
34
|
|
29
35
|
manifest_path = puppet_config[:manifest_path]
|
30
36
|
module_paths = puppet_config[:module_paths]
|
31
37
|
config_dir = puppet_config[:config_dir]
|
38
|
+
hiera_config = puppet_config[:hiera_config]
|
39
|
+
verbose = puppet_config[:verbose]
|
32
40
|
|
33
41
|
raise ArgumentError, "[ERROR] manifest_path must be specified" if !manifest_path
|
34
42
|
raise ArgumentError, "[ERROR] manifest_path (#{manifest_path}) does not exist" if !FileTest.exist?(manifest_path)
|
@@ -42,6 +50,12 @@ module PuppetCatalogTest
|
|
42
50
|
Puppet.settings.handlearg("--confdir", config_dir)
|
43
51
|
end
|
44
52
|
|
53
|
+
if verbose == 1
|
54
|
+
Puppet::Util::Log.newdestination(:console)
|
55
|
+
Puppet::Util::Log.level = :debug
|
56
|
+
end
|
57
|
+
|
58
|
+
Puppet.settings.handlearg("--config", ".")
|
45
59
|
Puppet.settings.handlearg("--config", ".")
|
46
60
|
Puppet.settings.handlearg("--manifest", manifest_path)
|
47
61
|
|
@@ -49,6 +63,11 @@ module PuppetCatalogTest
|
|
49
63
|
|
50
64
|
Puppet.settings.handlearg("--modulepath", module_path)
|
51
65
|
|
66
|
+
if hiera_config
|
67
|
+
raise ArgumentError, "[ERROR] hiera_config (#{hiera_config}) does not exist" if !FileTest.exist?(hiera_config)
|
68
|
+
Puppet.settings[:hiera_config] = hiera_config
|
69
|
+
end
|
70
|
+
|
52
71
|
Puppet.parse_config
|
53
72
|
end
|
54
73
|
|
data/puppet-catalog-test.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'puppet-catalog-test'
|
3
|
-
s.version = '0.3.
|
3
|
+
s.version = '0.3.1'
|
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,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet-catalog-test
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-10-
|
12
|
+
date: 2013-10-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: puppet
|
@@ -92,7 +92,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
92
92
|
version: '0'
|
93
93
|
segments:
|
94
94
|
- 0
|
95
|
-
hash:
|
95
|
+
hash: 2284989213780776549
|
96
96
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
97
97
|
none: false
|
98
98
|
requirements:
|