hybrid_platforms_conductor 33.0.0 → 33.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (242) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +6 -0
  3. data/bin/check-node +0 -1
  4. data/bin/deploy +0 -1
  5. data/bin/get_impacted_nodes +0 -1
  6. data/bin/last_deploys +8 -7
  7. data/bin/nodes_to_deploy +2 -2
  8. data/bin/setup +6 -6
  9. data/bin/topograph +1 -1
  10. data/lib/hybrid_platforms_conductor/action.rb +4 -4
  11. data/lib/hybrid_platforms_conductor/actions_executor.rb +37 -42
  12. data/lib/hybrid_platforms_conductor/bitbucket.rb +5 -4
  13. data/lib/hybrid_platforms_conductor/cmd_runner.rb +13 -12
  14. data/lib/hybrid_platforms_conductor/cmdb.rb +2 -2
  15. data/lib/hybrid_platforms_conductor/common_config_dsl/bitbucket.rb +2 -1
  16. data/lib/hybrid_platforms_conductor/common_config_dsl/confluence.rb +2 -1
  17. data/lib/hybrid_platforms_conductor/common_config_dsl/file_system_tests.rb +5 -4
  18. data/lib/hybrid_platforms_conductor/common_config_dsl/github.rb +4 -3
  19. data/lib/hybrid_platforms_conductor/common_config_dsl/idempotence_tests.rb +2 -2
  20. data/lib/hybrid_platforms_conductor/config.rb +7 -4
  21. data/lib/hybrid_platforms_conductor/confluence.rb +1 -1
  22. data/lib/hybrid_platforms_conductor/connector.rb +5 -2
  23. data/lib/hybrid_platforms_conductor/core_extensions/symbol/zero.rb +24 -0
  24. data/lib/hybrid_platforms_conductor/credentials.rb +39 -36
  25. data/lib/hybrid_platforms_conductor/current_dir_monitor.rb +4 -1
  26. data/lib/hybrid_platforms_conductor/deployer.rb +95 -96
  27. data/lib/hybrid_platforms_conductor/executable.rb +20 -15
  28. data/lib/hybrid_platforms_conductor/hpc_plugins/cmdb/config.rb +10 -7
  29. data/lib/hybrid_platforms_conductor/hpc_plugins/cmdb/host_ip.rb +1 -1
  30. data/lib/hybrid_platforms_conductor/hpc_plugins/cmdb/host_keys.rb +2 -2
  31. data/lib/hybrid_platforms_conductor/hpc_plugins/cmdb/platform_handlers.rb +4 -4
  32. data/lib/hybrid_platforms_conductor/hpc_plugins/connector/local.rb +2 -0
  33. data/lib/hybrid_platforms_conductor/hpc_plugins/connector/ssh.rb +45 -49
  34. data/lib/hybrid_platforms_conductor/hpc_plugins/log/remote_fs.rb +6 -5
  35. data/lib/hybrid_platforms_conductor/hpc_plugins/platform_handler/serverless_chef.rb +68 -66
  36. data/lib/hybrid_platforms_conductor/hpc_plugins/platform_handler/serverless_chef/dsl_parser.rb +13 -0
  37. data/lib/hybrid_platforms_conductor/hpc_plugins/platform_handler/serverless_chef/recipes_tree_builder.rb +39 -38
  38. data/lib/hybrid_platforms_conductor/hpc_plugins/platform_handler/yaml_inventory.rb +5 -4
  39. data/lib/hybrid_platforms_conductor/hpc_plugins/provisioner/docker.rb +43 -45
  40. data/lib/hybrid_platforms_conductor/hpc_plugins/provisioner/podman.rb +18 -20
  41. data/lib/hybrid_platforms_conductor/hpc_plugins/provisioner/proxmox.rb +118 -117
  42. data/lib/hybrid_platforms_conductor/hpc_plugins/provisioner/proxmox/proxmox_waiter.rb +39 -43
  43. data/lib/hybrid_platforms_conductor/hpc_plugins/provisioner/proxmox/reserve_proxmox_container +9 -13
  44. data/lib/hybrid_platforms_conductor/hpc_plugins/report/confluence.rb +2 -2
  45. data/lib/hybrid_platforms_conductor/hpc_plugins/report/mediawiki.rb +28 -21
  46. data/lib/hybrid_platforms_conductor/hpc_plugins/report/stdout.rb +26 -22
  47. data/lib/hybrid_platforms_conductor/hpc_plugins/secrets_reader/cli.rb +8 -6
  48. data/lib/hybrid_platforms_conductor/hpc_plugins/secrets_reader/thycotic.rb +7 -4
  49. data/lib/hybrid_platforms_conductor/hpc_plugins/test/bitbucket_conf.rb +3 -3
  50. data/lib/hybrid_platforms_conductor/hpc_plugins/test/check_deploy_and_idempotence.rb +4 -2
  51. data/lib/hybrid_platforms_conductor/hpc_plugins/test/deploy_freshness.rb +0 -1
  52. data/lib/hybrid_platforms_conductor/hpc_plugins/test/deploy_removes_root_access.rb +21 -19
  53. data/lib/hybrid_platforms_conductor/hpc_plugins/test/divergence.rb +2 -2
  54. data/lib/hybrid_platforms_conductor/hpc_plugins/test/executables.rb +2 -2
  55. data/lib/hybrid_platforms_conductor/hpc_plugins/test/file_system.rb +19 -21
  56. data/lib/hybrid_platforms_conductor/hpc_plugins/test/file_system_hdfs.rb +19 -21
  57. data/lib/hybrid_platforms_conductor/hpc_plugins/test/github_ci.rb +2 -3
  58. data/lib/hybrid_platforms_conductor/hpc_plugins/test/idempotence.rb +2 -2
  59. data/lib/hybrid_platforms_conductor/hpc_plugins/test/ip.rb +1 -1
  60. data/lib/hybrid_platforms_conductor/hpc_plugins/test/jenkins_ci_conf.rb +21 -22
  61. data/lib/hybrid_platforms_conductor/hpc_plugins/test/jenkins_ci_masters_ok.rb +10 -12
  62. data/lib/hybrid_platforms_conductor/hpc_plugins/test/linear_strategy.rb +9 -9
  63. data/lib/hybrid_platforms_conductor/hpc_plugins/test/local_users.rb +2 -2
  64. data/lib/hybrid_platforms_conductor/hpc_plugins/test/mounts.rb +2 -2
  65. data/lib/hybrid_platforms_conductor/hpc_plugins/test/orphan_files.rb +10 -9
  66. data/lib/hybrid_platforms_conductor/hpc_plugins/test/ports.rb +2 -2
  67. data/lib/hybrid_platforms_conductor/hpc_plugins/test/private_ips.rb +5 -5
  68. data/lib/hybrid_platforms_conductor/hpc_plugins/test/public_ips.rb +5 -5
  69. data/lib/hybrid_platforms_conductor/hpc_plugins/test/spectre.rb +4 -6
  70. data/lib/hybrid_platforms_conductor/hpc_plugins/test/veids.rb +3 -3
  71. data/lib/hybrid_platforms_conductor/hpc_plugins/test/vulnerabilities.rb +25 -24
  72. data/lib/hybrid_platforms_conductor/hpc_plugins/test_report/confluence.rb +2 -2
  73. data/lib/hybrid_platforms_conductor/hpc_plugins/test_report/stdout.rb +8 -6
  74. data/lib/hybrid_platforms_conductor/io_router.rb +14 -13
  75. data/lib/hybrid_platforms_conductor/json_dumper.rb +2 -2
  76. data/lib/hybrid_platforms_conductor/log.rb +2 -2
  77. data/lib/hybrid_platforms_conductor/logger_helpers.rb +19 -16
  78. data/lib/hybrid_platforms_conductor/nodes_handler.rb +89 -71
  79. data/lib/hybrid_platforms_conductor/parallel_threads.rb +7 -11
  80. data/lib/hybrid_platforms_conductor/platform_handler.rb +7 -7
  81. data/lib/hybrid_platforms_conductor/platforms_handler.rb +5 -3
  82. data/lib/hybrid_platforms_conductor/plugin.rb +2 -2
  83. data/lib/hybrid_platforms_conductor/plugins.rb +13 -8
  84. data/lib/hybrid_platforms_conductor/provisioner.rb +4 -4
  85. data/lib/hybrid_platforms_conductor/report.rb +2 -2
  86. data/lib/hybrid_platforms_conductor/reports_handler.rb +3 -2
  87. data/lib/hybrid_platforms_conductor/secrets_reader.rb +2 -2
  88. data/lib/hybrid_platforms_conductor/services_handler.rb +32 -29
  89. data/lib/hybrid_platforms_conductor/test_only_remote_node.rb +1 -1
  90. data/lib/hybrid_platforms_conductor/test_report.rb +15 -18
  91. data/lib/hybrid_platforms_conductor/tests_runner.rb +116 -118
  92. data/lib/hybrid_platforms_conductor/thycotic.rb +28 -19
  93. data/lib/hybrid_platforms_conductor/topographer.rb +200 -190
  94. data/lib/hybrid_platforms_conductor/topographer/plugins/graphviz.rb +8 -8
  95. data/lib/hybrid_platforms_conductor/topographer/plugins/json.rb +4 -4
  96. data/lib/hybrid_platforms_conductor/version.rb +1 -1
  97. data/spec/hybrid_platforms_conductor_test.rb +6 -6
  98. data/spec/hybrid_platforms_conductor_test/api/actions_executor/actions/bash_spec.rb +16 -11
  99. data/spec/hybrid_platforms_conductor_test/api/actions_executor/actions/interactive_spec.rb +1 -1
  100. data/spec/hybrid_platforms_conductor_test/api/actions_executor/actions/remote_bash_spec.rb +23 -18
  101. data/spec/hybrid_platforms_conductor_test/api/actions_executor/actions/ruby_spec.rb +67 -49
  102. data/spec/hybrid_platforms_conductor_test/api/actions_executor/actions/scp_spec.rb +20 -14
  103. data/spec/hybrid_platforms_conductor_test/api/actions_executor/actions_spec.rb +63 -50
  104. data/spec/hybrid_platforms_conductor_test/api/actions_executor/connection_spec.rb +35 -35
  105. data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/local/connectable_nodes_spec.rb +12 -8
  106. data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/local/remote_actions_spec.rb +4 -7
  107. data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/cli_options_spec.rb +21 -22
  108. data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/config_dsl_spec.rb +23 -24
  109. data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/connectable_nodes_spec.rb +10 -6
  110. data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/connections_spec.rb +73 -54
  111. data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/global_helpers_spec.rb +145 -126
  112. data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/node_helpers_spec.rb +3 -3
  113. data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/remote_actions_spec.rb +29 -25
  114. data/spec/hybrid_platforms_conductor_test/api/actions_executor/logging_spec.rb +106 -91
  115. data/spec/hybrid_platforms_conductor_test/api/actions_executor/parallel_spec.rb +272 -244
  116. data/spec/hybrid_platforms_conductor_test/api/actions_executor/timeout_spec.rb +10 -12
  117. data/spec/hybrid_platforms_conductor_test/api/cmd_runner_spec.rb +36 -36
  118. data/spec/hybrid_platforms_conductor_test/api/config_spec.rb +24 -22
  119. data/spec/hybrid_platforms_conductor_test/api/deployer/check_spec.rb +4 -2
  120. data/spec/hybrid_platforms_conductor_test/api/deployer/config_dsl_spec.rb +7 -11
  121. data/spec/hybrid_platforms_conductor_test/api/deployer/deploy_spec.rb +34 -26
  122. data/spec/hybrid_platforms_conductor_test/api/deployer/log_plugins/remote_fs_spec.rb +21 -21
  123. data/spec/hybrid_platforms_conductor_test/api/deployer/parse_deploy_output_spec.rb +55 -59
  124. data/spec/hybrid_platforms_conductor_test/api/deployer/provisioner_spec.rb +36 -62
  125. data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/podman_spec.rb +17 -17
  126. data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/config_dsl_spec.rb +4 -4
  127. data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/create_spec.rb +44 -51
  128. data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/destroy_spec.rb +3 -3
  129. data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/ip_spec.rb +12 -16
  130. data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/reserve_proxmox_container/destroy_vm_spec.rb +31 -19
  131. data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/reserve_proxmox_container/expired_containers_spec.rb +324 -266
  132. data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/reserve_proxmox_container/ips_assignment_spec.rb +89 -61
  133. data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/reserve_proxmox_container/other_lxc_containers_resources_spec.rb +117 -93
  134. data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/reserve_proxmox_container/pve_node_resources_spec.rb +71 -54
  135. data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/reserve_proxmox_container/retries_spec.rb +10 -8
  136. data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/reserve_proxmox_container/vm_ids_assignment_spec.rb +80 -60
  137. data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/start_spec.rb +1 -1
  138. data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/state_spec.rb +1 -1
  139. data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/stop_spec.rb +1 -1
  140. data/spec/hybrid_platforms_conductor_test/api/deployer/secrets_reader_plugins/cli_spec.rb +21 -20
  141. data/spec/hybrid_platforms_conductor_test/api/deployer/secrets_reader_plugins/thycotic_spec.rb +70 -55
  142. data/spec/hybrid_platforms_conductor_test/api/nodes_handler/cmdbs/config_spec.rb +8 -10
  143. data/spec/hybrid_platforms_conductor_test/api/nodes_handler/cmdbs/host_ip_spec.rb +33 -24
  144. data/spec/hybrid_platforms_conductor_test/api/nodes_handler/cmdbs/host_keys_spec.rb +64 -51
  145. data/spec/hybrid_platforms_conductor_test/api/nodes_handler/cmdbs/platform_handlers_spec.rb +3 -3
  146. data/spec/hybrid_platforms_conductor_test/api/nodes_handler/cmdbs_plugins_api_spec.rb +50 -51
  147. data/spec/hybrid_platforms_conductor_test/api/nodes_handler/common_spec.rb +91 -81
  148. data/spec/hybrid_platforms_conductor_test/api/nodes_handler/config_dsl_spec.rb +14 -16
  149. data/spec/hybrid_platforms_conductor_test/api/nodes_handler/git_diff_impacts_spec.rb +51 -75
  150. data/spec/hybrid_platforms_conductor_test/api/nodes_handler/nodes_selectors_spec.rb +35 -26
  151. data/spec/hybrid_platforms_conductor_test/api/nodes_handler/platform_handlers_plugins_api_spec.rb +24 -16
  152. data/spec/hybrid_platforms_conductor_test/api/nodes_handler/several_platforms_spec.rb +29 -19
  153. data/spec/hybrid_platforms_conductor_test/api/platform_handler_spec.rb +4 -4
  154. data/spec/hybrid_platforms_conductor_test/api/platform_handlers/serverless_chef/config_dsl_spec.rb +2 -2
  155. data/spec/hybrid_platforms_conductor_test/api/platform_handlers/serverless_chef/deploy_output_parsing_spec.rb +6 -6
  156. data/spec/hybrid_platforms_conductor_test/api/platform_handlers/serverless_chef/diff_impacts_spec.rb +57 -99
  157. data/spec/hybrid_platforms_conductor_test/api/platform_handlers/serverless_chef/inventory_spec.rb +4 -4
  158. data/spec/hybrid_platforms_conductor_test/api/platform_handlers/serverless_chef/packaging_spec.rb +32 -35
  159. data/spec/hybrid_platforms_conductor_test/api/platform_handlers/serverless_chef/services_deployment_spec.rb +10 -10
  160. data/spec/hybrid_platforms_conductor_test/api/platforms_handler_spec.rb +38 -27
  161. data/spec/hybrid_platforms_conductor_test/api/plugins_spec.rb +46 -52
  162. data/spec/hybrid_platforms_conductor_test/api/reports_handler_spec.rb +2 -2
  163. data/spec/hybrid_platforms_conductor_test/api/services_handler/actions_to_deploy_spec.rb +90 -58
  164. data/spec/hybrid_platforms_conductor_test/api/services_handler/deploy_allowed_spec.rb +38 -34
  165. data/spec/hybrid_platforms_conductor_test/api/services_handler/log_info_spec.rb +11 -9
  166. data/spec/hybrid_platforms_conductor_test/api/services_handler/package_spec.rb +193 -171
  167. data/spec/hybrid_platforms_conductor_test/api/services_handler/parse_deploy_output_spec.rb +66 -54
  168. data/spec/hybrid_platforms_conductor_test/api/services_handler/prepare_for_deploy_spec.rb +147 -133
  169. data/spec/hybrid_platforms_conductor_test/api/tests_runner/common_spec.rb +69 -49
  170. data/spec/hybrid_platforms_conductor_test/api/tests_runner/global_spec.rb +4 -3
  171. data/spec/hybrid_platforms_conductor_test/api/tests_runner/node_check_spec.rb +8 -5
  172. data/spec/hybrid_platforms_conductor_test/api/tests_runner/node_spec.rb +8 -5
  173. data/spec/hybrid_platforms_conductor_test/api/tests_runner/node_ssh_spec.rb +30 -27
  174. data/spec/hybrid_platforms_conductor_test/api/tests_runner/platform_spec.rb +12 -9
  175. data/spec/hybrid_platforms_conductor_test/api/tests_runner/reports_spec.rb +48 -47
  176. data/spec/hybrid_platforms_conductor_test/api/tests_runner/test_plugins/bitbucket_conf_spec.rb +5 -5
  177. data/spec/hybrid_platforms_conductor_test/api/tests_runner/test_plugins/github_ci_spec.rb +5 -5
  178. data/spec/hybrid_platforms_conductor_test/api/tests_runner/test_reports_plugins/confluence_spec.rb +5 -5
  179. data/spec/hybrid_platforms_conductor_test/cmdb_plugins/test_cmdb.rb +9 -9
  180. data/spec/hybrid_platforms_conductor_test/cmdb_plugins/{test_cmdb2.rb → test_cmdb_2.rb} +6 -6
  181. data/spec/hybrid_platforms_conductor_test/cmdb_plugins/test_cmdb_others.rb +3 -3
  182. data/spec/hybrid_platforms_conductor_test/cmdb_plugins/{test_cmdb_others2.rb → test_cmdb_others_2.rb} +2 -2
  183. data/spec/hybrid_platforms_conductor_test/docs_spec.rb +1 -1
  184. data/spec/hybrid_platforms_conductor_test/executables/{check-node_spec.rb → check_node_spec.rb} +4 -6
  185. data/spec/hybrid_platforms_conductor_test/executables/deploy_spec.rb +4 -6
  186. data/spec/hybrid_platforms_conductor_test/executables/get_impacted_nodes_spec.rb +76 -77
  187. data/spec/hybrid_platforms_conductor_test/executables/last_deploys_spec.rb +13 -15
  188. data/spec/hybrid_platforms_conductor_test/executables/nodes_to_deploy_spec.rb +289 -307
  189. data/spec/hybrid_platforms_conductor_test/executables/options/actions_executor_spec.rb +4 -6
  190. data/spec/hybrid_platforms_conductor_test/executables/options/cmd_runner_spec.rb +3 -5
  191. data/spec/hybrid_platforms_conductor_test/executables/options/common_spec.rb +8 -9
  192. data/spec/hybrid_platforms_conductor_test/executables/options/deployer_spec.rb +12 -14
  193. data/spec/hybrid_platforms_conductor_test/executables/options/nodes_handler_spec.rb +9 -10
  194. data/spec/hybrid_platforms_conductor_test/executables/options/nodes_selectors_spec.rb +9 -10
  195. data/spec/hybrid_platforms_conductor_test/executables/options/reports_handler_spec.rb +1 -1
  196. data/spec/hybrid_platforms_conductor_test/executables/options/tests_runner_spec.rb +22 -22
  197. data/spec/hybrid_platforms_conductor_test/executables/report_spec.rb +22 -16
  198. data/spec/hybrid_platforms_conductor_test/executables/run_spec.rb +32 -32
  199. data/spec/hybrid_platforms_conductor_test/executables/ssh_config_spec.rb +7 -9
  200. data/spec/hybrid_platforms_conductor_test/executables/test_spec.rb +3 -5
  201. data/spec/hybrid_platforms_conductor_test/helpers/actions_executor_helpers.rb +2 -2
  202. data/spec/hybrid_platforms_conductor_test/helpers/cmd_runner_helpers.rb +4 -3
  203. data/spec/hybrid_platforms_conductor_test/helpers/cmdb_helpers.rb +2 -2
  204. data/spec/hybrid_platforms_conductor_test/helpers/config_helpers.rb +1 -1
  205. data/spec/hybrid_platforms_conductor_test/helpers/connector_ssh_helpers.rb +12 -13
  206. data/spec/hybrid_platforms_conductor_test/helpers/deployer_helpers.rb +216 -14
  207. data/spec/hybrid_platforms_conductor_test/helpers/executables_helpers.rb +11 -11
  208. data/spec/hybrid_platforms_conductor_test/helpers/nodes_handler_helpers.rb +1 -1
  209. data/spec/hybrid_platforms_conductor_test/helpers/platforms_handler_helpers.rb +39 -28
  210. data/spec/hybrid_platforms_conductor_test/helpers/plugins_helpers.rb +1 -1
  211. data/spec/hybrid_platforms_conductor_test/helpers/provisioner_proxmox_helpers.rb +86 -111
  212. data/spec/hybrid_platforms_conductor_test/helpers/reports_handler_helpers.rb +1 -1
  213. data/spec/hybrid_platforms_conductor_test/helpers/serverless_chef_helpers.rb +3 -3
  214. data/spec/hybrid_platforms_conductor_test/helpers/services_handler_helpers.rb +1 -1
  215. data/spec/hybrid_platforms_conductor_test/helpers/tests_runner_helpers.rb +1 -1
  216. data/spec/hybrid_platforms_conductor_test/mocked_lib/my_test_gem/hpc_plugins/test_plugin_type/{test_plugin_id1.rb → test_plugin_id_1.rb} +0 -0
  217. data/spec/hybrid_platforms_conductor_test/mocked_lib/my_test_gem/hpc_plugins/test_plugin_type/{test_plugin_id2.rb → test_plugin_id_2.rb} +0 -0
  218. data/spec/hybrid_platforms_conductor_test/mocked_lib/my_test_gem2/sub_dir/hpc_plugins/test_plugin_type/{test_plugin_id3.rb → test_plugin_id_3.rb} +0 -0
  219. data/spec/hybrid_platforms_conductor_test/mocked_lib/my_test_gem2/sub_dir/hpc_plugins/{test_plugin_type2/test_plugin_id4.rb → test_plugin_type_2/test_plugin_id_4.rb} +0 -0
  220. data/spec/hybrid_platforms_conductor_test/platform_handler_plugins/test.rb +1 -1
  221. data/spec/hybrid_platforms_conductor_test/platform_handler_plugins/{test2.rb → test_2.rb} +0 -0
  222. data/spec/hybrid_platforms_conductor_test/rubocop_spec.rb +31 -0
  223. data/spec/hybrid_platforms_conductor_test/serverless_chef_repositories/1_node/nodes/node.json +3 -3
  224. data/spec/hybrid_platforms_conductor_test/serverless_chef_repositories/data_bags/nodes/node.json +3 -3
  225. data/spec/hybrid_platforms_conductor_test/serverless_chef_repositories/recipes/cookbooks/test_cookbook_2/libraries/default.rb +1 -0
  226. data/spec/hybrid_platforms_conductor_test/serverless_chef_repositories/several_cookbooks/other_cookbooks/test_cookbook_2/libraries/default.rb +1 -0
  227. data/spec/hybrid_platforms_conductor_test/shared_examples/deployer.rb +952 -0
  228. data/spec/hybrid_platforms_conductor_test/test_connector.rb +3 -3
  229. data/spec/hybrid_platforms_conductor_test/test_log_no_read_plugin.rb +3 -1
  230. data/spec/hybrid_platforms_conductor_test/test_log_plugin.rb +3 -1
  231. data/spec/hybrid_platforms_conductor_test/test_plugins/global.rb +1 -0
  232. data/spec/hybrid_platforms_conductor_test/test_plugins/node.rb +1 -0
  233. data/spec/hybrid_platforms_conductor_test/test_plugins/node_check.rb +1 -0
  234. data/spec/hybrid_platforms_conductor_test/test_plugins/platform.rb +1 -0
  235. data/spec/hybrid_platforms_conductor_test/test_plugins/several_checks.rb +2 -2
  236. data/spec/hybrid_platforms_conductor_test/test_secrets_reader_plugin.rb +4 -4
  237. data/spec/hybrid_platforms_conductor_test/tests_report_plugin.rb +5 -6
  238. data/spec/spec_helper.rb +17 -18
  239. data/tools/check_md +16 -20
  240. data/tools/generate_mermaid +1 -1
  241. metadata +43 -13
  242. data/spec/hybrid_platforms_conductor_test/helpers/deployer_test_helpers.rb +0 -1152
@@ -4,7 +4,7 @@ describe 'Documentation' do
4
4
  check_stdout = `bundle exec tools/check_md README.md #{Dir.glob('docs/**/*.md').join(' ')}`.split("\n")
5
5
  summary_idx = check_stdout.index { |line| line =~ /^\d+ errors:$/ }
6
6
  expect(summary_idx).not_to eq(nil), "Could not parse check output: #{check_stdout.join("\n")}"
7
- expect(check_stdout[summary_idx]).to eq('0 errors:'), "Invalid links found: #{check_stdout[summary_idx..-1].join("\n")}"
7
+ expect(check_stdout[summary_idx]).to eq('0 errors:'), "Invalid links found: #{check_stdout[summary_idx..].join("\n")}"
8
8
  end
9
9
 
10
10
  end
@@ -3,13 +3,11 @@ describe 'check-node executable' do
3
3
  # Setup a platform for check-node tests
4
4
  #
5
5
  # Parameters::
6
- # * Proc: Code called when the platform is setup
6
+ # * *block* (Proc): Code called when the platform is setup
7
7
  # * Parameters::
8
8
  # * *repository* (String): Platform's repository
9
- def with_test_platform_for_check_node
10
- with_test_platform({ nodes: { 'node' => {} } }) do |repository|
11
- yield repository
12
- end
9
+ def with_test_platform_for_check_node(&block)
10
+ with_test_platform({ nodes: { 'node' => {} } }, &block)
13
11
  end
14
12
 
15
13
  it 'checks a given node' do
@@ -21,7 +19,7 @@ describe 'check-node executable' do
21
19
  end
22
20
  exit_code, stdout, stderr = run 'check-node', '--node', 'node'
23
21
  expect(exit_code).to eq 0
24
- expect(stdout).to match /Check ok/
22
+ expect(stdout).to match(/Check ok/)
25
23
  expect(stderr).to eq ''
26
24
  end
27
25
  end
@@ -3,13 +3,11 @@ describe 'deploy executable' do
3
3
  # Setup a platform for deploy tests
4
4
  #
5
5
  # Parameters::
6
- # * Proc: Code called when the platform is setup
6
+ # * *block* (Proc): Code called when the platform is setup
7
7
  # * Parameters::
8
8
  # * *repository* (String): Platform's repository
9
- def with_test_platform_for_deploy
10
- with_test_platform({ nodes: { 'node' => {} } }) do |repository|
11
- yield repository
12
- end
9
+ def with_test_platform_for_deploy(&block)
10
+ with_test_platform({ nodes: { 'node' => {} } }, &block)
13
11
  end
14
12
 
15
13
  it 'deploys a given node' do
@@ -21,7 +19,7 @@ describe 'deploy executable' do
21
19
  end
22
20
  exit_code, stdout, stderr = run 'deploy', '--node', 'node'
23
21
  expect(exit_code).to eq 0
24
- expect(stdout).to match /Deploy ok/
22
+ expect(stdout).to match(/Deploy ok/)
25
23
  expect(stderr).to eq ''
26
24
  end
27
25
  end
@@ -3,20 +3,19 @@ describe 'get_impacted_nodes executable' do
3
3
  # Setup a platform for get_impacted_nodes tests
4
4
  #
5
5
  # Parameters::
6
- # * Proc: Code called when the platform is setup
6
+ # * *block* (Proc): Code called when the platform is setup
7
7
  # * Parameters::
8
8
  # * *repository* (String): Platform's repository
9
- def with_test_platform_for_get_impacted_nodes
9
+ def with_test_platform_for_get_impacted_nodes(&block)
10
10
  with_test_platform(
11
11
  {
12
12
  nodes: {
13
13
  'node1' => { services: %w[service1] },
14
14
  'node2' => { services: %w[service2] }
15
15
  }
16
- }
17
- ) do |repository|
18
- yield repository
19
- end
16
+ },
17
+ &block
18
+ )
20
19
  end
21
20
 
22
21
  it 'returns nodes impacted by a git diff' do
@@ -26,22 +25,22 @@ describe 'get_impacted_nodes executable' do
26
25
  from_commit: 'master',
27
26
  to_commit: nil,
28
27
  smallest_set: false
29
- ) { [%w[node1 node2], %w[node1], %w[service2], false] }
28
+ ).and_return [%w[node1 node2], %w[node1], %w[service2], false]
30
29
  exit_code, stdout, stderr = run 'get_impacted_nodes', '--platform', 'platform'
31
30
  expect(exit_code).to eq 0
32
- expect(stdout).to eq <<~EOS
33
-
34
- * 1 impacted services:
35
- service2
36
-
37
- * 1 impacted nodes (directly):
38
- node1
39
-
40
- * 2 impacted nodes (total):
41
- node1
42
- node2
43
-
44
- EOS
31
+ expect(stdout).to eq <<~EO_STDOUT
32
+
33
+ * 1 impacted services:
34
+ service2
35
+
36
+ * 1 impacted nodes (directly):
37
+ node1
38
+
39
+ * 2 impacted nodes (total):
40
+ node1
41
+ node2
42
+
43
+ EO_STDOUT
45
44
  expect(stderr).to eq ''
46
45
  end
47
46
  end
@@ -53,23 +52,23 @@ describe 'get_impacted_nodes executable' do
53
52
  from_commit: 'master',
54
53
  to_commit: nil,
55
54
  smallest_set: false
56
- ) { [%w[node1 node2], %w[node1], %w[service2], true] }
55
+ ).and_return [%w[node1 node2], %w[node1], %w[service2], true]
57
56
  exit_code, stdout, stderr = run 'get_impacted_nodes', '--platform', 'platform'
58
57
  expect(exit_code).to eq 0
59
- expect(stdout).to eq <<~EOS
60
- * Potentially all nodes of this platform are impacted.
61
-
62
- * 1 impacted services:
63
- service2
64
-
65
- * 1 impacted nodes (directly):
66
- node1
67
-
68
- * 2 impacted nodes (total):
69
- node1
70
- node2
71
-
72
- EOS
58
+ expect(stdout).to eq <<~EO_STDOUT
59
+ * Potentially all nodes of this platform are impacted.
60
+
61
+ * 1 impacted services:
62
+ service2
63
+
64
+ * 1 impacted nodes (directly):
65
+ node1
66
+
67
+ * 2 impacted nodes (total):
68
+ node1
69
+ node2
70
+
71
+ EO_STDOUT
73
72
  expect(stderr).to eq ''
74
73
  end
75
74
  end
@@ -81,22 +80,22 @@ describe 'get_impacted_nodes executable' do
81
80
  from_commit: 'from_commit',
82
81
  to_commit: nil,
83
82
  smallest_set: false
84
- ) { [%w[node1 node2], %w[node1], %w[service2], false] }
83
+ ).and_return [%w[node1 node2], %w[node1], %w[service2], false]
85
84
  exit_code, stdout, stderr = run 'get_impacted_nodes', '--platform', 'platform', '--from-commit', 'from_commit'
86
85
  expect(exit_code).to eq 0
87
- expect(stdout).to eq <<~EOS
88
-
89
- * 1 impacted services:
90
- service2
91
-
92
- * 1 impacted nodes (directly):
93
- node1
94
-
95
- * 2 impacted nodes (total):
96
- node1
97
- node2
98
-
99
- EOS
86
+ expect(stdout).to eq <<~EO_STDOUT
87
+
88
+ * 1 impacted services:
89
+ service2
90
+
91
+ * 1 impacted nodes (directly):
92
+ node1
93
+
94
+ * 2 impacted nodes (total):
95
+ node1
96
+ node2
97
+
98
+ EO_STDOUT
100
99
  expect(stderr).to eq ''
101
100
  end
102
101
  end
@@ -108,22 +107,22 @@ describe 'get_impacted_nodes executable' do
108
107
  from_commit: 'master',
109
108
  to_commit: 'to_commit',
110
109
  smallest_set: false
111
- ) { [%w[node1 node2], %w[node1], %w[service2], false] }
110
+ ).and_return [%w[node1 node2], %w[node1], %w[service2], false]
112
111
  exit_code, stdout, stderr = run 'get_impacted_nodes', '--platform', 'platform', '--to-commit', 'to_commit'
113
112
  expect(exit_code).to eq 0
114
- expect(stdout).to eq <<~EOS
115
-
116
- * 1 impacted services:
117
- service2
118
-
119
- * 1 impacted nodes (directly):
120
- node1
121
-
122
- * 2 impacted nodes (total):
123
- node1
124
- node2
125
-
126
- EOS
113
+ expect(stdout).to eq <<~EO_STDOUT
114
+
115
+ * 1 impacted services:
116
+ service2
117
+
118
+ * 1 impacted nodes (directly):
119
+ node1
120
+
121
+ * 2 impacted nodes (total):
122
+ node1
123
+ node2
124
+
125
+ EO_STDOUT
127
126
  expect(stderr).to eq ''
128
127
  end
129
128
  end
@@ -135,22 +134,22 @@ describe 'get_impacted_nodes executable' do
135
134
  from_commit: 'master',
136
135
  to_commit: nil,
137
136
  smallest_set: true
138
- ) { [%w[node1 node2], %w[node1], %w[service2], false] }
137
+ ).and_return [%w[node1 node2], %w[node1], %w[service2], false]
139
138
  exit_code, stdout, stderr = run 'get_impacted_nodes', '--platform', 'platform', '--smallest-test-sample'
140
139
  expect(exit_code).to eq 0
141
- expect(stdout).to eq <<~EOS
142
-
143
- * 1 impacted services:
144
- service2
145
-
146
- * 1 impacted nodes (directly):
147
- node1
148
-
149
- * 2 impacted nodes (total smallest set):
150
- node1
151
- node2
152
-
153
- EOS
140
+ expect(stdout).to eq <<~EO_STDOUT
141
+
142
+ * 1 impacted services:
143
+ service2
144
+
145
+ * 1 impacted nodes (directly):
146
+ node1
147
+
148
+ * 2 impacted nodes (total smallest set):
149
+ node1
150
+ node2
151
+
152
+ EO_STDOUT
154
153
  expect(stderr).to eq ''
155
154
  end
156
155
  end
@@ -3,13 +3,11 @@ describe 'last_deploys executable' do
3
3
  # Setup a platform for last_deploys tests
4
4
  #
5
5
  # Parameters::
6
- # * Proc: Code called when the platform is setup
6
+ # * *block* (Proc): Code called when the platform is setup
7
7
  # * Parameters::
8
8
  # * *repository* (String): Platform's repository
9
- def with_test_platform_for_last_deploys
10
- with_test_platform({ nodes: { 'node1' => {}, 'node2' => {} } }) do |repository|
11
- yield repository
12
- end
9
+ def with_test_platform_for_last_deploys(&block)
10
+ with_test_platform({ nodes: { 'node1' => {}, 'node2' => {} } }, &block)
13
11
  end
14
12
 
15
13
  it 'checks all nodes by default' do
@@ -46,14 +44,14 @@ describe 'last_deploys executable' do
46
44
  end
47
45
  exit_code, stdout, stderr = run 'last_deploys'
48
46
  expect(exit_code).to eq 0
49
- expect(stdout).to eq(<<~EOS)
47
+ expect(stdout).to eq <<~EO_STDOUT
50
48
  +-------+-------------------------+-------------+--------------------+-------+
51
49
  | Node | Date | Admin | Services | Error |
52
50
  +-------+-------------------------+-------------+--------------------+-------+
53
51
  | node1 | 2019-08-21 10:12:15 UTC | admin_user1 | service1 | |
54
52
  | node2 | 2019-08-22 10:12:15 UTC | admin_user2 | service1, service2 | |
55
53
  +-------+-------------------------+-------------+--------------------+-------+
56
- EOS
54
+ EO_STDOUT
57
55
  expect(stderr).to eq ''
58
56
  end
59
57
  end
@@ -92,14 +90,14 @@ describe 'last_deploys executable' do
92
90
  end
93
91
  exit_code, stdout, stderr = run 'last_deploys', '--sort-by', 'user'
94
92
  expect(exit_code).to eq 0
95
- expect(stdout).to eq(<<~EOS)
93
+ expect(stdout).to eq <<~EO_STDOUT
96
94
  +-------+-------------------------+-------------+--------------------+-------+
97
95
  | Node | Date | Admin | Services | Error |
98
96
  +-------+-------------------------+-------------+--------------------+-------+
99
97
  | node2 | 2019-08-22 10:12:15 UTC | admin_user1 | service1, service2 | |
100
98
  | node1 | 2019-08-21 10:12:15 UTC | admin_user2 | service1 | |
101
99
  +-------+-------------------------+-------------+--------------------+-------+
102
- EOS
100
+ EO_STDOUT
103
101
  expect(stderr).to eq ''
104
102
  end
105
103
  end
@@ -138,14 +136,14 @@ describe 'last_deploys executable' do
138
136
  end
139
137
  exit_code, stdout, stderr = run 'last_deploys', '--sort-by', 'user_desc'
140
138
  expect(exit_code).to eq 0
141
- expect(stdout).to eq(<<~EOS)
139
+ expect(stdout).to eq <<~EO_STDOUT
142
140
  +-------+-------------------------+-------------+--------------------+-------+
143
141
  | Node | Date | Admin | Services | Error |
144
142
  +-------+-------------------------+-------------+--------------------+-------+
145
143
  | node1 | 2019-08-21 10:12:15 UTC | admin_user2 | service1 | |
146
144
  | node2 | 2019-08-22 10:12:15 UTC | admin_user1 | service1, service2 | |
147
145
  +-------+-------------------------+-------------+--------------------+-------+
148
- EOS
146
+ EO_STDOUT
149
147
  expect(stderr).to eq ''
150
148
  end
151
149
  end
@@ -171,13 +169,13 @@ describe 'last_deploys executable' do
171
169
  end
172
170
  exit_code, stdout, stderr = run 'last_deploys', '--node', 'node1'
173
171
  expect(exit_code).to eq 0
174
- expect(stdout).to eq(<<~EOS)
172
+ expect(stdout).to eq <<~EO_STDOUT
175
173
  +-------+-------------------------+-------------+----------+-------+
176
174
  | Node | Date | Admin | Services | Error |
177
175
  +-------+-------------------------+-------------+----------+-------+
178
176
  | node1 | 2019-08-21 10:12:15 UTC | admin_user1 | service1 | |
179
177
  +-------+-------------------------+-------------+----------+-------+
180
- EOS
178
+ EO_STDOUT
181
179
  expect(stderr).to eq ''
182
180
  end
183
181
  end
@@ -206,14 +204,14 @@ describe 'last_deploys executable' do
206
204
  end
207
205
  exit_code, stdout, stderr = run 'last_deploys', '--sort-by', 'user_desc'
208
206
  expect(exit_code).to eq 0
209
- expect(stdout).to eq(<<~EOS)
207
+ expect(stdout).to eq <<~EO_STDOUT
210
208
  +-------+-------------------------+-------------+--------------------+--------------------------+
211
209
  | Node | Date | Admin | Services | Error |
212
210
  +-------+-------------------------+-------------+--------------------+--------------------------+
213
211
  | node2 | 2019-08-22 10:12:15 UTC | admin_user2 | service1, service2 | |
214
212
  | node1 | | | | Error while getting logs |
215
213
  +-------+-------------------------+-------------+--------------------+--------------------------+
216
- EOS
214
+ EO_STDOUT
217
215
  expect(stderr).to eq ''
218
216
  end
219
217
  end
@@ -4,213 +4,201 @@ describe 'nodes_to_deploy executable' do
4
4
  #
5
5
  # Parameters::
6
6
  # * *additional_platforms_content* (String): Additional platforms content to be added [default = '']
7
- # * Proc: Code called when the platform is setup
7
+ # * *block* (Proc): Code called when the platform is setup
8
8
  # * Parameters::
9
9
  # * *repository* (String): Platform's repository
10
- def with_test_platform_for_nodes_to_deploy(additional_platforms_content: '')
10
+ def with_test_platform_for_nodes_to_deploy(additional_platforms_content: '', &block)
11
11
  with_test_platform(
12
12
  { nodes: { 'node1' => {}, 'node2' => {} } },
13
- false,
14
- additional_platforms_content + "\nsend_logs_to :test_log"
15
- ) do |repository|
16
- yield repository
17
- end
13
+ additional_config: "#{additional_platforms_content}\nsend_logs_to :test_log",
14
+ &block
15
+ )
18
16
  end
19
17
 
20
18
  it 'returns all nodes by default' do
21
19
  with_test_platform_for_nodes_to_deploy do
22
- expect(test_deployer).to receive(:deployment_info_from).with(%w[node1 node2]) do
23
- {
24
- 'node1' => {
25
- services: %w[service1],
26
- deployment_info: {
27
- repo_name_0: 'platform',
28
- commit_id_0: 'abcdef1',
29
- exit_status: 0
30
- },
31
- exit_status: 0,
32
- stdout: '',
33
- stderr: ''
20
+ expect(test_deployer).to receive(:deployment_info_from).with(%w[node1 node2]).and_return(
21
+ 'node1' => {
22
+ services: %w[service1],
23
+ deployment_info: {
24
+ repo_name_0: 'platform',
25
+ commit_id_0: 'abcdef1',
26
+ exit_status: 0
27
+ },
28
+ exit_status: 0,
29
+ stdout: '',
30
+ stderr: ''
31
+ },
32
+ 'node2' => {
33
+ services: %w[service2],
34
+ deployment_info: {
35
+ repo_name_0: 'platform',
36
+ commit_id_0: 'abcdef2',
37
+ exit_status: 0
34
38
  },
35
- 'node2' => {
36
- services: %w[service2],
37
- deployment_info: {
38
- repo_name_0: 'platform',
39
- commit_id_0: 'abcdef2',
40
- exit_status: 0
41
- },
42
- exit_status: 0,
43
- stdout: '',
44
- stderr: ''
45
- }
39
+ exit_status: 0,
40
+ stdout: '',
41
+ stderr: ''
46
42
  }
47
- end
48
- expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform', from_commit: 'abcdef1', to_commit: 'master') { [%w[node1 node2], [], [], false] }
49
- expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform', from_commit: 'abcdef2', to_commit: 'master') { [%w[node1 node2], [], [], false] }
43
+ )
44
+ expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform', from_commit: 'abcdef1', to_commit: 'master').and_return [%w[node1 node2], [], [], false]
45
+ expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform', from_commit: 'abcdef2', to_commit: 'master').and_return [%w[node1 node2], [], [], false]
50
46
  exit_code, stdout, stderr = run 'nodes_to_deploy'
51
47
  expect(exit_code).to eq 0
52
- expect(stdout).to eq <<~EOS
48
+ expect(stdout).to eq <<~EO_STDOUT
53
49
  ===== Nodes to deploy =====
54
50
  node1
55
51
  node2
56
- EOS
57
- expect(stderr).to match /\[ node1 \] - No deployment schedule defined./
58
- expect(stderr).to match /\[ node2 \] - No deployment schedule defined./
52
+ EO_STDOUT
53
+ expect(stderr).to match(/\[ node1 \] - No deployment schedule defined./)
54
+ expect(stderr).to match(/\[ node2 \] - No deployment schedule defined./)
59
55
  end
60
56
  end
61
57
 
62
58
  it 'can filter nodes' do
63
59
  with_test_platform_for_nodes_to_deploy do
64
- expect(test_deployer).to receive(:deployment_info_from).with(%w[node2]) do
65
- {
66
- 'node2' => {
67
- services: %w[service2],
68
- deployment_info: {
69
- repo_name_0: 'platform',
70
- commit_id_0: 'abcdef2',
71
- exit_status: 0
72
- },
73
- exit_status: 0,
74
- stdout: '',
75
- stderr: ''
76
- }
60
+ expect(test_deployer).to receive(:deployment_info_from).with(%w[node2]).and_return(
61
+ 'node2' => {
62
+ services: %w[service2],
63
+ deployment_info: {
64
+ repo_name_0: 'platform',
65
+ commit_id_0: 'abcdef2',
66
+ exit_status: 0
67
+ },
68
+ exit_status: 0,
69
+ stdout: '',
70
+ stderr: ''
77
71
  }
78
- end
79
- expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform', from_commit: 'abcdef2', to_commit: 'master') { [%w[node1 node2], [], [], false] }
72
+ )
73
+ expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform', from_commit: 'abcdef2', to_commit: 'master').and_return [%w[node1 node2], [], [], false]
80
74
  exit_code, stdout, stderr = run 'nodes_to_deploy', '--node', 'node2'
81
75
  expect(exit_code).to eq 0
82
- expect(stdout).to eq <<~EOS
76
+ expect(stdout).to eq <<~EO_STDOUT
83
77
  ===== Nodes to deploy =====
84
78
  node2
85
- EOS
86
- expect(stderr).not_to match /\[ node1 \] - No deployment schedule defined./
87
- expect(stderr).to match /\[ node2 \] - No deployment schedule defined./
79
+ EO_STDOUT
80
+ expect(stderr).not_to match(/\[ node1 \] - No deployment schedule defined./)
81
+ expect(stderr).to match(/\[ node2 \] - No deployment schedule defined./)
88
82
  end
89
83
  end
90
84
 
91
85
  it 'does not return nodes that have no impact' do
92
86
  with_test_platform_for_nodes_to_deploy do
93
- expect(test_deployer).to receive(:deployment_info_from).with(%w[node1 node2]) do
94
- {
95
- 'node1' => {
96
- services: %w[service1],
97
- deployment_info: {
98
- repo_name_0: 'platform',
99
- commit_id_0: 'abcdef1',
100
- exit_status: 0
101
- },
102
- exit_status: 0,
103
- stdout: '',
104
- stderr: ''
87
+ expect(test_deployer).to receive(:deployment_info_from).with(%w[node1 node2]).and_return(
88
+ 'node1' => {
89
+ services: %w[service1],
90
+ deployment_info: {
91
+ repo_name_0: 'platform',
92
+ commit_id_0: 'abcdef1',
93
+ exit_status: 0
94
+ },
95
+ exit_status: 0,
96
+ stdout: '',
97
+ stderr: ''
98
+ },
99
+ 'node2' => {
100
+ services: %w[service2],
101
+ deployment_info: {
102
+ repo_name_0: 'platform',
103
+ commit_id_0: 'abcdef2',
104
+ exit_status: 0
105
105
  },
106
- 'node2' => {
107
- services: %w[service2],
108
- deployment_info: {
109
- repo_name_0: 'platform',
110
- commit_id_0: 'abcdef2',
111
- exit_status: 0
112
- },
113
- exit_status: 0,
114
- stdout: '',
115
- stderr: ''
116
- }
106
+ exit_status: 0,
107
+ stdout: '',
108
+ stderr: ''
117
109
  }
118
- end
119
- expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform', from_commit: 'abcdef1', to_commit: 'master') { [%w[node1], [], [], false] }
120
- expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform', from_commit: 'abcdef2', to_commit: 'master') { [%w[], [], [], false] }
121
- exit_code, stdout, stderr = run 'nodes_to_deploy'
110
+ )
111
+ expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform', from_commit: 'abcdef1', to_commit: 'master').and_return [%w[node1], [], [], false]
112
+ expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform', from_commit: 'abcdef2', to_commit: 'master').and_return [%w[], [], [], false]
113
+ exit_code, stdout = run 'nodes_to_deploy'
122
114
  expect(exit_code).to eq 0
123
- expect(stdout).to eq <<~EOS
115
+ expect(stdout).to eq <<~EO_STDOUT
124
116
  ===== Nodes to deploy =====
125
117
  node1
126
- EOS
118
+ EO_STDOUT
127
119
  end
128
120
  end
129
121
 
130
122
  it 'considers nodes having no repository info in their logs to be deployed' do
131
123
  with_test_platform_for_nodes_to_deploy do
132
- expect(test_deployer).to receive(:deployment_info_from).with(%w[node1 node2]) do
133
- {
134
- 'node1' => {
135
- services: %w[service1],
136
- deployment_info: {},
137
- exit_status: 0,
138
- stdout: '',
139
- stderr: ''
124
+ expect(test_deployer).to receive(:deployment_info_from).with(%w[node1 node2]).and_return(
125
+ 'node1' => {
126
+ services: %w[service1],
127
+ deployment_info: {},
128
+ exit_status: 0,
129
+ stdout: '',
130
+ stderr: ''
131
+ },
132
+ 'node2' => {
133
+ services: %w[service2],
134
+ deployment_info: {
135
+ repo_name_0: 'platform',
136
+ commit_id_0: 'abcdef2',
137
+ exit_status: 0
140
138
  },
141
- 'node2' => {
142
- services: %w[service2],
143
- deployment_info: {
144
- repo_name_0: 'platform',
145
- commit_id_0: 'abcdef2',
146
- exit_status: 0
147
- },
148
- exit_status: 0,
149
- stdout: '',
150
- stderr: ''
151
- }
139
+ exit_status: 0,
140
+ stdout: '',
141
+ stderr: ''
152
142
  }
153
- end
154
- expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform', from_commit: 'abcdef2', to_commit: 'master') { [%w[], [], [], false] }
155
- exit_code, stdout, stderr = run 'nodes_to_deploy'
143
+ )
144
+ expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform', from_commit: 'abcdef2', to_commit: 'master').and_return [%w[], [], [], false]
145
+ exit_code, stdout = run 'nodes_to_deploy'
156
146
  expect(exit_code).to eq 0
157
- expect(stdout).to eq <<~EOS
147
+ expect(stdout).to eq <<~EO_STDOUT
158
148
  ===== Nodes to deploy =====
159
149
  node1
160
- EOS
150
+ EO_STDOUT
161
151
  end
162
152
  end
163
153
 
164
154
  it 'considers nodes having invalid commit ids in their logs to be deployed' do
165
155
  with_test_platform_for_nodes_to_deploy do
166
- expect(test_deployer).to receive(:deployment_info_from).with(%w[node1 node2]) do
167
- {
168
- 'node1' => {
169
- services: %w[service1],
170
- deployment_info: {
171
- repo_name_0: 'platform',
172
- commit_id_0: 'abcdef1',
173
- exit_status: 0
174
- },
175
- exit_status: 0,
176
- stdout: '',
177
- stderr: ''
156
+ expect(test_deployer).to receive(:deployment_info_from).with(%w[node1 node2]).and_return(
157
+ 'node1' => {
158
+ services: %w[service1],
159
+ deployment_info: {
160
+ repo_name_0: 'platform',
161
+ commit_id_0: 'abcdef1',
162
+ exit_status: 0
163
+ },
164
+ exit_status: 0,
165
+ stdout: '',
166
+ stderr: ''
167
+ },
168
+ 'node2' => {
169
+ services: %w[service2],
170
+ deployment_info: {
171
+ repo_name_0: 'platform',
172
+ commit_id_0: 'abcdef2',
173
+ exit_status: 0
178
174
  },
179
- 'node2' => {
180
- services: %w[service2],
181
- deployment_info: {
182
- repo_name_0: 'platform',
183
- commit_id_0: 'abcdef2',
184
- exit_status: 0
185
- },
186
- exit_status: 0,
187
- stdout: '',
188
- stderr: ''
189
- }
175
+ exit_status: 0,
176
+ stdout: '',
177
+ stderr: ''
190
178
  }
191
- end
179
+ )
192
180
  expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform', from_commit: 'abcdef1', to_commit: 'master') do
193
181
  raise HybridPlatformsConductor::NodesHandler::GitError, 'Mocked git error due to an invalid commit id'
194
182
  end
195
- expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform', from_commit: 'abcdef2', to_commit: 'master') { [%w[], [], [], false] }
196
- exit_code, stdout, stderr = run 'nodes_to_deploy'
183
+ expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform', from_commit: 'abcdef2', to_commit: 'master').and_return [%w[], [], [], false]
184
+ exit_code, stdout = run 'nodes_to_deploy'
197
185
  expect(exit_code).to eq 0
198
- expect(stdout).to eq <<~EOS
186
+ expect(stdout).to eq <<~EO_STDOUT
199
187
  ===== Nodes to deploy =====
200
188
  node1
201
- EOS
189
+ EO_STDOUT
202
190
  end
203
191
  end
204
192
 
205
193
  it 'ignores impacts if asked' do
206
194
  with_test_platform_for_nodes_to_deploy do
207
- exit_code, stdout, stderr = run 'nodes_to_deploy', '--ignore-deployed-info'
195
+ exit_code, stdout = run 'nodes_to_deploy', '--ignore-deployed-info'
208
196
  expect(exit_code).to eq 0
209
- expect(stdout).to eq <<~EOS
197
+ expect(stdout).to eq <<~EO_STDOUT
210
198
  ===== Nodes to deploy =====
211
199
  node1
212
200
  node2
213
- EOS
201
+ EO_STDOUT
214
202
  end
215
203
  end
216
204
 
@@ -219,28 +207,26 @@ describe 'nodes_to_deploy executable' do
219
207
  for_nodes(\'node1\') { deployment_schedule(IceCube::Schedule.new(Time.now.utc - 120, duration: 60)) }
220
208
  for_nodes(\'node2\') { deployment_schedule(IceCube::Schedule.new(Time.now.utc - 60, duration: 120)) }
221
209
  ') do
222
- expect(test_deployer).to receive(:deployment_info_from).with(%w[node2]) do
223
- {
224
- 'node2' => {
225
- services: %w[service2],
226
- deployment_info: {
227
- repo_name_0: 'platform',
228
- commit_id_0: 'abcdef2',
229
- exit_status: 0
230
- },
231
- exit_status: 0,
232
- stdout: '',
233
- stderr: ''
234
- }
210
+ expect(test_deployer).to receive(:deployment_info_from).with(%w[node2]).and_return(
211
+ 'node2' => {
212
+ services: %w[service2],
213
+ deployment_info: {
214
+ repo_name_0: 'platform',
215
+ commit_id_0: 'abcdef2',
216
+ exit_status: 0
217
+ },
218
+ exit_status: 0,
219
+ stdout: '',
220
+ stderr: ''
235
221
  }
236
- end
237
- expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform', from_commit: 'abcdef2', to_commit: 'master') { [%w[node1 node2], [], [], false] }
222
+ )
223
+ expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform', from_commit: 'abcdef2', to_commit: 'master').and_return [%w[node1 node2], [], [], false]
238
224
  exit_code, stdout, stderr = run 'nodes_to_deploy'
239
225
  expect(exit_code).to eq 0
240
- expect(stdout).to eq <<~EOS
226
+ expect(stdout).to eq <<~EO_STDOUT
241
227
  ===== Nodes to deploy =====
242
228
  node2
243
- EOS
229
+ EO_STDOUT
244
230
  expect(stderr).to eq ''
245
231
  end
246
232
  end
@@ -250,29 +236,27 @@ describe 'nodes_to_deploy executable' do
250
236
  for_nodes(\'node1\') { deployment_schedule(IceCube::Schedule.new(Time.now.utc - 120, duration: 60)) }
251
237
  for_nodes(\'node2\') { deployment_schedule(IceCube::Schedule.new(Time.now.utc - 60, duration: 120)) }
252
238
  ') do
253
- expect(test_deployer).to receive(:deployment_info_from).with(%w[node1]) do
254
- {
255
- 'node1' => {
256
- services: %w[service1],
257
- deployment_info: {
258
- repo_name_0: 'platform',
259
- commit_id_0: 'abcdef1',
260
- exit_status: 0
261
- },
262
- exit_status: 0,
263
- stdout: '',
264
- stderr: ''
265
- }
239
+ expect(test_deployer).to receive(:deployment_info_from).with(%w[node1]).and_return(
240
+ 'node1' => {
241
+ services: %w[service1],
242
+ deployment_info: {
243
+ repo_name_0: 'platform',
244
+ commit_id_0: 'abcdef1',
245
+ exit_status: 0
246
+ },
247
+ exit_status: 0,
248
+ stdout: '',
249
+ stderr: ''
266
250
  }
267
- end
268
- expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform', from_commit: 'abcdef1', to_commit: 'master') { [%w[node1 node2], [], [], false] }
251
+ )
252
+ expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform', from_commit: 'abcdef1', to_commit: 'master').and_return [%w[node1 node2], [], [], false]
269
253
  # 90 seconds before now, the schedule should match only node1
270
254
  exit_code, stdout, stderr = run 'nodes_to_deploy', '--deployment-time', (Time.now.utc - 90).strftime('%F %T')
271
255
  expect(exit_code).to eq 0
272
- expect(stdout).to eq <<~EOS
256
+ expect(stdout).to eq <<~EO_STDOUT
273
257
  ===== Nodes to deploy =====
274
258
  node1
275
- EOS
259
+ EO_STDOUT
276
260
  expect(stderr).to eq ''
277
261
  end
278
262
  end
@@ -282,183 +266,181 @@ describe 'nodes_to_deploy executable' do
282
266
  for_nodes(\'node1\') { deployment_schedule(IceCube::Schedule.new(Time.now.utc - 120, duration: 60)) }
283
267
  for_nodes(\'node2\') { deployment_schedule(IceCube::Schedule.new(Time.now.utc - 60, duration: 120)) }
284
268
  ') do
285
- expect(test_deployer).to receive(:deployment_info_from).with(%w[node1 node2]) do
286
- {
287
- 'node1' => {
288
- services: %w[service1],
289
- deployment_info: {
290
- repo_name_0: 'platform',
291
- commit_id_0: 'abcdef1',
292
- exit_status: 0
293
- },
294
- exit_status: 0,
295
- stdout: '',
296
- stderr: ''
269
+ expect(test_deployer).to receive(:deployment_info_from).with(%w[node1 node2]).and_return(
270
+ 'node1' => {
271
+ services: %w[service1],
272
+ deployment_info: {
273
+ repo_name_0: 'platform',
274
+ commit_id_0: 'abcdef1',
275
+ exit_status: 0
276
+ },
277
+ exit_status: 0,
278
+ stdout: '',
279
+ stderr: ''
280
+ },
281
+ 'node2' => {
282
+ services: %w[service2],
283
+ deployment_info: {
284
+ repo_name_0: 'platform',
285
+ commit_id_0: 'abcdef2',
286
+ exit_status: 0
297
287
  },
298
- 'node2' => {
299
- services: %w[service2],
300
- deployment_info: {
301
- repo_name_0: 'platform',
302
- commit_id_0: 'abcdef2',
303
- exit_status: 0
304
- },
305
- exit_status: 0,
306
- stdout: '',
307
- stderr: ''
308
- }
288
+ exit_status: 0,
289
+ stdout: '',
290
+ stderr: ''
309
291
  }
310
- end
311
- expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform', from_commit: 'abcdef1', to_commit: 'master') { [%w[node1 node2], [], [], false] }
312
- expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform', from_commit: 'abcdef2', to_commit: 'master') { [%w[node1 node2], [], [], false] }
292
+ )
293
+ expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform', from_commit: 'abcdef1', to_commit: 'master').and_return [%w[node1 node2], [], [], false]
294
+ expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform', from_commit: 'abcdef2', to_commit: 'master').and_return [%w[node1 node2], [], [], false]
313
295
  exit_code, stdout, stderr = run 'nodes_to_deploy', '--ignore-schedule'
314
296
  expect(exit_code).to eq 0
315
- expect(stdout).to eq <<~EOS
297
+ expect(stdout).to eq <<~EO_STDOUT
316
298
  ===== Nodes to deploy =====
317
299
  node1
318
300
  node2
319
- EOS
301
+ EO_STDOUT
320
302
  expect(stderr).to eq ''
321
303
  end
322
304
  end
323
305
 
324
306
  it 'considers impacts from several repositories' do
325
307
  with_test_platforms(
326
- 'platform1' => { nodes: { 'node1' => {}, 'node2' => {} } },
327
- 'platform2' => { nodes: {} }
308
+ {
309
+ 'platform1' => { nodes: { 'node1' => {}, 'node2' => {} } },
310
+ 'platform2' => { nodes: {} }
311
+ }
328
312
  ) do
329
- expect(test_deployer).to receive(:deployment_info_from).with(%w[node1 node2]) do
330
- {
331
- 'node1' => {
332
- services: %w[service1],
333
- deployment_info: {
334
- repo_name_0: 'platform1',
335
- commit_id_0: 'abcdef1',
336
- exit_status: 0
337
- },
338
- exit_status: 0,
339
- stdout: '',
340
- stderr: ''
313
+ expect(test_deployer).to receive(:deployment_info_from).with(%w[node1 node2]).and_return(
314
+ 'node1' => {
315
+ services: %w[service1],
316
+ deployment_info: {
317
+ repo_name_0: 'platform1',
318
+ commit_id_0: 'abcdef1',
319
+ exit_status: 0
320
+ },
321
+ exit_status: 0,
322
+ stdout: '',
323
+ stderr: ''
324
+ },
325
+ 'node2' => {
326
+ services: %w[service2],
327
+ deployment_info: {
328
+ repo_name_0: 'platform2',
329
+ commit_id_0: 'abcdef2',
330
+ exit_status: 0
341
331
  },
342
- 'node2' => {
343
- services: %w[service2],
344
- deployment_info: {
345
- repo_name_0: 'platform2',
346
- commit_id_0: 'abcdef2',
347
- exit_status: 0
348
- },
349
- exit_status: 0,
350
- stdout: '',
351
- stderr: ''
352
- }
332
+ exit_status: 0,
333
+ stdout: '',
334
+ stderr: ''
353
335
  }
354
- end
355
- expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform1', from_commit: 'abcdef1', to_commit: 'master') { [%w[node1], [], [], false] }
356
- expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform2', from_commit: 'abcdef2', to_commit: 'master') { [%w[node2], [], [], false] }
357
- exit_code, stdout, stderr = run 'nodes_to_deploy'
336
+ )
337
+ expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform1', from_commit: 'abcdef1', to_commit: 'master').and_return [%w[node1], [], [], false]
338
+ expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform2', from_commit: 'abcdef2', to_commit: 'master').and_return [%w[node2], [], [], false]
339
+ exit_code, stdout = run 'nodes_to_deploy'
358
340
  expect(exit_code).to eq 0
359
- expect(stdout).to eq <<~EOS
341
+ expect(stdout).to eq <<~EO_STDOUT
360
342
  ===== Nodes to deploy =====
361
343
  node1
362
344
  node2
363
- EOS
345
+ EO_STDOUT
364
346
  end
365
347
  end
366
348
 
367
349
  it 'considers impacts from several repositories for the same node as different services for different platforms might be deployed' do
368
350
  with_test_platforms(
369
- 'platform1' => { nodes: { 'node1' => {}, 'node2' => {} } },
370
- 'platform2' => { nodes: {} },
371
- 'platform3' => { nodes: {} }
351
+ {
352
+ 'platform1' => { nodes: { 'node1' => {}, 'node2' => {} } },
353
+ 'platform2' => { nodes: {} },
354
+ 'platform3' => { nodes: {} }
355
+ }
372
356
  ) do
373
- expect(test_deployer).to receive(:deployment_info_from).with(%w[node1 node2]) do
374
- {
375
- 'node1' => {
376
- services: %w[service1],
377
- deployment_info: {
378
- repo_name_0: 'platform1',
379
- commit_id_0: 'abcdef1',
380
- repo_name_1: 'platform2',
381
- commit_id_1: '1234567',
382
- exit_status: 0
383
- },
384
- exit_status: 0,
385
- stdout: '',
386
- stderr: ''
357
+ expect(test_deployer).to receive(:deployment_info_from).with(%w[node1 node2]).and_return(
358
+ 'node1' => {
359
+ services: %w[service1],
360
+ deployment_info: {
361
+ repo_name_0: 'platform1',
362
+ commit_id_0: 'abcdef1',
363
+ repo_name_1: 'platform2',
364
+ commit_id_1: '1234567',
365
+ exit_status: 0
366
+ },
367
+ exit_status: 0,
368
+ stdout: '',
369
+ stderr: ''
370
+ },
371
+ 'node2' => {
372
+ services: %w[service2],
373
+ deployment_info: {
374
+ repo_name_0: 'platform2',
375
+ commit_id_0: 'abcdef2',
376
+ repo_name_1: 'platform3',
377
+ commit_id_1: '2345678',
378
+ exit_status: 0
387
379
  },
388
- 'node2' => {
389
- services: %w[service2],
390
- deployment_info: {
391
- repo_name_0: 'platform2',
392
- commit_id_0: 'abcdef2',
393
- repo_name_1: 'platform3',
394
- commit_id_1: '2345678',
395
- exit_status: 0
396
- },
397
- exit_status: 0,
398
- stdout: '',
399
- stderr: ''
400
- }
380
+ exit_status: 0,
381
+ stdout: '',
382
+ stderr: ''
401
383
  }
402
- end
403
- expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform1', from_commit: 'abcdef1', to_commit: 'master') { [%w[], [], [], false] }
404
- expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform2', from_commit: '1234567', to_commit: 'master') { [%w[node1], [], [], false] }
405
- expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform2', from_commit: 'abcdef2', to_commit: 'master') { [%w[], [], [], false] }
406
- expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform3', from_commit: '2345678', to_commit: 'master') { [%w[node2], [], [], false] }
407
- exit_code, stdout, stderr = run 'nodes_to_deploy'
384
+ )
385
+ expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform1', from_commit: 'abcdef1', to_commit: 'master').and_return [%w[], [], [], false]
386
+ expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform2', from_commit: '1234567', to_commit: 'master').and_return [%w[node1], [], [], false]
387
+ expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform2', from_commit: 'abcdef2', to_commit: 'master').and_return [%w[], [], [], false]
388
+ expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform3', from_commit: '2345678', to_commit: 'master').and_return [%w[node2], [], [], false]
389
+ exit_code, stdout = run 'nodes_to_deploy'
408
390
  expect(exit_code).to eq 0
409
- expect(stdout).to eq <<~EOS
391
+ expect(stdout).to eq <<~EO_STDOUT
410
392
  ===== Nodes to deploy =====
411
393
  node1
412
394
  node2
413
- EOS
395
+ EO_STDOUT
414
396
  end
415
397
  end
416
398
 
417
399
  it 'considers impacts from several repositories for the same node but does not query diffs for the nodes we already know need deployment' do
418
400
  with_test_platforms(
419
- 'platform1' => { nodes: { 'node1' => {}, 'node2' => {} } },
420
- 'platform2' => { nodes: {} },
421
- 'platform3' => { nodes: {} }
401
+ {
402
+ 'platform1' => { nodes: { 'node1' => {}, 'node2' => {} } },
403
+ 'platform2' => { nodes: {} },
404
+ 'platform3' => { nodes: {} }
405
+ }
422
406
  ) do
423
- expect(test_deployer).to receive(:deployment_info_from).with(%w[node1 node2]) do
424
- {
425
- 'node1' => {
426
- services: %w[service1],
427
- deployment_info: {
428
- repo_name_0: 'platform1',
429
- commit_id_0: 'abcdef1',
430
- repo_name_1: 'platform2',
431
- commit_id_1: '1234567',
432
- exit_status: 0
433
- },
434
- exit_status: 0,
435
- stdout: '',
436
- stderr: ''
407
+ expect(test_deployer).to receive(:deployment_info_from).with(%w[node1 node2]).and_return(
408
+ 'node1' => {
409
+ services: %w[service1],
410
+ deployment_info: {
411
+ repo_name_0: 'platform1',
412
+ commit_id_0: 'abcdef1',
413
+ repo_name_1: 'platform2',
414
+ commit_id_1: '1234567',
415
+ exit_status: 0
437
416
  },
438
- 'node2' => {
439
- services: %w[service2],
440
- deployment_info: {
441
- repo_name_0: 'platform2',
442
- commit_id_0: 'abcdef2',
443
- repo_name_1: 'platform3',
444
- commit_id_1: '2345678',
445
- exit_status: 0
446
- },
447
- exit_status: 0,
448
- stdout: '',
449
- stderr: ''
450
- }
417
+ exit_status: 0,
418
+ stdout: '',
419
+ stderr: ''
420
+ },
421
+ 'node2' => {
422
+ services: %w[service2],
423
+ deployment_info: {
424
+ repo_name_0: 'platform2',
425
+ commit_id_0: 'abcdef2',
426
+ repo_name_1: 'platform3',
427
+ commit_id_1: '2345678',
428
+ exit_status: 0
429
+ },
430
+ exit_status: 0,
431
+ stdout: '',
432
+ stderr: ''
451
433
  }
452
- end
453
- expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform1', from_commit: 'abcdef1', to_commit: 'master') { [%w[node1], [], [], false] }
454
- expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform2', from_commit: 'abcdef2', to_commit: 'master') { [%w[node2], [], [], false] }
455
- exit_code, stdout, stderr = run 'nodes_to_deploy'
434
+ )
435
+ expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform1', from_commit: 'abcdef1', to_commit: 'master').and_return [%w[node1], [], [], false]
436
+ expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform2', from_commit: 'abcdef2', to_commit: 'master').and_return [%w[node2], [], [], false]
437
+ exit_code, stdout = run 'nodes_to_deploy'
456
438
  expect(exit_code).to eq 0
457
- expect(stdout).to eq <<~EOS
439
+ expect(stdout).to eq <<~EO_STDOUT
458
440
  ===== Nodes to deploy =====
459
441
  node1
460
442
  node2
461
- EOS
443
+ EO_STDOUT
462
444
  end
463
445
  end
464
446