test-kitchen 1.14.1 → 1.14.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Berksfile +1 -1
- data/CHANGELOG.md +7 -0
- data/Gemfile +1 -1
- data/Guardfile +5 -5
- data/Rakefile +5 -5
- data/bin/kitchen +1 -1
- data/features/step_definitions/gem_steps.rb +6 -6
- data/features/support/env.rb +6 -7
- data/lib/kitchen.rb +5 -7
- data/lib/kitchen/base64_stream.rb +2 -8
- data/lib/kitchen/cli.rb +76 -80
- data/lib/kitchen/collection.rb +0 -2
- data/lib/kitchen/color.rb +7 -9
- data/lib/kitchen/command.rb +0 -4
- data/lib/kitchen/command/action.rb +0 -3
- data/lib/kitchen/command/console.rb +4 -7
- data/lib/kitchen/command/diagnose.rb +7 -14
- data/lib/kitchen/command/driver_discover.rb +1 -4
- data/lib/kitchen/command/exec.rb +0 -3
- data/lib/kitchen/command/list.rb +9 -12
- data/lib/kitchen/command/login.rb +0 -3
- data/lib/kitchen/command/package.rb +0 -3
- data/lib/kitchen/command/sink.rb +6 -9
- data/lib/kitchen/command/test.rb +1 -4
- data/lib/kitchen/config.rb +25 -27
- data/lib/kitchen/configurable.rb +26 -31
- data/lib/kitchen/data_munger.rb +34 -36
- data/lib/kitchen/diagnostic.rb +5 -7
- data/lib/kitchen/driver.rb +3 -5
- data/lib/kitchen/driver/base.rb +0 -3
- data/lib/kitchen/driver/dummy.rb +0 -3
- data/lib/kitchen/driver/proxy.rb +0 -3
- data/lib/kitchen/driver/ssh_base.rb +13 -16
- data/lib/kitchen/errors.rb +11 -16
- data/lib/kitchen/generator/driver_create.rb +18 -21
- data/lib/kitchen/generator/init.rb +21 -26
- data/lib/kitchen/instance.rb +19 -23
- data/lib/kitchen/lazy_hash.rb +1 -2
- data/lib/kitchen/loader/yaml.rb +22 -25
- data/lib/kitchen/logger.rb +9 -14
- data/lib/kitchen/logging.rb +0 -3
- data/lib/kitchen/login_command.rb +0 -2
- data/lib/kitchen/metadata_chopper.rb +0 -2
- data/lib/kitchen/platform.rb +1 -3
- data/lib/kitchen/provisioner.rb +3 -5
- data/lib/kitchen/provisioner/base.rb +2 -5
- data/lib/kitchen/provisioner/chef/berkshelf.rb +1 -5
- data/lib/kitchen/provisioner/chef/common_sandbox.rb +24 -29
- data/lib/kitchen/provisioner/chef/librarian.rb +2 -6
- data/lib/kitchen/provisioner/chef/policyfile.rb +4 -8
- data/lib/kitchen/provisioner/chef_apply.rb +14 -17
- data/lib/kitchen/provisioner/chef_base.rb +43 -46
- data/lib/kitchen/provisioner/chef_solo.rb +10 -13
- data/lib/kitchen/provisioner/chef_zero.rb +22 -29
- data/lib/kitchen/provisioner/dummy.rb +0 -3
- data/lib/kitchen/provisioner/shell.rb +6 -9
- data/lib/kitchen/rake_tasks.rb +4 -6
- data/lib/kitchen/shell_out.rb +3 -5
- data/lib/kitchen/ssh.rb +16 -22
- data/lib/kitchen/state_file.rb +3 -5
- data/lib/kitchen/suite.rb +0 -2
- data/lib/kitchen/thor_tasks.rb +2 -4
- data/lib/kitchen/transport.rb +3 -5
- data/lib/kitchen/transport/base.rb +1 -7
- data/lib/kitchen/transport/dummy.rb +0 -4
- data/lib/kitchen/transport/ssh.rb +41 -47
- data/lib/kitchen/transport/winrm.rb +41 -40
- data/lib/kitchen/util.rb +1 -3
- data/lib/kitchen/verifier.rb +3 -5
- data/lib/kitchen/verifier/base.rb +2 -5
- data/lib/kitchen/verifier/busser.rb +24 -24
- data/lib/kitchen/verifier/dummy.rb +0 -3
- data/lib/kitchen/verifier/shell.rb +1 -3
- data/lib/kitchen/version.rb +1 -1
- data/lib/vendor/hash_recursive_merge.rb +0 -2
- data/spec/kitchen/base64_stream_spec.rb +3 -6
- data/spec/kitchen/cli_spec.rb +0 -2
- data/spec/kitchen/collection_spec.rb +4 -8
- data/spec/kitchen/color_spec.rb +0 -3
- data/spec/kitchen/config_spec.rb +91 -106
- data/spec/kitchen/configurable_spec.rb +44 -76
- data/spec/kitchen/data_munger_spec.rb +1178 -1247
- data/spec/kitchen/diagnostic_spec.rb +37 -38
- data/spec/kitchen/driver/base_spec.rb +7 -14
- data/spec/kitchen/driver/dummy_spec.rb +1 -7
- data/spec/kitchen/driver/proxy_spec.rb +2 -7
- data/spec/kitchen/driver/ssh_base_spec.rb +128 -149
- data/spec/kitchen/driver_spec.rb +7 -13
- data/spec/kitchen/errors_spec.rb +50 -60
- data/spec/kitchen/instance_spec.rb +217 -294
- data/spec/kitchen/lazy_hash_spec.rb +14 -18
- data/spec/kitchen/loader/yaml_spec.rb +201 -227
- data/spec/kitchen/logger_spec.rb +7 -15
- data/spec/kitchen/logging_spec.rb +1 -4
- data/spec/kitchen/login_command_spec.rb +3 -4
- data/spec/kitchen/metadata_chopper_spec.rb +0 -3
- data/spec/kitchen/platform_spec.rb +31 -32
- data/spec/kitchen/provisioner/base_spec.rb +22 -41
- data/spec/kitchen/provisioner/chef/policyfile_spec.rb +15 -15
- data/spec/kitchen/provisioner/chef_apply_spec.rb +8 -13
- data/spec/kitchen/provisioner/chef_base_spec.rb +150 -182
- data/spec/kitchen/provisioner/chef_solo_spec.rb +58 -72
- data/spec/kitchen/provisioner/chef_zero_spec.rb +99 -125
- data/spec/kitchen/provisioner/dummy_spec.rb +8 -11
- data/spec/kitchen/provisioner/shell_spec.rb +86 -103
- data/spec/kitchen/provisioner_spec.rb +5 -11
- data/spec/kitchen/shell_out_spec.rb +15 -19
- data/spec/kitchen/ssh_spec.rb +16 -35
- data/spec/kitchen/state_file_spec.rb +6 -11
- data/spec/kitchen/suite_spec.rb +5 -6
- data/spec/kitchen/transport/base_spec.rb +6 -14
- data/spec/kitchen/transport/ssh_spec.rb +39 -64
- data/spec/kitchen/transport/winrm_spec.rb +99 -127
- data/spec/kitchen/transport_spec.rb +7 -13
- data/spec/kitchen/util_spec.rb +17 -26
- data/spec/kitchen/verifier/base_spec.rb +24 -40
- data/spec/kitchen/verifier/busser_spec.rb +38 -68
- data/spec/kitchen/verifier/dummy_spec.rb +8 -11
- data/spec/kitchen/verifier/shell_spec.rb +14 -17
- data/spec/kitchen/verifier_spec.rb +7 -13
- data/spec/kitchen_spec.rb +4 -6
- data/spec/spec_helper.rb +1 -1
- data/spec/support/powershell_max_size_spec.rb +1 -2
- data/support/chef-client-zero.rb +3 -4
- data/test-kitchen.gemspec +4 -6
- metadata +9 -9
@@ -24,24 +24,23 @@ require "stringio"
|
|
24
24
|
require "kitchen/verifier/dummy"
|
25
25
|
|
26
26
|
describe Kitchen::Verifier::Dummy do
|
27
|
-
|
28
27
|
let(:logged_output) { StringIO.new }
|
29
28
|
let(:logger) { Logger.new(logged_output) }
|
30
|
-
let(:platform) { stub(:
|
31
|
-
let(:suite) { stub(:
|
29
|
+
let(:platform) { stub(os_type: nil, shell_type: nil) }
|
30
|
+
let(:suite) { stub(name: "fries") }
|
32
31
|
let(:state) { Hash.new }
|
33
32
|
|
34
33
|
let(:config) do
|
35
|
-
{ :
|
34
|
+
{ test_base_path: "/basist", kitchen_root: "/rooty" }
|
36
35
|
end
|
37
36
|
|
38
37
|
let(:instance) do
|
39
38
|
stub(
|
40
|
-
:
|
41
|
-
:
|
42
|
-
:
|
43
|
-
:
|
44
|
-
:
|
39
|
+
name: "coolbeans",
|
40
|
+
to_str: "instance",
|
41
|
+
logger: logger,
|
42
|
+
suite: suite,
|
43
|
+
platform: platform
|
45
44
|
)
|
46
45
|
end
|
47
46
|
|
@@ -58,7 +57,6 @@ describe Kitchen::Verifier::Dummy do
|
|
58
57
|
end
|
59
58
|
|
60
59
|
describe "configuration" do
|
61
|
-
|
62
60
|
it "sets :sleep to 0 by default" do
|
63
61
|
verifier[:sleep].must_equal 0
|
64
62
|
end
|
@@ -69,7 +67,6 @@ describe Kitchen::Verifier::Dummy do
|
|
69
67
|
end
|
70
68
|
|
71
69
|
describe "#call" do
|
72
|
-
|
73
70
|
it "calls sleep if :sleep value is greater than 0" do
|
74
71
|
config[:sleep] = 12.5
|
75
72
|
verifier.expects(:sleep).with(12.5).returns(true)
|
@@ -25,24 +25,23 @@ require "kitchen/verifier/shell"
|
|
25
25
|
require "kitchen/transport/ssh"
|
26
26
|
|
27
27
|
describe Kitchen::Verifier::Shell do
|
28
|
-
|
29
28
|
let(:logged_output) { StringIO.new }
|
30
29
|
let(:logger) { Logger.new(logged_output) }
|
31
|
-
let(:platform) { stub(:
|
32
|
-
let(:suite) { stub(:
|
30
|
+
let(:platform) { stub(os_type: nil, shell_type: nil, name: "coolbeans") }
|
31
|
+
let(:suite) { stub(name: "fries") }
|
33
32
|
let(:state) { Hash.new }
|
34
33
|
|
35
34
|
let(:config) do
|
36
|
-
{ :
|
35
|
+
{ test_base_path: "/basist", kitchen_root: "/rooty" }
|
37
36
|
end
|
38
37
|
|
39
38
|
let(:instance) do
|
40
39
|
stub(
|
41
|
-
:
|
42
|
-
:
|
43
|
-
:
|
44
|
-
:
|
45
|
-
:
|
40
|
+
name: [platform.name, suite.name].join("-"),
|
41
|
+
to_str: "instance",
|
42
|
+
logger: logger,
|
43
|
+
suite: suite,
|
44
|
+
platform: platform
|
46
45
|
)
|
47
46
|
end
|
48
47
|
|
@@ -59,7 +58,6 @@ describe Kitchen::Verifier::Shell do
|
|
59
58
|
end
|
60
59
|
|
61
60
|
describe "configuration" do
|
62
|
-
|
63
61
|
it "sets :sleep to 0 by default" do
|
64
62
|
verifier[:sleep].must_equal 0
|
65
63
|
end
|
@@ -74,7 +72,6 @@ describe Kitchen::Verifier::Shell do
|
|
74
72
|
end
|
75
73
|
|
76
74
|
describe "#call" do
|
77
|
-
|
78
75
|
describe "#shell_out" do
|
79
76
|
it "calls sleep if :sleep value is greater than 0" do
|
80
77
|
config[:sleep] = 3
|
@@ -124,12 +121,12 @@ describe Kitchen::Verifier::Shell do
|
|
124
121
|
|
125
122
|
let(:instance) do
|
126
123
|
stub(
|
127
|
-
:
|
128
|
-
:
|
129
|
-
:
|
130
|
-
:
|
131
|
-
:
|
132
|
-
:
|
124
|
+
name: "coolbeans",
|
125
|
+
to_str: "instance",
|
126
|
+
logger: logger,
|
127
|
+
platform: platform,
|
128
|
+
suite: suite,
|
129
|
+
transport: transport
|
133
130
|
)
|
134
131
|
end
|
135
132
|
|
@@ -33,14 +33,11 @@ module Kitchen
|
|
33
33
|
end
|
34
34
|
|
35
35
|
module Kitchen
|
36
|
-
|
37
36
|
module Verifier
|
38
|
-
|
39
37
|
class Coolbeans < Kitchen::Verifier::Base
|
40
38
|
end
|
41
39
|
|
42
40
|
class ItDepends < Kitchen::Verifier::Base
|
43
|
-
|
44
41
|
attr_reader :verify_call_count
|
45
42
|
|
46
43
|
def initialize(config = {})
|
@@ -54,7 +51,6 @@ module Kitchen
|
|
54
51
|
end
|
55
52
|
|
56
53
|
class UnstableDepends < Kitchen::Verifier::Base
|
57
|
-
|
58
54
|
def verify_dependencies
|
59
55
|
raise UserError, "Oh noes, you don't have software!"
|
60
56
|
end
|
@@ -63,9 +59,7 @@ module Kitchen
|
|
63
59
|
end
|
64
60
|
|
65
61
|
describe Kitchen::Verifier do
|
66
|
-
|
67
62
|
describe ".for_plugin" do
|
68
|
-
|
69
63
|
before do
|
70
64
|
Kitchen::Verifier.stubs(:require).returns(true)
|
71
65
|
end
|
@@ -77,7 +71,7 @@ describe Kitchen::Verifier do
|
|
77
71
|
end
|
78
72
|
|
79
73
|
it "returns a verifier initialized with its config" do
|
80
|
-
verifier = Kitchen::Verifier.for_plugin("coolbeans", :
|
74
|
+
verifier = Kitchen::Verifier.for_plugin("coolbeans", foo: "bar")
|
81
75
|
|
82
76
|
verifier[:foo].must_equal "bar"
|
83
77
|
end
|
@@ -100,21 +94,21 @@ describe Kitchen::Verifier do
|
|
100
94
|
it "raises ClientError if the verifier could not be required" do
|
101
95
|
Kitchen::Verifier.stubs(:require).raises(LoadError)
|
102
96
|
|
103
|
-
proc { Kitchen::Verifier.for_plugin("coolbeans", {}) }
|
104
|
-
must_raise Kitchen::ClientError
|
97
|
+
proc { Kitchen::Verifier.for_plugin("coolbeans", {}) }
|
98
|
+
.must_raise Kitchen::ClientError
|
105
99
|
end
|
106
100
|
|
107
101
|
it "raises ClientError if the verifier's class constant was not found" do
|
108
102
|
# pretend require worked
|
109
103
|
Kitchen::Verifier.stubs(:require).returns(true)
|
110
104
|
|
111
|
-
proc { Kitchen::Verifier.for_plugin("nope", {}) }
|
112
|
-
must_raise Kitchen::ClientError
|
105
|
+
proc { Kitchen::Verifier.for_plugin("nope", {}) }
|
106
|
+
.must_raise Kitchen::ClientError
|
113
107
|
end
|
114
108
|
|
115
109
|
it "raises UserError if #verify_dependencies failes" do
|
116
|
-
proc { Kitchen::Verifier.for_plugin("unstable_depends", {}) }
|
117
|
-
must_raise Kitchen::UserError
|
110
|
+
proc { Kitchen::Verifier.for_plugin("unstable_depends", {}) }
|
111
|
+
.must_raise Kitchen::UserError
|
118
112
|
end
|
119
113
|
end
|
120
114
|
end
|
data/spec/kitchen_spec.rb
CHANGED
@@ -21,7 +21,6 @@ require_relative "spec_helper"
|
|
21
21
|
require "kitchen"
|
22
22
|
|
23
23
|
describe "Kitchen" do
|
24
|
-
|
25
24
|
let(:stdout) { StringIO.new }
|
26
25
|
|
27
26
|
before do
|
@@ -39,7 +38,6 @@ describe "Kitchen" do
|
|
39
38
|
end
|
40
39
|
|
41
40
|
describe "defaults" do
|
42
|
-
|
43
41
|
it "sets DEFAULT_LOG_LEVEL to :info" do
|
44
42
|
Kitchen::DEFAULT_LOG_LEVEL.must_equal :info
|
45
43
|
end
|
@@ -66,8 +64,8 @@ describe "Kitchen" do
|
|
66
64
|
end
|
67
65
|
|
68
66
|
it ".source_root returns the root path of the gem" do
|
69
|
-
Kitchen.source_root
|
70
|
-
must_equal Pathname.new(File.expand_path("../..", __FILE__))
|
67
|
+
Kitchen.source_root
|
68
|
+
.must_equal Pathname.new(File.expand_path("../..", __FILE__))
|
71
69
|
end
|
72
70
|
|
73
71
|
it ".default_logger is a Kitchen::Logger" do
|
@@ -93,8 +91,8 @@ describe "Kitchen" do
|
|
93
91
|
it ".default_file_logger returns a logger that uses a file" do
|
94
92
|
Kitchen.default_file_logger.warn("uhoh")
|
95
93
|
|
96
|
-
IO.read(File.join(%w
|
97
|
-
must_match %r{ -- Kitchen: uhoh$}
|
94
|
+
IO.read(File.join(%w{.kitchen logs kitchen.log}))
|
95
|
+
.must_match %r{ -- Kitchen: uhoh$}
|
98
96
|
end
|
99
97
|
|
100
98
|
it ".default_file_logger accepts a level and log_overwrite" do
|
data/spec/spec_helper.rb
CHANGED
@@ -27,10 +27,9 @@ require_relative "../spec_helper"
|
|
27
27
|
# in terms of PowerShell invocations).
|
28
28
|
|
29
29
|
describe "PowerShell script max size" do
|
30
|
-
|
31
30
|
MAX_POWERSHELL_SIZE = 3010
|
32
31
|
|
33
|
-
Dir.glob(File.join(File.dirname(__FILE__), "../../support/*.ps1*")).each do|script|
|
32
|
+
Dir.glob(File.join(File.dirname(__FILE__), "../../support/*.ps1*")).each do |script|
|
34
33
|
base = File.basename(script)
|
35
34
|
|
36
35
|
it "support/#{base} size must be less than #{MAX_POWERSHELL_SIZE} bytes" do
|
data/support/chef-client-zero.rb
CHANGED
@@ -33,7 +33,6 @@ require "fileutils"
|
|
33
33
|
ENV["GEM_HOME"] = ENV["GEM_PATH"] = ENV["GEM_CACHE"] = nil
|
34
34
|
|
35
35
|
class ChefClientZero
|
36
|
-
|
37
36
|
def self.start
|
38
37
|
new.run
|
39
38
|
end
|
@@ -52,8 +51,8 @@ class ChefClientZero
|
|
52
51
|
chef_fs.write_pretty_json = true
|
53
52
|
|
54
53
|
@server = ChefZero::Server.new(
|
55
|
-
:
|
56
|
-
:
|
54
|
+
generate_real_keys: false,
|
55
|
+
data_store: Chef::ChefFS::ChefFSDataStore.new(chef_fs)
|
57
56
|
)
|
58
57
|
puts "-----> Starting Chef Zero server in #{chef_fs.fs_description}"
|
59
58
|
@server.start_background
|
@@ -70,7 +69,7 @@ class ChefClientZero
|
|
70
69
|
|
71
70
|
def run_chef_client
|
72
71
|
system("chef-client", *ARGV)
|
73
|
-
|
72
|
+
raise if $CHILD_STATUS != 0
|
74
73
|
end
|
75
74
|
end
|
76
75
|
|
data/test-kitchen.gemspec
CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |gem|
|
|
17
17
|
gem.homepage = "http://kitchen.ci"
|
18
18
|
|
19
19
|
gem.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
20
|
-
gem.executables = %w
|
20
|
+
gem.executables = %w{kitchen}
|
21
21
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
22
22
|
gem.require_paths = ["lib"]
|
23
23
|
|
@@ -41,7 +41,7 @@ Gem::Specification.new do |gem|
|
|
41
41
|
gem.add_development_dependency "winrm-fs", "~> 1.0"
|
42
42
|
|
43
43
|
gem.add_development_dependency "bundler", "~> 1.3"
|
44
|
-
gem.add_development_dependency "rake",
|
44
|
+
gem.add_development_dependency "rake", "~> 12.0"
|
45
45
|
gem.add_development_dependency "github_changelog_generator", "1.11.3"
|
46
46
|
|
47
47
|
gem.add_development_dependency "aruba", "~> 0.11"
|
@@ -56,8 +56,6 @@ Gem::Specification.new do |gem|
|
|
56
56
|
gem.add_development_dependency "simplecov", "~> 0.7"
|
57
57
|
gem.add_development_dependency "yard", "~> 0.8"
|
58
58
|
|
59
|
-
#
|
60
|
-
|
61
|
-
# enforced in CI
|
62
|
-
gem.add_development_dependency "finstyle", "1.5.0"
|
59
|
+
# Replacing finstyle in favor of chefstyle
|
60
|
+
gem.add_development_dependency "chefstyle"
|
63
61
|
end
|
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.14.
|
4
|
+
version: 1.14.2
|
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-12-
|
11
|
+
date: 2016-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mixlib-shellout
|
@@ -258,14 +258,14 @@ dependencies:
|
|
258
258
|
requirements:
|
259
259
|
- - "~>"
|
260
260
|
- !ruby/object:Gem::Version
|
261
|
-
version: '
|
261
|
+
version: '12.0'
|
262
262
|
type: :development
|
263
263
|
prerelease: false
|
264
264
|
version_requirements: !ruby/object:Gem::Requirement
|
265
265
|
requirements:
|
266
266
|
- - "~>"
|
267
267
|
- !ruby/object:Gem::Version
|
268
|
-
version: '
|
268
|
+
version: '12.0'
|
269
269
|
- !ruby/object:Gem::Dependency
|
270
270
|
name: github_changelog_generator
|
271
271
|
requirement: !ruby/object:Gem::Requirement
|
@@ -407,19 +407,19 @@ dependencies:
|
|
407
407
|
- !ruby/object:Gem::Version
|
408
408
|
version: '0.8'
|
409
409
|
- !ruby/object:Gem::Dependency
|
410
|
-
name:
|
410
|
+
name: chefstyle
|
411
411
|
requirement: !ruby/object:Gem::Requirement
|
412
412
|
requirements:
|
413
|
-
- -
|
413
|
+
- - ">="
|
414
414
|
- !ruby/object:Gem::Version
|
415
|
-
version:
|
415
|
+
version: '0'
|
416
416
|
type: :development
|
417
417
|
prerelease: false
|
418
418
|
version_requirements: !ruby/object:Gem::Requirement
|
419
419
|
requirements:
|
420
|
-
- -
|
420
|
+
- - ">="
|
421
421
|
- !ruby/object:Gem::Version
|
422
|
-
version:
|
422
|
+
version: '0'
|
423
423
|
description: Test Kitchen is an integration tool for developing and testing infrastructure
|
424
424
|
code and software on isolated target platforms.
|
425
425
|
email:
|