test-kitchen 3.1.0 → 3.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kitchen/configurable.rb +1 -1
- data/lib/kitchen/errors.rb +13 -0
- data/lib/kitchen/provisioner/chef_base.rb +32 -15
- data/lib/kitchen/transport/ssh.rb +5 -3
- data/lib/kitchen/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b57d5ccdfe054fcd290b2a6f4490f92e626d93d3b7c7bdc8704b3029e723392
|
4
|
+
data.tar.gz: 4d20fdf60ea362f63918232cf57bcbaebc8cc61d5732d71a80cbbf20961a057e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: adc9ea69942bc0938b8da3340ae0abe1ce78f409170c9d3e1d081179121db9508d072fb18232982e16e377d8f5bddbee9b90b887c22cc9039729b3cdc5daf494
|
7
|
+
data.tar.gz: eb8caaaf52882d104ff01f46283325f5455cfaf4f0e8a8a4cfa4792430dac560c2fb556727f8cc9f0fc6af877ba06fee687f763b58c0f3f17cac77841526f968
|
data/lib/kitchen/configurable.rb
CHANGED
@@ -241,7 +241,7 @@ module Kitchen
|
|
241
241
|
#{deprecated_config.keys.join("\n")}
|
242
242
|
Run 'kitchen doctor' for details.
|
243
243
|
MSG
|
244
|
-
|
244
|
+
Error.warn_on_stderr(warning)
|
245
245
|
|
246
246
|
# Set global var that the deprecation message has been printed
|
247
247
|
@@has_been_warned_of_deprecations = true
|
data/lib/kitchen/errors.rb
CHANGED
@@ -94,6 +94,19 @@ module Kitchen
|
|
94
94
|
"".center(22, "-"),
|
95
95
|
]
|
96
96
|
end
|
97
|
+
|
98
|
+
# Log a warn message on STDERR device.
|
99
|
+
# This will help to distinguish between the errors and
|
100
|
+
# output when parsing the output from the commands like
|
101
|
+
# kitchen diagnose.
|
102
|
+
#
|
103
|
+
# @params lines [Array<String>] Array of lines that needs to be printed
|
104
|
+
def self.warn_on_stderr(lines)
|
105
|
+
Array(lines).each do |line|
|
106
|
+
line = Color.colorize(line, :blue) if Kitchen.tty?
|
107
|
+
$stderr.puts(line)
|
108
|
+
end
|
109
|
+
end
|
97
110
|
end
|
98
111
|
|
99
112
|
# Base exception class from which all Kitchen exceptions derive. This class
|
@@ -69,7 +69,7 @@ module Kitchen
|
|
69
69
|
README.* VERSION metadata.{json,rb} attributes.rb recipe.rb
|
70
70
|
attributes/**/* definitions/**/* files/**/* libraries/**/*
|
71
71
|
providers/**/* recipes/**/* resources/**/* templates/**/*
|
72
|
-
ohai/**/*
|
72
|
+
ohai/**/* compliance/**/*
|
73
73
|
).join(",")
|
74
74
|
# to ease upgrades, allow the user to turn deprecation warnings into errors
|
75
75
|
default_config :deprecations_as_errors, false
|
@@ -681,25 +681,42 @@ module Kitchen
|
|
681
681
|
chef_cmds(base_cmd).join(separator)
|
682
682
|
end
|
683
683
|
|
684
|
-
# Gives an array of
|
684
|
+
# Gives an array of commands
|
685
685
|
# @api private
|
686
686
|
def chef_cmds(base_cmd)
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
if config[:enforce_idempotency]
|
695
|
-
idempotent_cmd = prefix_command(wrap_shell_code(
|
696
|
-
[base_cmd, *chef_args("client_no_updated_resources.rb"), last_exit_code].join(" ")
|
697
|
-
.tap { |str| str.insert(0, reload_ps1_path) if windows_os? }
|
698
|
-
))
|
699
|
-
cmds[-1] = idempotent_cmd
|
687
|
+
cmds = []
|
688
|
+
num_converges = config[:multiple_converge].to_i
|
689
|
+
idempotency = config[:enforce_idempotency]
|
690
|
+
|
691
|
+
# Execute Chef Client n-1 times, without exiting
|
692
|
+
(num_converges - 1).times do
|
693
|
+
cmds << wrapped_chef_cmd(base_cmd, config_filename)
|
700
694
|
end
|
695
|
+
|
696
|
+
# Append another execution with Windows specific Exit code helper or (for
|
697
|
+
# idempotency check) a specific config file which assures no changed resources.
|
698
|
+
cmds << unless idempotency
|
699
|
+
wrapped_chef_cmd(base_cmd, config_filename, append: last_exit_code)
|
700
|
+
else
|
701
|
+
wrapped_chef_cmd(base_cmd, "client_no_updated_resources.rb", append: last_exit_code)
|
702
|
+
end
|
701
703
|
cmds
|
702
704
|
end
|
705
|
+
|
706
|
+
# Concatenate all arguments and wrap it with shell-specifics
|
707
|
+
# @api private
|
708
|
+
def wrapped_chef_cmd(base_cmd, configfile, append: "")
|
709
|
+
args = []
|
710
|
+
|
711
|
+
args << base_cmd
|
712
|
+
args << chef_args(configfile)
|
713
|
+
args << append
|
714
|
+
|
715
|
+
shell_cmd = args.flatten.join(" ")
|
716
|
+
shell_cmd = shell_cmd.prepend(reload_ps1_path) if windows_os?
|
717
|
+
|
718
|
+
prefix_command(wrap_shell_code(shell_cmd))
|
719
|
+
end
|
703
720
|
end
|
704
721
|
end
|
705
722
|
end
|
@@ -176,9 +176,11 @@ module Kitchen
|
|
176
176
|
Array(locals).map do |local|
|
177
177
|
opts = File.directory?(local) ? { recursive: true } : {}
|
178
178
|
|
179
|
-
waits.push
|
180
|
-
|
181
|
-
|
179
|
+
waits.push(
|
180
|
+
session.scp.upload(local, remote, opts) do |_ch, name, sent, total|
|
181
|
+
logger.debug("Async Uploaded #{name} (#{total} bytes)") if sent == total
|
182
|
+
end
|
183
|
+
)
|
182
184
|
waits.shift.wait while waits.length >= max_ssh_sessions
|
183
185
|
end
|
184
186
|
waits.each(&:wait)
|
data/lib/kitchen/version.rb
CHANGED
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: 3.
|
4
|
+
version: 3.2.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: 2021-
|
11
|
+
date: 2021-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mixlib-shellout
|
@@ -520,7 +520,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
520
520
|
- !ruby/object:Gem::Version
|
521
521
|
version: '0'
|
522
522
|
requirements: []
|
523
|
-
rubygems_version: 3.2.
|
523
|
+
rubygems_version: 3.2.32
|
524
524
|
signing_key:
|
525
525
|
specification_version: 4
|
526
526
|
summary: Test Kitchen is an integration tool for developing and testing infrastructure
|