test-kitchen 3.2.0 → 3.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: 6ca7e5ea2276e74e8d5d6555731377aa0aacce64482f3ff810f18bca54095616
4
- data.tar.gz: a726dfed16b6c6177559ed80a6450573fda9b9d3777aa008b3d639a81f152201
3
+ metadata.gz: d13b33db25f75d1d7f7a89d6da2a7eb2e78da9a8c7416ed6cf7a8d72e2e690a2
4
+ data.tar.gz: bb0352e0588277a0cff8d03364e09608cbd4f68218824a041d26d2f7c3c74a4b
5
5
  SHA512:
6
- metadata.gz: 69456998d9b85ad5d28f522a98d7668279081c67a5c8dbdf17b299de2a8364d65064a641088d32f0dd820305beb07263ca0f2c66c49f6e433b9b9a3c49fe2b9b
7
- data.tar.gz: c24f12f481427bf8a259afaaf09b93efe23c2d27632083fc3b78a25182a35e37f2fcfabf8344a7f0b30745a27b205904e21e247540e486e13f9810b8831db039
6
+ metadata.gz: 3d6cd7cdfff82e128a602f8eab578834168051940aadb50fdee9988f45ae9baa1b20053dc8580e69ce70ad160edb4d46e8bdf458cf36245a4dff97d13f128175
7
+ data.tar.gz: f05de5e3be22a367cdafb162e70651fcf9b9f881d8948654988c93648f650619ef63b2b2cf70d55b0818e94f057695c06465cf59f5a9168aa085ebb4710aa1f3
@@ -681,25 +681,42 @@ module Kitchen
681
681
  chef_cmds(base_cmd).join(separator)
682
682
  end
683
683
 
684
- # Gives an array of command
684
+ # Gives an array of commands
685
685
  # @api private
686
686
  def chef_cmds(base_cmd)
687
- cmd = prefix_command(wrap_shell_code(
688
- [base_cmd, *chef_args(config_filename), last_exit_code].join(" ")
689
- .tap { |str| str.insert(0, reload_ps1_path) if windows_os? }
690
- ))
691
-
692
- cmds = [cmd].cycle(config[:multiple_converge].to_i).to_a
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
@@ -16,5 +16,5 @@
16
16
  # limitations under the License.
17
17
 
18
18
  module Kitchen
19
- VERSION = "3.2.0".freeze
19
+ VERSION = "3.2.1".freeze
20
20
  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: 3.2.0
4
+ version: 3.2.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: 2021-11-17 00:00:00.000000000 Z
11
+ date: 2021-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-shellout