kitchen-inspec 2.0.0 → 2.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cf548caf32e38ac4f651467f17d41b1057122cf6fd486964ba25021957c392f0
4
- data.tar.gz: ad173dfa6c01162998533c3630382c90b66ca0bf9fade4e85f234143af6574e0
3
+ metadata.gz: d5e0bb94f9512364a36a2566f22f1a44c77dfb02e10d63a0e0c2376a9d984413
4
+ data.tar.gz: ce3e7d981810c794854b2fb3bb8f19c8f414d4e55e428d49567df0c6feddd56b
5
5
  SHA512:
6
- metadata.gz: 160d7363ad42ef3f6f80796ffef20e72159cfe4ea462b3305b11496508258db0aeb33ecd98abdb441c06f6587d7ea300e81ed664b395ada665b3329d168c237f
7
- data.tar.gz: 6bc8274fab1fdd47df48d964d1b4b9aa135ea6ccb5e627cfc423b6899fa288aba7913e779931a5668de230aad4b9f9993b6556b891f4e70d2b8bbfe64c9b8388
6
+ metadata.gz: 005f68ba11e4cc19d341eef0ef3e38ad78e0c2415ebabaeebbdf0d8a6d2834dcb3280bb1c0cda2986bd69bcdb457ebe06b0e8a1bcd3cea224f2913f79a6b2bb2
7
+ data.tar.gz: 7b7c8d5ef3f4fc8b04713e16f85dac071a9b8458e8daf2c203ad0e8e4e84a64bb0719d52ccb31d29ddca339703dff1f18eed510c4ebc1170bd5a5e3319b40948
@@ -37,8 +37,13 @@ module Kitchen
37
37
  kitchen_verifier_api_version 1
38
38
  plugin_version Kitchen::Verifier::INSPEC_VERSION
39
39
 
40
+ # Chef InSpec is based on RSpec, which is not thread safe
41
+ # (https://github.com/rspec/rspec-core/issues/1254)
42
+ # Tell test kitchen not to multithread the verify step
43
+ no_parallel_for :verify
44
+
40
45
  default_config :inspec_tests, []
41
- default_config :load_plugins, false
46
+ default_config :load_plugins, true
42
47
 
43
48
  # A lifecycle method that should be invoked when the object is about
44
49
  # ready to be used. A reference to an Instance is required as
@@ -80,16 +85,20 @@ module Kitchen
80
85
  ::Inspec::Log.init(STDERR)
81
86
  ::Inspec::Log.level = Kitchen::Util.from_logger_level(logger.level)
82
87
 
83
- # initialize runner
84
- runner = ::Inspec::Runner.new(opts)
85
-
86
88
  # load plugins
87
89
  if config[:load_plugins]
88
90
  v2_loader = ::Inspec::Plugin::V2::Loader.new
89
91
  v2_loader.load_all
90
92
  v2_loader.exit_on_load_error
93
+
94
+ if ::Inspec::InputRegistry.instance.respond_to?(:cache_inputs=) && config[:cache_inputs]
95
+ ::Inspec::InputRegistry.instance.cache_inputs = !!config[:cache_inputs]
96
+ end
91
97
  end
92
98
 
99
+ # initialize runner
100
+ runner = ::Inspec::Runner.new(opts)
101
+
93
102
  # add each profile to runner
94
103
  tests = collect_tests
95
104
  profile_ctx = nil
@@ -158,7 +167,7 @@ module Kitchen
158
167
  #
159
168
  # we support the base directories
160
169
  # - test/integration
161
- # - test/integration/inspec (prefered if used with other test environments)
170
+ # - test/integration/inspec (preferred if used with other test environments)
162
171
  #
163
172
  # we do not filter for specific directories, this is core of inspec
164
173
  #
@@ -291,7 +300,7 @@ module Kitchen
291
300
  # @api private
292
301
  def runner_options_for_winrm(config_data)
293
302
  kitchen = instance.transport.send(:connection_options, config_data).dup
294
- opts = {
303
+ {
295
304
  "backend" => "winrm",
296
305
  "logger" => logger,
297
306
  "ssl" => URI(kitchen[:endpoint]).scheme == "https",
@@ -304,7 +313,6 @@ module Kitchen
304
313
  "connection_retry_sleep" => kitchen[:connection_retry_sleep],
305
314
  "max_wait_until_ready" => kitchen[:max_wait_until_ready],
306
315
  }
307
- opts
308
316
  end
309
317
 
310
318
  # Returns a configuration Hash that can be passed to a `Inspec::Runner`.
@@ -335,11 +343,10 @@ module Kitchen
335
343
  # @return [Hash] a configuration hash of string-based keys
336
344
  # @api private
337
345
  def runner_options_for_exec(config_data)
338
- opts = {
346
+ {
339
347
  "backend" => "local",
340
348
  "logger" => logger,
341
349
  }
342
- opts
343
350
  end
344
351
 
345
352
  # Returns a configuration Hash that can be passed to a `Inspec::Runner`.
@@ -20,6 +20,6 @@
20
20
  module Kitchen
21
21
  module Verifier
22
22
  # Version string for InSpec Kitchen verifier
23
- INSPEC_VERSION = "2.0.0".freeze
23
+ INSPEC_VERSION = "2.2.1".freeze
24
24
  end
25
25
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-inspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chef Software, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-05 00:00:00.000000000 Z
11
+ date: 2020-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: inspec
@@ -36,7 +36,7 @@ dependencies:
36
36
  requirements:
37
37
  - - ">="
38
38
  - !ruby/object:Gem::Version
39
- version: '1.6'
39
+ version: '2.7'
40
40
  - - "<"
41
41
  - !ruby/object:Gem::Version
42
42
  version: '3'
@@ -46,7 +46,7 @@ dependencies:
46
46
  requirements:
47
47
  - - ">="
48
48
  - !ruby/object:Gem::Version
49
- version: '1.6'
49
+ version: '2.7'
50
50
  - - "<"
51
51
  - !ruby/object:Gem::Version
52
52
  version: '3'