test-kitchen 4.1.0 → 4.1.2

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.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -0
  3. data/Rakefile +10 -0
  4. data/lib/kitchen/cli.rb +60 -5
  5. data/lib/kitchen/color.rb +7 -0
  6. data/lib/kitchen/command/action.rb +1 -1
  7. data/lib/kitchen/command/diagnose.rb +1 -1
  8. data/lib/kitchen/command/login.rb +1 -1
  9. data/lib/kitchen/command/logs.rb +4 -0
  10. data/lib/kitchen/command/package.rb +1 -1
  11. data/lib/kitchen/command.rb +25 -2
  12. data/lib/kitchen/config.rb +5 -5
  13. data/lib/kitchen/configurable.rb +17 -4
  14. data/lib/kitchen/data_munger.rb +19 -0
  15. data/lib/kitchen/driver/base.rb +3 -3
  16. data/lib/kitchen/driver/dummy.rb +9 -3
  17. data/lib/kitchen/errors.rb +7 -1
  18. data/lib/kitchen/generator/init.rb +4 -0
  19. data/lib/kitchen/instance.rb +27 -12
  20. data/lib/kitchen/lazy_hash.rb +2 -2
  21. data/lib/kitchen/lifecycle_hook/base.rb +14 -4
  22. data/lib/kitchen/lifecycle_hook/local.rb +2 -0
  23. data/lib/kitchen/lifecycle_hook/remote.rb +3 -1
  24. data/lib/kitchen/loader/yaml.rb +8 -4
  25. data/lib/kitchen/logger.rb +142 -8
  26. data/lib/kitchen/logging.rb +1 -1
  27. data/lib/kitchen/login_command.rb +3 -0
  28. data/lib/kitchen/metadata_chopper.rb +8 -1
  29. data/lib/kitchen/platform_filter.rb +4 -4
  30. data/lib/kitchen/plugin.rb +4 -1
  31. data/lib/kitchen/plugin_base.rb +5 -0
  32. data/lib/kitchen/provisioner/base.rb +5 -5
  33. data/lib/kitchen/provisioner/dummy.rb +1 -1
  34. data/lib/kitchen/provisioner/external.rb +22 -0
  35. data/lib/kitchen/provisioner.rb +1 -1
  36. data/lib/kitchen/state_file.rb +1 -1
  37. data/lib/kitchen/suite.rb +1 -1
  38. data/lib/kitchen/transport/base.rb +1 -1
  39. data/lib/kitchen/transport/dummy.rb +21 -3
  40. data/lib/kitchen/transport/exec.rb +1 -1
  41. data/lib/kitchen/transport/ssh.rb +13 -6
  42. data/lib/kitchen/transport/winrm.rb +12 -6
  43. data/lib/kitchen/util.rb +12 -4
  44. data/lib/kitchen/verifier/base.rb +5 -5
  45. data/lib/kitchen/verifier/busser.rb +1 -1
  46. data/lib/kitchen/verifier/shell.rb +1 -1
  47. data/lib/kitchen/version.rb +4 -1
  48. data/lib/kitchen/which.rb +2 -0
  49. data/lib/kitchen.rb +2 -2
  50. data/lib/vendor/hash_recursive_merge.rb +5 -0
  51. data/templates/driver/README.md.erb +1 -1
  52. data/test-kitchen.gemspec +2 -2
  53. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 37110df4f18f03d75c627d0095a7cfee87e12add45de4265ddbcb3afe5d207da
4
- data.tar.gz: 94c3173ff1268904ec591d0de22f15635e1e1a453ce9f3167a4e10c26f6eed48
3
+ metadata.gz: a2d33ad099262a074eb6c0d0a7e76f86d7e4f06d8400263390569e5ca464bcde
4
+ data.tar.gz: 3bbbe927caee591ad59ae92c676bda2066e2c27730f8f522ef9d7aad6cf5e48a
5
5
  SHA512:
6
- metadata.gz: 30070f63b980cdf6ee9139232b013092c08ee838c6534b4af11736beeab7bf0aab1e3bba152665bbc07ac6a9723cee89e1c0cf6251dc4054a8c281c2866274d8
7
- data.tar.gz: 1e1ab92e31f6b83b97df09df37e6e853be9f982b78aeabbf96045a1b0ee61fd8012704ad45fdcf2ff249fb489211e470ab5eed8a2db49209597fa05ae473a121
6
+ metadata.gz: 56befe75562ba39e8e1b5c35e6827fe5fe44c34a62f8bffd02d0b2dbbf80671e269926bcf578c20c4bfcae0ff282616c50e87b2f3d6a0aeb89b1c0f8ab8440aa
7
+ data.tar.gz: eb059e0f0f76ef6ce30ba1dbd9b09ab28dae4314ac67c83e060a200e7974d26a814e745a2626133a926d2a37f133e1f4d8c46e0ab95597d034eb837f7f3bfe55
data/Gemfile CHANGED
@@ -12,6 +12,7 @@ group :test do
12
12
  gem "maruku", "~> 0.7"
13
13
  gem "minitest", "~> 6.0", "< 6.1"
14
14
  gem "mocha", "~> 3.0"
15
+ gem "yard", "~> 0.9"
15
16
  end
16
17
 
17
18
  group :integration do
data/Rakefile CHANGED
@@ -38,6 +38,16 @@ rescue LoadError
38
38
  puts "cookstyle/chefstyle is not available. (sudo) gem install cookstyle to do style checking."
39
39
  end
40
40
 
41
+ # Generation options live in .yardopts so that `yard` and `rake yard` agree.
42
+ begin
43
+ require "yard"
44
+ YARD::Rake::YardocTask.new(:yard) do |task|
45
+ task.options += ["--no-cache"]
46
+ end
47
+ rescue LoadError
48
+ puts "yard is not available. (sudo) gem install yard to generate the docs."
49
+ end
50
+
41
51
  desc "Run all quality tasks"
42
52
  task quality: %i{style stats}
43
53
 
data/lib/kitchen/cli.rb CHANGED
@@ -32,7 +32,7 @@ module Kitchen
32
32
  #
33
33
  # @param task [String] action to take, usually corresponding to the
34
34
  # subcommand name
35
- # @param command [String] command class to create and invoke]
35
+ # @param command [String] command class to create and invoke
36
36
  # @param args [Array] remainder arguments from processed ARGV
37
37
  # (default: `nil`)
38
38
  # @param additional_options [Hash] additional configuration needed to
@@ -121,6 +121,11 @@ module Kitchen
121
121
  type: :boolean,
122
122
  desc: "[Deprecated] Please use `kitchen diagnose'"
123
123
  log_options
124
+ # Lists one or more instances and their last known action state.
125
+ #
126
+ # @param args [Array<String>] instance names or regexps to match; matches
127
+ # all instances when empty
128
+ # @return [void]
124
129
  def list(*args)
125
130
  log_overwrite = options[:log_overwrite].nil? ? false : options[:log_overwrite]
126
131
  update_config!(log_overwrite:)
@@ -144,6 +149,12 @@ module Kitchen
144
149
  desc: "Include all diagnostics"
145
150
  log_options
146
151
  test_base_path
152
+ # Prints the fully computed diagnostic configuration for one or more
153
+ # instances, after all loader and plugin data has been merged.
154
+ #
155
+ # @param args [Array<String>] instance names or regexps to match; matches
156
+ # all instances when empty
157
+ # @return [void]
147
158
  def diagnose(*args)
148
159
  update_config!
149
160
  perform("diagnose", "diagnose", args, loader: @loader)
@@ -250,6 +261,12 @@ module Kitchen
250
261
  desc: "Run the converge and verify with debugging enabled."
251
262
  test_base_path
252
263
  log_options
264
+ # Runs a full test cycle (destroy, create, converge, setup, verify,
265
+ # destroy) against one or more instances.
266
+ #
267
+ # @param args [Array<String>] instance names or regexps to match; matches
268
+ # all instances when empty
269
+ # @return [void]
253
270
  def test(*args)
254
271
  update_config!
255
272
  ensure_initialized
@@ -258,6 +275,11 @@ module Kitchen
258
275
 
259
276
  desc "login INSTANCE|REGEXP", "Log in to one instance"
260
277
  log_options
278
+ # Opens an interactive login session on a single instance.
279
+ #
280
+ # @param args [Array<String>] an instance name or regexp matching exactly
281
+ # one instance
282
+ # @return [void]
261
283
  def login(*args)
262
284
  update_config!
263
285
  perform("login", "login", args)
@@ -279,6 +301,11 @@ module Kitchen
279
301
  type: :boolean,
280
302
  desc: "Follow the structured log file"
281
303
  log_options
304
+ # Prints the structured log events recorded for one or more instances.
305
+ #
306
+ # @param args [Array<String>] instance names or regexps to match; matches
307
+ # all instances when empty
308
+ # @return [void]
282
309
  def logs(*args)
283
310
  update_config!(log_overwrite: false)
284
311
  perform("logs", "logs", args)
@@ -286,6 +313,12 @@ module Kitchen
286
313
 
287
314
  desc "package INSTANCE|REGEXP", "package an instance"
288
315
  log_options
316
+ # Packages a single instance into a distributable artifact, as
317
+ # implemented by the instance's driver.
318
+ #
319
+ # @param args [Array<String>] an instance name or regexp matching exactly
320
+ # one instance
321
+ # @return [void]
289
322
  def package(*args)
290
323
  update_config!
291
324
  perform("package", "package", args)
@@ -296,34 +329,56 @@ module Kitchen
296
329
  method_option :all,
297
330
  aliases: "-a",
298
331
  desc: "Check all instances"
332
+ # Checks one or more instances for common system and configuration
333
+ # problems.
334
+ #
335
+ # @param args [Array<String>] instance names or regexps to match; matches
336
+ # all instances when empty
337
+ # @return [void]
299
338
  def doctor(*args)
300
339
  update_config!
301
340
  perform("doctor", "doctor", args)
302
341
  end
303
342
 
304
343
  desc "exec INSTANCE|REGEXP -c REMOTE_COMMAND",
305
- "Execute command on one or more instance"
344
+ "Execute command on one or more instances"
306
345
  method_option :command,
307
346
  aliases: "-c",
308
347
  desc: "execute via ssh"
309
348
  log_options
349
+ # Executes a remote command on one or more instances over their
350
+ # configured transport.
351
+ #
352
+ # @param args [Array<String>] instance names or regexps to match; matches
353
+ # all instances when empty
354
+ # @return [void]
310
355
  def exec(*args)
311
356
  update_config!
312
357
  perform("exec", "exec", args)
313
358
  end
314
359
 
315
360
  desc "version", "Print Test Kitchen's version information"
361
+ # Prints Test Kitchen's version information to stdout.
362
+ #
363
+ # @return [void]
316
364
  def version
317
365
  puts "Test Kitchen version #{Kitchen::VERSION}"
318
366
  end
319
367
  map %w{-v --version} => :version
320
368
 
321
369
  desc "sink", "Show the Kitchen sink!", hide: true
370
+ # Shows the Kitchen sink. A hidden easter egg command.
371
+ #
372
+ # @return [void]
322
373
  def sink
323
374
  perform("sink", "sink")
324
375
  end
325
376
 
326
377
  desc "console", "Test Kitchen Console!"
378
+ # Starts an interactive console session with the Test Kitchen
379
+ # configuration loaded.
380
+ #
381
+ # @return [void]
327
382
  def console
328
383
  perform("console", "console")
329
384
  end
@@ -341,7 +396,7 @@ module Kitchen
341
396
  class << self
342
397
  private
343
398
 
344
- # Ensure the any failing commands exit non-zero.
399
+ # Ensure that any failing commands exit non-zero.
345
400
  #
346
401
  # @return [true] you die always on failure
347
402
  # @api private
@@ -374,7 +429,7 @@ module Kitchen
374
429
 
375
430
  @config.debug = options[:debug]
376
431
 
377
- # Now that we have required configs, lets create our file logger
432
+ # Now that we have required configs, let's create our file logger
378
433
  Kitchen.logger = Kitchen.default_file_logger(
379
434
  log_level,
380
435
  log_overwrite
@@ -401,7 +456,7 @@ module Kitchen
401
456
  @log_level = level
402
457
  end
403
458
 
404
- # Check to whether a provided log level is valid
459
+ # Check whether a provided log level is valid
405
460
  #
406
461
  # @api private
407
462
  def valid_log_level?(level)
data/lib/kitchen/color.rb CHANGED
@@ -22,6 +22,9 @@ module Kitchen
22
22
  #
23
23
  # @author Fletcher Nichol <fnichol@nichol.ca>
24
24
  module Color
25
+ # Maps color names to their ANSI SGR parameter codes.
26
+ #
27
+ # @return [Hash{Symbol => Integer}] color name to ANSI code mapping
25
28
  ANSI = {
26
29
  reset: 0, black: 30, red: 31, green: 32, yellow: 33,
27
30
  blue: 34, magenta: 35, cyan: 36, white: 37,
@@ -30,6 +33,10 @@ module Kitchen
30
33
  bright_cyan: 96, bright_white: 97
31
34
  }.freeze
32
35
 
36
+ # The subset of {ANSI} color names cycled through when assigning a
37
+ # distinct color to each instance.
38
+ #
39
+ # @return [Array<String>] assignable color names
33
40
  COLORS = %w{
34
41
  cyan yellow green magenta blue bright_cyan bright_yellow
35
42
  bright_green bright_magenta bright_blue
@@ -21,7 +21,7 @@ require "benchmark" unless defined?(Benchmark)
21
21
 
22
22
  module Kitchen
23
23
  module Command
24
- # Command to run a single action one or more instances.
24
+ # Command to run a single action on one or more instances.
25
25
  #
26
26
  # @author Fletcher Nichol <fnichol@nichol.ca>
27
27
  class Action < Kitchen::Command::Base
@@ -22,7 +22,7 @@ autoload :YAML, "yaml"
22
22
 
23
23
  module Kitchen
24
24
  module Command
25
- # Command to log into to instance.
25
+ # Command to show the computed diagnostic configuration.
26
26
  #
27
27
  # @author Fletcher Nichol <fnichol@nichol.ca>
28
28
  class Diagnose < Kitchen::Command::Base
@@ -19,7 +19,7 @@ require_relative "../command"
19
19
 
20
20
  module Kitchen
21
21
  module Command
22
- # Command to log into to instance.
22
+ # Command to log into an instance.
23
23
  #
24
24
  # @author Fletcher Nichol <fnichol@nichol.ca>
25
25
  class Login < Kitchen::Command::Base
@@ -19,6 +19,10 @@ module Kitchen
19
19
  module Command
20
20
  # Command to print structured logs for one instance.
21
21
  class Logs < Kitchen::Command::Base
22
+ # Log severity names in ascending order, used to resolve the minimum
23
+ # level filter.
24
+ #
25
+ # @return [Array<String>] severity names, lowest to highest
22
26
  LEVELS = %w{debug info warn error fatal unknown}.freeze
23
27
 
24
28
  # Invoke the command.
@@ -16,7 +16,7 @@ require_relative "../command"
16
16
 
17
17
  module Kitchen
18
18
  module Command
19
- # Execute command on remote instance.
19
+ # Command to package one or more instances.
20
20
  #
21
21
  class Package < Kitchen::Command::Base
22
22
  # Invoke the command.
@@ -19,6 +19,9 @@ require_relative "errors"
19
19
  require_relative "logging"
20
20
 
21
21
  module Kitchen
22
+ # Namespace for the classes implementing each `kitchen` subcommand.
23
+ #
24
+ # @author Fletcher Nichol <fnichol@nichol.ca>
22
25
  module Command
23
26
  # Base class for CLI commands.
24
27
  #
@@ -100,7 +103,7 @@ module Kitchen
100
103
  end
101
104
  end
102
105
 
103
- # Return an array on instances whose name matches the regular expression.
106
+ # Return an array of instances whose name matches the regular expression.
104
107
  #
105
108
  # @param regexp [Regexp] a regular expression matching on instance names
106
109
  # @return [Array<Instance>] an array of instances
@@ -131,7 +134,7 @@ module Kitchen
131
134
  Kitchen.logger
132
135
  end
133
136
 
134
- # Return an array on instances whose name matches the regular expression,
137
+ # Return an array of instances whose name matches the regular expression,
135
138
  # the full instance name, or the `"all"` literal.
136
139
  #
137
140
  # @param arg [String] an instance name, a regular expression, the literal
@@ -191,6 +194,12 @@ module Kitchen
191
194
  end
192
195
  end
193
196
 
197
+ # Determines how many instances may be acted on at once, clamped to the
198
+ # number of instances available.
199
+ #
200
+ # @param instances [Array<Instance>] the instances to be acted on
201
+ # @return [Integer] the number of worker threads to start
202
+ # @api private
194
203
  def concurrency_setting(instances)
195
204
  concurrency = 1
196
205
  if options[:concurrency]
@@ -200,6 +209,14 @@ module Kitchen
200
209
  concurrency
201
210
  end
202
211
 
212
+ # Performs an action on a single instance, recording any instance or
213
+ # action failure rather than letting it escape the worker thread.
214
+ #
215
+ # @param action [String] action to perform
216
+ # @param instance [Instance] the instance to act on
217
+ # @param args [Array] additional arguments forwarded to the action
218
+ # @return [void]
219
+ # @api private
203
220
  def run_action_in_thread(action, instance, *args)
204
221
  instance.public_send(action, *args)
205
222
  rescue Kitchen::InstanceFailure => e
@@ -212,6 +229,12 @@ module Kitchen
212
229
  instance.cleanup!
213
230
  end
214
231
 
232
+ # Records an error raised by an action, synchronized across worker
233
+ # threads.
234
+ #
235
+ # @param error [StandardError] the error to record
236
+ # @return [void]
237
+ # @api private
215
238
  def record_action_error(error)
216
239
  @action_errors_mutex.synchronize { @action_errors << error }
217
240
  end
@@ -136,7 +136,7 @@ module Kitchen
136
136
 
137
137
  # Builds the filtered list of Instance objects.
138
138
  #
139
- # @return [Array<Instance] an array of Instances
139
+ # @return [Array<Instance>] an array of Instances
140
140
  # @api private
141
141
  def build_instances
142
142
  filter_instances.map.with_index do |(suite, platform), index|
@@ -163,7 +163,7 @@ module Kitchen
163
163
  end
164
164
 
165
165
  # Determines the default absolute path to the testing files directory,
166
- # based on the the value of `#kitchen_root`.
166
+ # based on the value of `#kitchen_root`.
167
167
  #
168
168
  # @return [String] an absolute path to the testing files directory
169
169
  # @api private
@@ -289,12 +289,12 @@ module Kitchen
289
289
  )
290
290
  end
291
291
 
292
- # Builds a newly configured LifecycleHooks object, for a given a Suite and
292
+ # Builds a newly configured LifecycleHooks object, for a given Suite and
293
293
  # Platform.
294
294
  #
295
295
  # @param suite [Suite,#name] a Suite
296
296
  # @param platform [Platform,#name] a Platform
297
- # @param state_file [Kitchen::StateFile] a SateFile
297
+ # @param state_file [Kitchen::StateFile] a StateFile
298
298
  # @return [LifecycleHooks] a new LifecycleHooks object
299
299
  # @api private
300
300
  def new_lifecycle_hooks(suite, platform, state_file)
@@ -337,7 +337,7 @@ module Kitchen
337
337
  Transport.for_plugin(tdata[:name], tdata)
338
338
  end
339
339
 
340
- # Builds a newly configured Verifier object, for a given a Suite and
340
+ # Builds a newly configured Verifier object, for a given Suite and
341
341
  # Platform.
342
342
  #
343
343
  # @param suite [Suite,#name] a Suite
@@ -26,6 +26,13 @@ module Kitchen
26
26
  #
27
27
  # @author Fletcher Nichol <fnichol@nichol.ca>
28
28
  module Configurable
29
+ # Extends the including class with {ClassMethods} so that the
30
+ # `default_config`, `required_config`, and related DSL is available at the
31
+ # class level.
32
+ #
33
+ # @param base [Class] the class including this module
34
+ # @return [void]
35
+ # @api private
29
36
  def self.included(base)
30
37
  base.extend(ClassMethods)
31
38
  end
@@ -35,7 +42,7 @@ module Kitchen
35
42
 
36
43
  # A lifecycle method that should be invoked when the object is about ready
37
44
  # to be used. A reference to an Instance is required as configuration
38
- # dependant data may be access through an Instance. This also acts as a
45
+ # dependent data may be accessed through an Instance. This also acts as a
39
46
  # hook point where the object may wish to perform other last minute
40
47
  # checks, validations, or configuration expansions.
41
48
  #
@@ -73,7 +80,7 @@ module Kitchen
73
80
  # fallback rules or returns nil if path cannot be determined.
74
81
  #
75
82
  # Given an instance with suite named `"server"`, a `test_base_path` of
76
- # `"/a/b"`, and a path segment of `"roles"` then following will be tried
83
+ # `"/a/b"`, and a path segment of `"roles"` then the following will be tried
77
84
  # in order (first match that exists wins):
78
85
  #
79
86
  # 1. /a/b/server/roles
@@ -207,7 +214,7 @@ module Kitchen
207
214
  end
208
215
 
209
216
  # Expands file paths for certain configuration values. A configuration
210
- # value is marked for file expansion with a expand_path_for declaration
217
+ # value is marked for file expansion with an expand_path_for declaration
211
218
  # in the included class.
212
219
  #
213
220
  # @api private
@@ -396,7 +403,7 @@ module Kitchen
396
403
  # Helper method to export
397
404
  #
398
405
  # @param env [Array] the environment to modify
399
- # @param code [String] the type of proxy to export, one of 'http', 'https' or 'ftp'
406
+ # @param type [String] the type of proxy to export, one of 'http', 'https' or 'ftp'
400
407
  # @api private
401
408
  def export_proxy(env, type)
402
409
  env << shell_env_var(type.to_s, ENV[type.to_s]) if ENV[type.to_s]
@@ -586,10 +593,16 @@ module Kitchen
586
593
  end
587
594
  end
588
595
 
596
+ # @return [Hash] a hash of attribute keys and deprecation messages which
597
+ # has been merged with any superclass deprecations
598
+ # @api private
589
599
  def deprecated_attributes
590
600
  @deprecated_attributes ||= {}.merge(super_deprecated_attributes)
591
601
  end
592
602
 
603
+ # @return [Hash] a hash of deprecated attributes from the superclass, or
604
+ # an empty hash when the superclass has none
605
+ # @api private
593
606
  def super_deprecated_attributes
594
607
  if superclass.respond_to?(:deprecated_attributes)
595
608
  superclass.deprecated_attributes
@@ -651,6 +651,11 @@ module Kitchen
651
651
  # Runs all legacy configuration conversions while keeping DataMunger as the
652
652
  # public facade for destructive normalization.
653
653
  class LegacyConfigNormalizer
654
+ # The legacy conversion methods to invoke, in order, when normalizing
655
+ # raw configuration data.
656
+ #
657
+ # @return [Array<Symbol>] ordered DataMunger method names
658
+ # @api private
654
659
  STEPS = %i{
655
660
  convert_legacy_driver_format!
656
661
  convert_legacy_chef_paths_format!
@@ -665,6 +670,10 @@ module Kitchen
665
670
  @data_munger = data_munger
666
671
  end
667
672
 
673
+ # Destructively runs every conversion in {STEPS} against the data.
674
+ #
675
+ # @return [void]
676
+ # @api private
668
677
  def normalize!
669
678
  STEPS.each { |step| data_munger.send(step) }
670
679
  end
@@ -680,6 +689,16 @@ module Kitchen
680
689
  @data_munger = data_munger
681
690
  end
682
691
 
692
+ # Merges the default, common, platform, and suite layers for one plugin
693
+ # key, with later layers winning over earlier ones.
694
+ #
695
+ # @param key [Symbol] the plugin key to merge, such as `:driver`
696
+ # @param suite [String] a suite name
697
+ # @param platform [String] a platform name
698
+ # @param default_key [Symbol] the key used when normalizing data
699
+ # sub-hashes
700
+ # @return [Hash] a new merged Hash
701
+ # @api private
683
702
  def merged_data_for(key, suite, platform, default_key)
684
703
  ddata = data_munger.send(:normalized_default_data, key, default_key, suite, platform)
685
704
  cdata = data_munger.send(:normalized_common_data, key, default_key)
@@ -16,7 +16,7 @@ require_relative "../lazy_hash"
16
16
  require_relative "../logging"
17
17
  require_relative "../plugin_base"
18
18
  require_relative "../shell_out"
19
- require "time" unless defined?(Time)
19
+ require "time" unless defined?(Time.zone_offset)
20
20
 
21
21
  module Kitchen
22
22
  module Driver
@@ -59,7 +59,7 @@ module Kitchen
59
59
  # Check system and configuration for common errors.
60
60
  #
61
61
  # @param state [Hash] mutable instance and driver state
62
- # @returns [Boolean] Return true if a problem is found.
62
+ # @return [Boolean] Return true if a problem is found.
63
63
  def doctor(state)
64
64
  false
65
65
  end
@@ -108,7 +108,7 @@ module Kitchen
108
108
  # Cache directory that a driver could implement to inform the provisioner
109
109
  # that it can leverage it internally
110
110
  #
111
- # @return path [String] a path of the cache directory
111
+ # @return [String] a path of the cache directory
112
112
  def cache_directory; end
113
113
 
114
114
  private
@@ -11,7 +11,7 @@
11
11
  # limitations under the License.
12
12
 
13
13
  require_relative "../../kitchen"
14
- require "time" unless defined?(Time)
14
+ require "time" unless defined?(Time.zone_offset)
15
15
 
16
16
  module Kitchen
17
17
  module Driver
@@ -36,12 +36,18 @@ module Kitchen
36
36
  report(:create, state)
37
37
  end
38
38
 
39
- # (see Base#setup)
39
+ # Reports that the setup action would have taken place.
40
+ #
41
+ # @param state [Hash] the instance state hash
42
+ # @return [void]
40
43
  def setup(state)
41
44
  report(:setup, state)
42
45
  end
43
46
 
44
- # (see Base#verify)
47
+ # Reports that the verify action would have taken place.
48
+ #
49
+ # @param state [Hash] the instance state hash
50
+ # @return [void]
45
51
  def verify(state)
46
52
  report(:verify, state)
47
53
  end
@@ -59,6 +59,12 @@ module Kitchen
59
59
  arr.flatten
60
60
  end
61
61
 
62
+ # Creates an array of strings representing an exception's backtrace,
63
+ # wrapped in header and footer lines.
64
+ #
65
+ # @param exception [::Exception] an exception
66
+ # @return [Array<String>] a formatted backtrace, or an empty array when the
67
+ # exception has none
62
68
  def self.formatted_backtrace(exception)
63
69
  if exception.backtrace.nil?
64
70
  []
@@ -100,7 +106,7 @@ module Kitchen
100
106
  # output when parsing the output from the commands like
101
107
  # kitchen diagnose.
102
108
  #
103
- # @params lines [Array<String>] Array of lines that needs to be printed
109
+ # @param lines [Array<String>] Array of lines that needs to be printed
104
110
  def self.warn_on_stderr(lines)
105
111
  Array(lines).each do |line|
106
112
  line = Color.colorize(line, :blue) if Kitchen.tty?
@@ -19,6 +19,10 @@ require "rubygems/gem_runner"
19
19
  require "thor/group"
20
20
 
21
21
  module Kitchen
22
+ # Namespace for Thor generators that scaffold Test Kitchen configuration
23
+ # into a project.
24
+ #
25
+ # @author Fletcher Nichol <fnichol@nichol.ca>
22
26
  module Generator
23
27
  # A project initialization generator, to help prepare a cookbook project
24
28
  # for testing with Kitchen.