|
1 | | -# temporarily supress warning messages for octocatalog-diff redefining puppet constants and then reactivate |
2 | | -$VERBOSE = nil |
3 | | -require 'octocatalog-diff' |
4 | | -$VERBOSE = false |
| 1 | +begin |
| 2 | + # temporarily supress warning messages for octocatalog-diff redefining puppet constants and then reactivate |
| 3 | + $VERBOSE = nil |
| 4 | + require 'octocatalog-diff' |
| 5 | + $VERBOSE = false |
5 | 6 |
|
6 | | -# executes smoke and regression tests on catalogs |
7 | | -class RegressionCheck |
8 | | - # smoke testing |
9 | | - def self.smoke(interface_nodes, octoconfig) |
10 | | - options = config(octoconfig) |
11 | | - nodes = options.key?(:node) ? [options[:node]] : interface_nodes |
12 | | - nodes.each do |node| |
13 | | - options[:node] = node |
14 | | - OctocatalogDiff::API::V1.catalog(options) |
| 7 | + # executes smoke and regression tests on catalogs |
| 8 | + class RegressionCheck |
| 9 | + # smoke testing |
| 10 | + def self.smoke(interface_nodes, octoconfig) |
| 11 | + options = config(octoconfig) |
| 12 | + nodes = options.key?(:node) ? [options[:node]] : interface_nodes |
| 13 | + nodes.each do |node| |
| 14 | + options[:node] = node |
| 15 | + OctocatalogDiff::API::V1.catalog(options) |
| 16 | + end |
15 | 17 | end |
16 | | - end |
17 | 18 |
|
18 | | - # regression testing |
19 | | - # def self.regression(nodes, octoconfig) |
20 | | - # options = RegressionCheck.config(octoconfig) |
21 | | - # nodes.each { |node| stuff } |
22 | | - # end |
| 19 | + # regression testing |
| 20 | + # def self.regression(nodes, octoconfig) |
| 21 | + # options = RegressionCheck.config(octoconfig) |
| 22 | + # nodes.each { |node| stuff } |
| 23 | + # end |
23 | 24 |
|
24 | | - # config file loading |
25 | | - def self.config(octoconfig) |
26 | | - private_class_method :method |
27 | | - OctocatalogDiff::API::V1.config(filename: octoconfig) |
| 25 | + # config file loading |
| 26 | + def self.config(octoconfig) |
| 27 | + private_class_method :method |
| 28 | + OctocatalogDiff::API::V1.config(filename: octoconfig) |
| 29 | + end |
28 | 30 | end |
| 31 | +rescue LoadError |
| 32 | + # octocatalog-diff not installed |
29 | 33 | end |
0 commit comments