test-kitchen 1.9.0 → 1.9.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d0bfb5c1983b33e20f7925f0a16a11715722709f
4
- data.tar.gz: 94e6416a2bd326c8af32f5f487d9ea03a3955c60
3
+ metadata.gz: 25811e79e5d135e683b432c2b949b6e33ee76468
4
+ data.tar.gz: 13989d7ee63d36e9d6fccd56b38b2e86b857f601
5
5
  SHA512:
6
- metadata.gz: 915072c1d3a53cf5efd32f13b39e05265dc16b5784cc1c865e71a2e4aae0c040c52e605c0f98b58694379575ccee537ee4e34e51573972efa5720519a9809774
7
- data.tar.gz: 8c66b2c4a90bfa708304a8174c834f6192f8721c7407137f71336f6a71cb79b380dcfa8bc417dec135731641e18fa24f81735d501fdaa3d6ca17e7850fcc8fa9
6
+ metadata.gz: 5aec60ff68922a79b5c09b7fdaf39dd54b4a91e6c487eeff72477b924113ff5292c48a9bf48885e60ea3e9e88ce244f0b48ecf5ea91d47fe01b734126abc6705
7
+ data.tar.gz: 969e6244b72135b1fbae2ba62c89818237c5dc8eb5b3c9e2a0a0d1906bedc3142b2ed775ab1c202a63e87561315b36e4942c84d355790680eba328e754e82b2c
data/CHANGELOG.md CHANGED
@@ -1,7 +1,16 @@
1
1
  # Change Log
2
2
 
3
- ## [1.9.0](https://github.com/test-kitchen/test-kitchen/tree/1.9.0) (2016-05-26)
4
- [Full Changelog](https://github.com/test-kitchen/test-kitchen/compare/v1.8.0...1.9.0)
3
+ ## [v1.9.1](https://github.com/test-kitchen/test-kitchen/tree/v1.9.1) (2016-06-02)
4
+ [Full Changelog](https://github.com/test-kitchen/test-kitchen/compare/v1.9.0...v1.9.1)
5
+
6
+ **Implemented enhancements:**
7
+
8
+ - Allow rake task to use env var [\#1046](https://github.com/test-kitchen/test-kitchen/pull/1046) ([smurawski](https://github.com/smurawski))
9
+ - Add color options [\#1032](https://github.com/test-kitchen/test-kitchen/pull/1032) ([jorhett](https://github.com/jorhett))
10
+ - Add support for SSH connection debugging. [\#990](https://github.com/test-kitchen/test-kitchen/pull/990) ([rhass](https://github.com/rhass))
11
+
12
+ ## [1.9.0](https://github.com/test-kitchen/test-kitchen/tree/v1.9.0) (2016-05-26)
13
+ [Full Changelog](https://github.com/test-kitchen/test-kitchen/compare/v1.8.0...v1.9.0)
5
14
 
6
15
  **Implemented enhancements:**
7
16
 
@@ -17,24 +26,24 @@
17
26
  - Update `chef\_omnbius\_url` default value [\#1028](https://github.com/test-kitchen/test-kitchen/pull/1028) ([schisamo](https://github.com/schisamo))
18
27
  - Fix grammar in common\_sandbox warning message [\#1031](https://github.com/test-kitchen/test-kitchen/pull/1031) ([emachnic](https://github.com/emachnic))
19
28
 
20
- ## [1.8.0](https://github.com/test-kitchen/test-kitchen/tree/1.8.0) (2016-05-05)
21
- [Full Changelog](https://github.com/test-kitchen/test-kitchen/compare/v1.7.3...1.8.0)
29
+ ## [1.8.0](https://github.com/test-kitchen/test-kitchen/tree/v1.8.0) (2016-05-05)
30
+ [Full Changelog](https://github.com/test-kitchen/test-kitchen/compare/v1.7.3...v1.8.0)
22
31
 
23
32
  **Implemented enhancements:**
24
33
 
25
34
  - Add native policyfile resolution support [\#1014](https://github.com/test-kitchen/test-kitchen/pull/1014) ([danielsdeleo](https://github.com/danielsdeleo))
26
35
  - Provide the option to run all winrm commands through a scheduled task [\#1012](https://github.com/test-kitchen/test-kitchen/pull/1012) ([mwrock](https://github.com/mwrock))
27
36
 
28
- ## [1.7.3](https://github.com/test-kitchen/test-kitchen/tree/1.7.3) (2016-04-13)
29
- [Full Changelog](https://github.com/test-kitchen/test-kitchen/compare/v1.7.2...1.7.3)
37
+ ## [1.7.3](https://github.com/test-kitchen/test-kitchen/tree/v1.7.3) (2016-04-13)
38
+ [Full Changelog](https://github.com/test-kitchen/test-kitchen/compare/v1.7.2...v1.7.3)
30
39
 
31
40
  **Fixed bugs:**
32
41
 
33
42
  - Test Kitchen on windows fails to upload data bags [\#1006](https://github.com/test-kitchen/test-kitchen/issues/1006)
34
43
  - Fixes busser install for older omnibus windows installs [\#1003](https://github.com/test-kitchen/test-kitchen/pull/1003) ([mwrock](https://github.com/mwrock))
35
44
 
36
- ## [1.7.2](https://github.com/test-kitchen/test-kitchen/tree/1.7.2) (2016-04-07)
37
- [Full Changelog](https://github.com/test-kitchen/test-kitchen/compare/v1.7.1...1.7.2)
45
+ ## [1.7.2](https://github.com/test-kitchen/test-kitchen/tree/v1.7.2) (2016-04-07)
46
+ [Full Changelog](https://github.com/test-kitchen/test-kitchen/compare/v1.7.1...v1.7.2)
38
47
 
39
48
  **Merged pull requests:**
40
49
 
data/MAINTAINERS.md CHANGED
@@ -15,10 +15,11 @@ receive a veto from the Lieutenant or the Project Lead.
15
15
  ## Maintainers
16
16
 
17
17
  * [Adam Leff](https://github.com/adamleff)
18
+ * [Chris Hartmann](https://github.com/chris-rock)
18
19
  * [Jennifer Davis](https://github.com/iennae)
20
+ * [Kimball Johnson](https://github.com/drrk)
21
+ * [Lamont Granquist](https://github.com/lamont-granquist)
19
22
  * [Matt Wrock](https://github.com/mwrock)
20
- * [Steven Murawski](http://github.com/smurawski)
21
- * [Chris Hartmann](https://github.com/chris-rock)
22
- * [Sean Omeara](http://github.com/someara)
23
23
  * [Robb Kidd](https://github.com/robbkidd)
24
- * [Kimball Johnson](https://github.com/drrk)
24
+ * [Sean Omeara](http://github.com/someara)
25
+ * [Steven Murawski](http://github.com/smurawski)
data/Rakefile CHANGED
@@ -72,7 +72,7 @@ begin
72
72
  require "kitchen/version"
73
73
 
74
74
  GitHubChangelogGenerator::RakeTask.new :changelog do |config|
75
- config.future_release = Kitchen::VERSION
75
+ config.future_release = "v#{Kitchen::VERSION}"
76
76
  config.enhancement_labels = "enhancement,Enhancement,New Feature,Feature,Improvement".split(",")
77
77
  config.bug_labels = "bug,Bug".split(",")
78
78
  config.exclude_labels = %w[Duplicate Question Discussion No_Changelog]
data/lib/kitchen/cli.rb CHANGED
@@ -91,6 +91,10 @@ module Kitchen
91
91
  method_option :log_overwrite,
92
92
  :desc => "Set to false to prevent log overwriting each time Test Kitchen runs",
93
93
  :type => :boolean
94
+ method_option :color,
95
+ :type => :boolean,
96
+ :lazy_default => $stdout.tty?,
97
+ :desc => "Toggle color output for STDOUT logger"
94
98
  end
95
99
 
96
100
  # Sets the test_base_path method_options
@@ -349,6 +353,7 @@ module Kitchen
349
353
  unless options[:log_overwrite].nil?
350
354
  @config.log_overwrite = options[:log_overwrite]
351
355
  end
356
+ @config.colorize = options[:color] unless options[:color].nil?
352
357
 
353
358
  if options[:test_base_path]
354
359
  # ensure we have an absolute path
@@ -81,6 +81,10 @@ module Kitchen
81
81
  # @api private
82
82
  attr_accessor :test_base_path
83
83
 
84
+ # @return [Boolean] whether to force color output or not in logger
85
+ # @api private
86
+ attr_accessor :colorize
87
+
84
88
  # Creates a new configuration, representing a particular testing
85
89
  # configuration for a project.
86
90
  #
@@ -104,6 +108,7 @@ module Kitchen
104
108
  @kitchen_root = options.fetch(:kitchen_root) { Dir.pwd }
105
109
  @log_level = options.fetch(:log_level) { Kitchen::DEFAULT_LOG_LEVEL }
106
110
  @log_overwrite = options.fetch(:log_overwrite) { Kitchen::DEFAULT_LOG_OVERWRITE }
111
+ @colorize = options.fetch(:colorize) { Kitchen.tty? }
107
112
  @log_root = options.fetch(:log_root) { default_log_root }
108
113
  @test_base_path = options.fetch(:test_base_path) { default_test_base_path }
109
114
  end
@@ -268,7 +273,8 @@ module Kitchen
268
273
  :logdev => log_location,
269
274
  :level => Util.to_logger_level(log_level),
270
275
  :log_overwrite => log_overwrite,
271
- :progname => name
276
+ :progname => name,
277
+ :colorize => @colorize
272
278
  )
273
279
  end
274
280
 
@@ -54,8 +54,10 @@ module Kitchen
54
54
  # messages (default: `"Kitchen"`)
55
55
  # @option options [IO] :stdout a standard out IO object to use
56
56
  # (default: `$stdout`)
57
+ # @option options [Boolean] :colorize whether to colorize output
58
+ # when Test Kitchen runs.
59
+ # (default: `$stdout.tty?`)
57
60
  def initialize(options = {})
58
- color = options[:color]
59
61
  @log_overwrite = if options[:log_overwrite].nil?
60
62
  default_log_overwrite
61
63
  else
@@ -64,7 +66,7 @@ module Kitchen
64
66
 
65
67
  @logdev = logdev_logger(options[:logdev], log_overwrite) if options[:logdev]
66
68
 
67
- populate_loggers(color, options)
69
+ populate_loggers(options)
68
70
 
69
71
  # These setters cannot be called until @loggers are populated because
70
72
  # they are delegated
@@ -75,11 +77,13 @@ module Kitchen
75
77
  # Pulled out for Rubocop complexity issues
76
78
  #
77
79
  # @api private
78
- def populate_loggers(color, options)
80
+ def populate_loggers(options)
79
81
  @loggers = []
80
82
  @loggers << logdev unless logdev.nil?
81
- @loggers << stdout_logger(options[:stdout], color) if options[:stdout]
82
- @loggers << stdout_logger($stdout, color) if @loggers.empty?
83
+ @loggers << stdout_logger(options[:stdout], options[:color], options[:colorize]) if
84
+ options[:stdout]
85
+ @loggers << stdout_logger($stdout, options[:color], options[:colorize]) if
86
+ @loggers.empty?
83
87
  end
84
88
  private :populate_loggers
85
89
 
@@ -286,11 +290,12 @@ module Kitchen
286
290
  #
287
291
  # @param stdout [IO] the IO object that represents stdout (or similar)
288
292
  # @param color [Symbol] color to use when outputing messages
293
+ # @param colorize [Boolean] whether to enable color
289
294
  # @return [StdoutLogger] a new logger
290
295
  # @api private
291
- def stdout_logger(stdout, color)
296
+ def stdout_logger(stdout, color, colorize)
292
297
  logger = StdoutLogger.new(stdout)
293
- if Kitchen.tty?
298
+ if colorize
294
299
  logger.formatter = proc do |_severity, _datetime, _progname, msg|
295
300
  Color.colorize("#{msg}", color).concat("\n")
296
301
  end
@@ -31,7 +31,14 @@ module Kitchen
31
31
  #
32
32
  # @yield [self] gives itself to the block
33
33
  def initialize
34
- @config = Kitchen::Config.new
34
+ @loader = Kitchen::Loader::YAML.new(
35
+ :project_config => ENV["KITCHEN_YAML"],
36
+ :local_config => ENV["KITCHEN_LOCAL_YAML"],
37
+ :global_config => ENV["KITCHEN_GLOBAL_YAML"]
38
+ )
39
+ @config = Kitchen::Config.new(
40
+ :loader => @loader
41
+ )
35
42
  Kitchen.logger = Kitchen.default_file_logger(nil, false)
36
43
  yield self if block_given?
37
44
  define
@@ -319,7 +319,8 @@ module Kitchen
319
319
  # @param data [Hash] merged configuration and mutable state data
320
320
  # @return [Hash] hash of connection options
321
321
  # @api private
322
- def connection_options(data) # rubocop:disable Metrics/MethodLength
322
+ # rubocop:disable Metrics/MethodLength, Metrics/AbcSize, Metrics/CyclomaticComplexity
323
+ def connection_options(data)
323
324
  opts = {
324
325
  :logger => logger,
325
326
  :user_known_hosts_file => "/dev/null",
@@ -342,6 +343,7 @@ module Kitchen
342
343
  opts[:auth_methods] = ["publickey"] if data[:ssh_key]
343
344
  opts[:password] = data[:password] if data.key?(:password)
344
345
  opts[:forward_agent] = data[:forward_agent] if data.key?(:forward_agent)
346
+ opts[:verbose] = data[:verbose].to_sym if data.key?(:verbose)
345
347
 
346
348
  opts
347
349
  end
@@ -17,5 +17,5 @@
17
17
  # limitations under the License.
18
18
 
19
19
  module Kitchen
20
- VERSION = "1.9.0"
20
+ VERSION = "1.9.1"
21
21
  end
@@ -41,9 +41,14 @@ module Kitchen
41
41
  @data || Hash.new
42
42
  end
43
43
  end
44
+
44
45
  end
45
46
 
46
47
  describe Kitchen::Config do
48
+ # Explicitly enable tty to test colorize default option later
49
+ before do
50
+ Kitchen.stubs(:tty?).returns(true)
51
+ end
47
52
 
48
53
  let(:loader) { Kitchen::DummyLoader.new }
49
54
  let(:config) { Kitchen::Config.new(opts) }
@@ -55,7 +60,8 @@ describe Kitchen::Config do
55
60
  :log_root => "/tmp/logs",
56
61
  :test_base_path => "/testing/yo",
57
62
  :log_level => :debug,
58
- :log_overwrite => false
63
+ :log_overwrite => false,
64
+ :colorize => false
59
65
  }
60
66
  end
61
67
 
@@ -70,7 +76,8 @@ describe Kitchen::Config do
70
76
  :kitchen_root => "/tmp/that/place",
71
77
  :test_base_path => "/testing/yo",
72
78
  :log_level => :debug,
73
- :log_overwrite => false
79
+ :log_overwrite => false,
80
+ :colorize => false
74
81
  }
75
82
  end
76
83
 
@@ -152,6 +159,19 @@ describe Kitchen::Config do
152
159
  end
153
160
  end
154
161
 
162
+ describe "#colorize" do
163
+
164
+ it "returns its colorize" do
165
+ config.colorize.must_equal false
166
+ end
167
+
168
+ it "uses true by default" do
169
+ opts.delete(:colorize)
170
+
171
+ config.colorize.must_equal true
172
+ end
173
+ end
174
+
155
175
  describe "#platforms" do
156
176
 
157
177
  before do
@@ -339,7 +359,8 @@ describe Kitchen::Config do
339
359
  :logdev => "/tmp/logs/tiny-unax.log",
340
360
  :log_overwrite => false,
341
361
  :level => 0,
342
- :progname => "tiny-unax"
362
+ :progname => "tiny-unax",
363
+ :colorize => false
343
364
  )
344
365
 
345
366
  config.instances
@@ -23,7 +23,6 @@ require "kitchen"
23
23
  describe Kitchen::Logger do
24
24
 
25
25
  before do
26
- Kitchen.stubs(:tty?).returns(true)
27
26
  @orig_stdout = $stdout
28
27
  $stdout = StringIO.new
29
28
  end
@@ -37,7 +36,7 @@ describe Kitchen::Logger do
37
36
  end
38
37
 
39
38
  let(:opts) do
40
- { :color => :red }
39
+ { :color => :red, :colorize => true }
41
40
  end
42
41
 
43
42
  let(:logger) do
@@ -110,7 +109,7 @@ describe Kitchen::Logger do
110
109
  end
111
110
 
112
111
  it "sets up a simple STDOUT logger by default with no color" do
113
- Kitchen.stubs(:tty?).returns(false)
112
+ opts[:colorize] = false
114
113
  opts.delete(:stdout)
115
114
  logger.info("hello")
116
115
 
@@ -124,7 +123,7 @@ describe Kitchen::Logger do
124
123
  end
125
124
 
126
125
  it "accepts a :stdout option to redirect output with no color" do
127
- Kitchen.stubs(:tty?).returns(false)
126
+ opts[:colorize] = false
128
127
  logger.info("hello")
129
128
 
130
129
  stdout.string.must_equal " hello\n"
@@ -141,7 +140,7 @@ describe Kitchen::Logger do
141
140
  end
142
141
 
143
142
  it "logs to banner with no color" do
144
- Kitchen.stubs(:tty?).returns(false)
143
+ opts[:colorize] = false
145
144
  logger.banner("yo")
146
145
 
147
146
  stdout.string.must_equal "-----> yo\n"
@@ -154,7 +153,7 @@ describe Kitchen::Logger do
154
153
  end
155
154
 
156
155
  it "logs to debug with no color" do
157
- Kitchen.stubs(:tty?).returns(false)
156
+ opts[:colorize] = false
158
157
  logger.debug("yo")
159
158
 
160
159
  stdout.string.must_equal "D yo\n"
@@ -167,7 +166,7 @@ describe Kitchen::Logger do
167
166
  end
168
167
 
169
168
  it "logs to info with no color" do
170
- Kitchen.stubs(:tty?).returns(false)
169
+ opts[:colorize] = false
171
170
  logger.info("yo")
172
171
 
173
172
  stdout.string.must_equal " yo\n"
@@ -180,7 +179,7 @@ describe Kitchen::Logger do
180
179
  end
181
180
 
182
181
  it "logs to error with no color" do
183
- Kitchen.stubs(:tty?).returns(false)
182
+ opts[:colorize] = false
184
183
  logger.error("yo")
185
184
 
186
185
  stdout.string.must_equal ">>>>>> yo\n"
@@ -193,7 +192,7 @@ describe Kitchen::Logger do
193
192
  end
194
193
 
195
194
  it "logs to warn with no color" do
196
- Kitchen.stubs(:tty?).returns(false)
195
+ opts[:colorize] = false
197
196
  logger.warn("yo")
198
197
 
199
198
  stdout.string.must_equal "$$$$$$ yo\n"
@@ -206,7 +205,7 @@ describe Kitchen::Logger do
206
205
  end
207
206
 
208
207
  it "logs to fatal with no color" do
209
- Kitchen.stubs(:tty?).returns(false)
208
+ opts[:colorize] = false
210
209
  logger.fatal("yo")
211
210
 
212
211
  stdout.string.must_equal "!!!!!! yo\n"
@@ -219,7 +218,7 @@ describe Kitchen::Logger do
219
218
  end
220
219
 
221
220
  it "logs to unknown with no color" do
222
- Kitchen.stubs(:tty?).returns(false)
221
+ opts[:colorize] = false
223
222
  logger.unknown("yo")
224
223
 
225
224
  stdout.string.must_equal "?????? yo\n"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test-kitchen
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.0
4
+ version: 1.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fletcher Nichol
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-26 00:00:00.000000000 Z
11
+ date: 2016-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-shellout