simp-beaker-helpers 1.11.3 → 1.12.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: b6e130fce3d3a8eee72398b70815453331916db8
4
- data.tar.gz: a1b92623b2bae26cccf0c3563c143c71b46655ea
2
+ SHA256:
3
+ metadata.gz: 72ec3c87384ec91370fa23c4ad597d05d9244ea1489cdbbd0309ad056837fd64
4
+ data.tar.gz: fb2aec92e7da3523555fd5271c74eaa03c1980192bce56f4db8d814ff1e8b99c
5
5
  SHA512:
6
- metadata.gz: 8526d0b9b7210537e2e9f2646e169d42befa0ce290072d54a60652ff106ad761ca8e34baeb0c594ca8edba944ea92d7ceb73a2ce5641eced574d77f5079112ce
7
- data.tar.gz: af086c7b60267bdbfc730caa535ca1d04fd7e05dd05827ca028a2a4b303be0bfbc3e6be7894ff4cec9349a051d1e98b464b81158368e7bea8ce1da0b26a9b71f
6
+ metadata.gz: be4a71d244439e6a42eb65482faadc33dd66fb3e23f5dbbf71d81e57b8571fb4fb268292abdeac113a619deda38a7efb22a2ad9270869ca2fff3f4dcd2d2ef92
7
+ data.tar.gz: 44e06c866ba8ebb50bc730ce389de25c2f64aecca213a18a88df55aa1b60f67aa320c427e3d140078c3d41ce221a901a30a987d734c8a3da4f81c30652fc1e8c
@@ -1,3 +1,8 @@
1
+ ### 1.12.0 / 2018-10-22
2
+ * When using suites, allow users to loop through multiple specified nodesets as
3
+ a colon delimited list or loop through all nodesets by passing 'ALL'.
4
+ * If 'ALL' is passed, the 'default' suite will be run first.
5
+
1
6
  ### 1.11.3 / 2018-10-22
2
7
  * Made the inspec report less confusing overall by noting where checks are
3
8
  overridden
@@ -1,5 +1,5 @@
1
1
  module Simp; end
2
2
 
3
3
  module Simp::BeakerHelpers
4
- VERSION = '1.11.3'
4
+ VERSION = '1.12.0'
5
5
  end
@@ -53,6 +53,9 @@ module Simp::Rake
53
53
  * If you set this to `ALL`, all suites will be run
54
54
 
55
55
  * :nodeset - A specific nodeset to run on within a specific suite
56
+ * If you set this to `ALL`, all nodesets will be looped through, starting with 'default'
57
+ * You may also set this to a colon delimited list of short
58
+ nodeset names that will be run in that order
56
59
 
57
60
  ## Suite Execution
58
61
 
@@ -200,47 +203,62 @@ module Simp::Rake
200
203
 
201
204
  $stdout.puts("\n\n=== Suite '#{name}' Starting ===\n\n")
202
205
 
206
+ nodesets = Array.new
207
+ nodeset_path = File.join(suites[ste]['path'],'nodesets')
208
+
203
209
  if nodeset
204
- nodeset_yml = File.join(suites[ste]['path'], 'nodesets', "#{nodeset}.yml")
210
+ if nodeset == 'ALL'
211
+ nodesets = Dir.glob(File.join(nodeset_path, '*.yml'))
212
+
213
+ # Make sure we run the default set first
214
+ default_set = nodesets.delete(File.join(nodeset_path, 'default.yml'))
215
+ nodesets.unshift(default_set) if default_set
216
+ else
217
+ nodeset.split(':').each do |tgt_nodeset|
218
+ nodesets << File.join(nodeset_path, "#{tgt_nodeset.strip}.yml")
219
+ end
220
+ end
221
+ else
222
+ nodesets << File.join(nodeset_path, 'default.yml')
223
+ end
224
+
225
+ nodesets.each do |nodeset_yml|
205
226
  unless File.file?(nodeset_yml)
206
- $stdout.puts("=== Suite #{name} Nodeset '#{nodeset}' Not Found, Skipping ===")
227
+ $stdout.puts("=== Suite #{name} Nodeset '#{File.basename(nodeset_yml, '.yml')}' Not Found, Skipping ===")
207
228
  next
208
229
  end
209
230
 
210
231
  ENV['BEAKER_setfile'] = nodeset_yml
211
- else
212
- nodeset_yml = File.join(suites[ste]['path'], 'nodesets', 'default.yml')
213
-
214
- ENV['BEAKER_setfile'] = nodeset_yml
215
- end
216
232
 
217
- Rake::Task[:beaker].clear
218
- RSpec::Core::RakeTask.new(:beaker) do |tsk|
219
- tsk.rspec_opts = ['--color']
220
- tsk.pattern = File.join(suites[ste]['path'])
221
- end
233
+ Rake::Task[:beaker].clear
234
+ RSpec::Core::RakeTask.new(:beaker) do |tsk|
235
+ tsk.rspec_opts = ['--color']
236
+ tsk.pattern = File.join(suites[ste]['path'])
237
+ end
222
238
 
223
- current_suite_task = Rake::Task[:beaker]
239
+ current_suite_task = Rake::Task[:beaker]
224
240
 
225
- if suite_config['fail_fast'] == true
226
- current_suite_task.execute
227
- else
228
- begin
241
+ if suite_config['fail_fast'] == true
229
242
  current_suite_task.execute
230
- rescue SystemExit
231
- failures[suites[ste]['name']] = {
232
- 'path' => suites[ste]['path']
233
- }
243
+ else
244
+ begin
245
+ current_suite_task.execute
246
+ rescue SystemExit
247
+ failures[suites[ste]['name']] = {
248
+ 'path' => suites[ste]['path'],
249
+ 'nodeset' => File.basename(nodeset_yml, '.yml')
250
+ }
251
+ end
234
252
  end
235
- end
236
253
 
237
- $stdout.puts("\n\n=== Suite '#{name}' Complete ===\n\n")
254
+ $stdout.puts("\n\n=== Suite '#{name}' Complete ===\n\n")
255
+ end
238
256
  end
239
257
 
240
258
  unless failures.keys.empty?
241
259
  $stdout.puts("The following tests had failures:")
242
260
  failures.keys.sort.each do |ste|
243
- $stdout.puts(" * #{ste} => #{failures[ste]['path']}")
261
+ $stdout.puts(" * #{ste} => #{failures[ste]['path']} on #{failures[ste]['nodeset']}")
244
262
  end
245
263
  end
246
264
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simp-beaker-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.11.3
4
+ version: 1.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Tessmer
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-10-22 00:00:00.000000000 Z
12
+ date: 2018-10-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: beaker
@@ -204,25 +204,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
204
204
  version: '0'
205
205
  requirements: []
206
206
  rubyforge_project:
207
- rubygems_version: 2.6.14
207
+ rubygems_version: 2.7.7
208
208
  signing_key:
209
209
  specification_version: 4
210
210
  summary: beaker helper methods for SIMP
211
- test_files:
212
- - spec/acceptance/nodesets/default.yml
213
- - spec/acceptance/suites/default/check_puppet_version_spec.rb
214
- - spec/acceptance/suites/default/enable_fips_spec.rb
215
- - spec/acceptance/suites/default/fixture_modules_spec.rb
216
- - spec/acceptance/suites/default/nodesets
217
- - spec/acceptance/suites/default/pki_tests_spec.rb
218
- - spec/acceptance/suites/default/set_hieradata_on_spec.rb
219
- - spec/acceptance/suites/default/write_hieradata_to_spec.rb
220
- - spec/acceptance/suites/fips_from_fixtures/00_default_spec.rb
221
- - spec/acceptance/suites/fips_from_fixtures/metadata.yml
222
- - spec/acceptance/suites/fips_from_fixtures/nodesets
223
- - spec/acceptance/suites/puppet_collections/00_default_spec.rb
224
- - spec/acceptance/suites/puppet_collections/metadata.yml
225
- - spec/acceptance/suites/puppet_collections/nodesets/default.yml
226
- - spec/lib/simp/beaker_helpers_spec.rb
227
- - spec/spec_helper.rb
228
- - spec/spec_helper_acceptance.rb
211
+ test_files: []