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
@@ -1,6 +1,6 @@
1
1
  describe HybridPlatformsConductor::NodesHandler do
2
2
 
3
- context 'checking config DSL' do
3
+ context 'when checking config DSL' do
4
4
 
5
5
  it 'adds helpers for master cmdbs' do
6
6
  with_test_platform(
@@ -11,30 +11,29 @@ describe HybridPlatformsConductor::NodesHandler do
11
11
  'node3' => {}
12
12
  }
13
13
  },
14
- false,
15
- '
14
+ additional_config: <<~'EO_CONFIG'
16
15
  master_cmdbs(
17
- test_cmdb: :property1,
18
- test_cmdb2: :property2
16
+ test_cmdb: :property_1,
17
+ test_cmdb_2: :property_2
19
18
  )
20
- for_nodes(\'node2\') do
21
- master_cmdbs(test_cmdb: :property3)
19
+ for_nodes('node2') do
20
+ master_cmdbs(test_cmdb: :property_3)
22
21
  end
23
- '
22
+ EO_CONFIG
24
23
  ) do
25
- register_test_cmdb(%i[test_cmdb test_cmdb2])
24
+ register_test_cmdb(%i[test_cmdb test_cmdb_2])
26
25
  expect(test_config.cmdb_masters).to eq [
27
26
  {
28
27
  nodes_selectors_stack: [],
29
28
  cmdb_masters: {
30
- test_cmdb: [:property1],
31
- test_cmdb2: [:property2]
29
+ test_cmdb: [:property_1],
30
+ test_cmdb_2: [:property_2]
32
31
  }
33
32
  },
34
33
  {
35
34
  nodes_selectors_stack: ['node2'],
36
35
  cmdb_masters: {
37
- test_cmdb: [:property3]
36
+ test_cmdb: [:property_3]
38
37
  }
39
38
  }
40
39
  ]
@@ -50,13 +49,12 @@ describe HybridPlatformsConductor::NodesHandler do
50
49
  'node3' => {}
51
50
  }
52
51
  },
53
- false,
54
- '
52
+ additional_config: <<~'EO_CONFIG'
55
53
  sudo_for { |user| "alt_sudo1 -p #{user}" }
56
- for_nodes(\'node2\') do
54
+ for_nodes('node2') do
57
55
  sudo_for { |user| "alt_sudo2 -q #{user}" }
58
56
  end
59
- '
57
+ EO_CONFIG
60
58
  ) do
61
59
  expect(test_config.sudo_procs.size).to eq 2
62
60
  expect(test_config.sudo_procs[0][:nodes_selectors_stack]).to eq []
@@ -1,6 +1,6 @@
1
1
  describe HybridPlatformsConductor::NodesHandler do
2
2
 
3
- context 'checking computation of impacted nodes by a git diff' do
3
+ context 'when checking computation of impacted nodes by a git diff' do
4
4
 
5
5
  it 'returns all the impacted platform nodes by default' do
6
6
  with_test_platforms(
@@ -8,11 +8,11 @@ describe HybridPlatformsConductor::NodesHandler do
8
8
  'platform_1' => { nodes: { 'node11' => {}, 'node12' => {} } },
9
9
  'platform_2' => { nodes: { 'node21' => {}, 'node22' => {} } }
10
10
  },
11
- true
11
+ as_git: true
12
12
  ) do
13
- with_cmd_runner_mocked([
14
- [/cd .+\/platform_2 && git --no-pager diff --no-color master/, proc { [0, '', ''] }]
15
- ]) do
13
+ with_cmd_runner_mocked [
14
+ [%r{cd .+/platform_2 && git --no-pager diff --no-color master}, proc { [0, '', ''] }]
15
+ ] do
16
16
  expect(test_nodes_handler.impacted_nodes_from_git_diff('platform_2')).to eq [
17
17
  %w[node21 node22].sort,
18
18
  [],
@@ -24,42 +24,42 @@ describe HybridPlatformsConductor::NodesHandler do
24
24
  end
25
25
 
26
26
  it 'diffs from another commit if asked' do
27
- with_test_platform({}, true) do
28
- with_cmd_runner_mocked([
29
- [/cd .+\/my_remote_platform && git --no-pager diff --no-color from_branch/, proc { [0, '', ''] }]
30
- ]) do
27
+ with_test_platform({}, as_git: true) do
28
+ with_cmd_runner_mocked [
29
+ [%r{cd .+/my_remote_platform && git --no-pager diff --no-color from_branch}, proc { [0, '', ''] }]
30
+ ] do
31
31
  expect(test_nodes_handler.impacted_nodes_from_git_diff('my_remote_platform', from_commit: 'from_branch')).to eq [[], [], [], true]
32
32
  end
33
33
  end
34
34
  end
35
35
 
36
36
  it 'fails when the commit id is invalid' do
37
- with_test_platform({}, true) do
38
- with_cmd_runner_mocked([
39
- [/cd .+\/my_remote_platform && git --no-pager diff --no-color invalid_id/, proc { raise HybridPlatformsConductor::CmdRunner::UnexpectedExitCodeError, 'Mocked git error due to an invalid commit id' }]
40
- ]) do
37
+ with_test_platform({}, as_git: true) do
38
+ with_cmd_runner_mocked [
39
+ [%r{cd .+/my_remote_platform && git --no-pager diff --no-color invalid_id}, proc { raise HybridPlatformsConductor::CmdRunner::UnexpectedExitCodeError, 'Mocked git error due to an invalid commit id' }]
40
+ ] do
41
41
  expect { test_nodes_handler.impacted_nodes_from_git_diff('my_remote_platform', from_commit: 'invalid_id') }.to raise_error HybridPlatformsConductor::NodesHandler::GitError, 'Mocked git error due to an invalid commit id'
42
42
  end
43
43
  end
44
44
  end
45
45
 
46
46
  it 'diffs to another commit if asked' do
47
- with_test_platform({}, true) do
48
- with_cmd_runner_mocked([
49
- [/cd .+\/my_remote_platform && git --no-pager diff --no-color master to_branch/, proc { [0, '', ''] }]
50
- ]) do
47
+ with_test_platform({}, as_git: true) do
48
+ with_cmd_runner_mocked [
49
+ [%r{cd .+/my_remote_platform && git --no-pager diff --no-color master to_branch}, proc { [0, '', ''] }]
50
+ ] do
51
51
  expect(test_nodes_handler.impacted_nodes_from_git_diff('my_remote_platform', to_commit: 'to_branch')).to eq [[], [], [], true]
52
52
  end
53
53
  end
54
54
  end
55
55
 
56
56
  it 'gives the platform handler the correct git diff result' do
57
- with_test_platform({}, true) do
58
- with_cmd_runner_mocked([
59
- [/cd .+\/my_remote_platform && git --no-pager diff --no-color master/, proc do
57
+ with_test_platform({}, as_git: true) do
58
+ with_cmd_runner_mocked [
59
+ [%r{cd .+/my_remote_platform && git --no-pager diff --no-color master}, proc do
60
60
  [
61
61
  0,
62
- <<~EOS,
62
+ <<~EO_STDOUT,
63
63
  diff --git a/Gemfile b/Gemfile
64
64
  index d65e2a6..cb9a38e 100644
65
65
  --- a/Gemfile
@@ -83,15 +83,15 @@ describe HybridPlatformsConductor::NodesHandler do
83
83
  + '--nodes-git-impact GIT_IMPACT',
84
84
  nodes_selectors << node
85
85
  end
86
- EOS
86
+ EO_STDOUT
87
87
  ''
88
88
  ]
89
89
  end]
90
- ]) do
90
+ ] do
91
91
  expect(test_nodes_handler.impacted_nodes_from_git_diff('my_remote_platform')).to eq [[], [], [], true]
92
92
  expect(test_platforms_handler.platform('my_remote_platform').files_diffs).to eq(
93
93
  'Gemfile' => {
94
- diff: <<~EOS.strip
94
+ diff: <<~EO_STDOUT.strip
95
95
  index d65e2a6..cb9a38e 100644
96
96
  --- a/Gemfile
97
97
  +++ b/Gemfile
@@ -102,11 +102,11 @@ describe HybridPlatformsConductor::NodesHandler do
102
102
  +
103
103
  +gem 'byebug'
104
104
 
105
- EOS
105
+ EO_STDOUT
106
106
  },
107
107
  'lib/hybrid_platforms_conductor/nodes_handler.rb' => {
108
108
  moved_to: 'lib/stale/hybrid_platforms_conductor/nodes_handler.rb',
109
- diff: <<~EOS.strip
109
+ diff: <<~EO_STDOUT.strip
110
110
  index e8e1778..69a84bd 100644
111
111
  --- a/lib/hybrid_platforms_conductor/nodes_handler.rb
112
112
  +++ b/lib/hybrid_platforms_conductor/nodes_handler.rb
@@ -118,7 +118,7 @@ describe HybridPlatformsConductor::NodesHandler do
118
118
  + '--nodes-git-impact GIT_IMPACT',
119
119
  nodes_selectors << node
120
120
  end
121
- EOS
121
+ EO_STDOUT
122
122
  }
123
123
  )
124
124
  end
@@ -134,11 +134,11 @@ describe HybridPlatformsConductor::NodesHandler do
134
134
  impacted_nodes: %w[node1 node3]
135
135
  }
136
136
  },
137
- true
137
+ as_git: true
138
138
  ) do
139
- with_cmd_runner_mocked([
140
- [/cd .+\/my_remote_platform && git --no-pager diff --no-color master/, proc { [0, '', ''] }]
141
- ]) do
139
+ with_cmd_runner_mocked [
140
+ [%r{cd .+/my_remote_platform && git --no-pager diff --no-color master}, proc { [0, '', ''] }]
141
+ ] do
142
142
  expect(test_nodes_handler.impacted_nodes_from_git_diff('my_remote_platform')).to eq [
143
143
  %w[node1 node3],
144
144
  %w[node1 node3],
@@ -162,11 +162,11 @@ describe HybridPlatformsConductor::NodesHandler do
162
162
  impacted_services: %w[service1 service3]
163
163
  }
164
164
  },
165
- true
165
+ as_git: true
166
166
  ) do
167
- with_cmd_runner_mocked([
168
- [/cd .+\/my_remote_platform && git --no-pager diff --no-color master/, proc { [0, '', ''] }]
169
- ]) do
167
+ with_cmd_runner_mocked [
168
+ [%r{cd .+/my_remote_platform && git --no-pager diff --no-color master}, proc { [0, '', ''] }]
169
+ ] do
170
170
  expect(test_nodes_handler.impacted_nodes_from_git_diff('my_remote_platform')).to eq [
171
171
  %w[node1 node2],
172
172
  [],
@@ -190,11 +190,11 @@ describe HybridPlatformsConductor::NodesHandler do
190
190
  impacted_global: true
191
191
  }
192
192
  },
193
- true
193
+ as_git: true
194
194
  ) do
195
- with_cmd_runner_mocked([
196
- [/cd .+\/my_remote_platform && git --no-pager diff --no-color master/, proc { [0, '', ''] }]
197
- ]) do
195
+ with_cmd_runner_mocked [
196
+ [%r{cd .+/my_remote_platform && git --no-pager diff --no-color master}, proc { [0, '', ''] }]
197
+ ] do
198
198
  expect(test_nodes_handler.impacted_nodes_from_git_diff('my_remote_platform')).to eq [
199
199
  %w[node1 node2 node3],
200
200
  [],
@@ -205,30 +205,6 @@ describe HybridPlatformsConductor::NodesHandler do
205
205
  end
206
206
  end
207
207
 
208
- it 'returns the impacted nodes given by the platform handler' do
209
- with_test_platforms(
210
- {
211
- 'other_platform' => { nodes: { 'other_node_1' => {}, 'other_node_2' => {} } },
212
- 'my_remote_platform' => {
213
- nodes: { 'node1' => {}, 'node2' => {}, 'node3' => {} },
214
- impacted_nodes: %w[node1 node3]
215
- }
216
- },
217
- true
218
- ) do
219
- with_cmd_runner_mocked([
220
- [/cd .+\/my_remote_platform && git --no-pager diff --no-color master/, proc { [0, '', ''] }]
221
- ]) do
222
- expect(test_nodes_handler.impacted_nodes_from_git_diff('my_remote_platform')).to eq [
223
- %w[node1 node3],
224
- %w[node1 node3],
225
- [],
226
- false
227
- ]
228
- end
229
- end
230
- end
231
-
232
208
  it 'returns both impacted services and nodes given by the platform handler' do
233
209
  with_test_platforms(
234
210
  {
@@ -244,11 +220,11 @@ describe HybridPlatformsConductor::NodesHandler do
244
220
  impacted_services: %w[service1 service3]
245
221
  }
246
222
  },
247
- true
223
+ as_git: true
248
224
  ) do
249
- with_cmd_runner_mocked([
250
- [/cd .+\/my_remote_platform && git --no-pager diff --no-color master/, proc { [0, '', ''] }]
251
- ]) do
225
+ with_cmd_runner_mocked [
226
+ [%r{cd .+/my_remote_platform && git --no-pager diff --no-color master}, proc { [0, '', ''] }]
227
+ ] do
252
228
  expect(test_nodes_handler.impacted_nodes_from_git_diff('my_remote_platform')).to eq [
253
229
  %w[node1 node2 node4],
254
230
  %w[node4],
@@ -276,11 +252,11 @@ describe HybridPlatformsConductor::NodesHandler do
276
252
  impacted_services: %w[service2 service3]
277
253
  }
278
254
  },
279
- true
255
+ as_git: true
280
256
  ) do
281
- with_cmd_runner_mocked([
282
- [/cd .+\/my_remote_platform && git --no-pager diff --no-color master/, proc { [0, '', ''] }]
283
- ]) do
257
+ with_cmd_runner_mocked [
258
+ [%r{cd .+/my_remote_platform && git --no-pager diff --no-color master}, proc { [0, '', ''] }]
259
+ ] do
284
260
  expect(test_nodes_handler.impacted_nodes_from_git_diff('my_remote_platform')).to eq [
285
261
  %w[node1 node2 node3 node4 node5 node6],
286
262
  [],
@@ -308,11 +284,11 @@ describe HybridPlatformsConductor::NodesHandler do
308
284
  impacted_services: %w[service2 service3]
309
285
  }
310
286
  },
311
- true
287
+ as_git: true
312
288
  ) do
313
- with_cmd_runner_mocked([
314
- [/cd .+\/my_remote_platform && git --no-pager diff --no-color master/, proc { [0, '', ''] }]
315
- ]) do
289
+ with_cmd_runner_mocked [
290
+ [%r{cd .+/my_remote_platform && git --no-pager diff --no-color master}, proc { [0, '', ''] }]
291
+ ] do
316
292
  expect(test_nodes_handler.impacted_nodes_from_git_diff('my_remote_platform', smallest_set: true)).to eq [
317
293
  %w[node1 node2],
318
294
  [],
@@ -1,23 +1,24 @@
1
1
  describe HybridPlatformsConductor::NodesHandler do
2
2
 
3
- context 'checking nodes selection capabilities' do
3
+ context 'when checking nodes selection capabilities' do
4
4
 
5
5
  # Set the test environment with a given list of nodes for our tests
6
6
  #
7
7
  # Parameters::
8
- # * Proc: Code called when environment is ready
9
- def with_test_platform_for_nodes
8
+ # * *block* (Proc): Code called when environment is ready
9
+ def with_test_platform_for_nodes(&block)
10
10
  with_test_platforms(
11
- 'platform1' => {
12
- nodes: { 'node1' => {}, 'node2' => { services: ['service1'] }, 'node3' => { services: ['service2'] } },
13
- nodes_lists: { 'nodeslist1' => %w[node1 node3], 'nodeslist2' => ['/node[12]/'] }
11
+ {
12
+ 'platform1' => {
13
+ nodes: { 'node1' => {}, 'node2' => { services: ['service1'] }, 'node3' => { services: ['service2'] } },
14
+ nodes_lists: { 'nodeslist1' => %w[node1 node3], 'nodeslist2' => ['/node[12]/'] }
15
+ },
16
+ 'platform2' => {
17
+ nodes: { 'node4' => {}, 'node5' => { services: %w[service3 service1] }, 'node6' => {} }
18
+ }
14
19
  },
15
- 'platform2' => {
16
- nodes: { 'node4' => {}, 'node5' => { services: ['service3', 'service1'] }, 'node6' => {} }
17
- }
18
- ) do
19
- yield
20
- end
20
+ &block
21
+ )
21
22
  end
22
23
 
23
24
  # List all tests of nodes selectors, and the corresponding nodes list they should be resolved into
@@ -50,7 +51,7 @@ describe HybridPlatformsConductor::NodesHandler do
50
51
 
51
52
  it 'ignore unknown nodes when asked' do
52
53
  with_test_platform_for_nodes do
53
- expect(test_nodes_handler.select_nodes(['node1', 'node7'], ignore_unknowns: true).sort).to eq %w[node1 node7].sort
54
+ expect(test_nodes_handler.select_nodes(%w[node1 node7], ignore_unknowns: true).sort).to eq %w[node1 node7].sort
54
55
  end
55
56
  end
56
57
 
@@ -61,7 +62,7 @@ describe HybridPlatformsConductor::NodesHandler do
61
62
  from_commit: 'master',
62
63
  to_commit: nil,
63
64
  smallest_set: false
64
- ) { [%w[node4 node6], [], [], false] }
65
+ ).and_return [%w[node4 node6], [], [], false]
65
66
  expect(test_nodes_handler.select_nodes([{ git_diff: { platform: 'platform2' } }]).sort).to eq %w[node4 node6].sort
66
67
  end
67
68
  end
@@ -73,7 +74,7 @@ describe HybridPlatformsConductor::NodesHandler do
73
74
  from_commit: 'from_commit',
74
75
  to_commit: nil,
75
76
  smallest_set: false
76
- ) { [%w[node4 node6], [], [], false] }
77
+ ).and_return [%w[node4 node6], [], [], false]
77
78
  expect(test_nodes_handler.select_nodes([{ git_diff: { platform: 'platform2', from_commit: 'from_commit' } }]).sort).to eq %w[node4 node6].sort
78
79
  end
79
80
  end
@@ -85,7 +86,7 @@ describe HybridPlatformsConductor::NodesHandler do
85
86
  from_commit: 'master',
86
87
  to_commit: 'to_commit',
87
88
  smallest_set: false
88
- ) { [%w[node4 node6], [], [], false] }
89
+ ).and_return [%w[node4 node6], [], [], false]
89
90
  expect(test_nodes_handler.select_nodes([{ git_diff: { platform: 'platform2', to_commit: 'to_commit' } }]).sort).to eq %w[node4 node6].sort
90
91
  end
91
92
  end
@@ -97,7 +98,7 @@ describe HybridPlatformsConductor::NodesHandler do
97
98
  from_commit: 'master',
98
99
  to_commit: nil,
99
100
  smallest_set: true
100
- ) { [%w[node4 node6], [], [], false] }
101
+ ).and_return [%w[node4 node6], [], [], false]
101
102
  expect(test_nodes_handler.select_nodes([{ git_diff: { platform: 'platform2', smallest_set: true } }]).sort).to eq %w[node4 node6].sort
102
103
  end
103
104
  end
@@ -110,20 +111,28 @@ describe HybridPlatformsConductor::NodesHandler do
110
111
 
111
112
  it 'considers nodes selector intersection in a nodes selector stack' do
112
113
  with_test_platform_for_nodes do
113
- expect(test_nodes_handler.select_from_nodes_selector_stack([
114
- %w[node1 node2 node3],
115
- %w[node2 node3 node4]
116
- ]).sort).to eq %w[node2 node3].sort
114
+ expect(
115
+ test_nodes_handler.select_from_nodes_selector_stack(
116
+ [
117
+ %w[node1 node2 node3],
118
+ %w[node2 node3 node4]
119
+ ]
120
+ ).sort
121
+ ).to eq %w[node2 node3].sort
117
122
  end
118
123
  end
119
124
 
120
125
  it 'considers nodes selector intersection between different kind of selectors in a nodes selector stack' do
121
126
  with_test_platform_for_nodes do
122
- expect(test_nodes_handler.select_from_nodes_selector_stack([
123
- '/node[1256]/',
124
- [{ platform: 'platform2' }],
125
- [{ service: 'service1' }]
126
- ]).sort).to eq %w[node5].sort
127
+ expect(
128
+ test_nodes_handler.select_from_nodes_selector_stack(
129
+ [
130
+ '/node[1256]/',
131
+ [{ platform: 'platform2' }],
132
+ [{ service: 'service1' }]
133
+ ]
134
+ ).sort
135
+ ).to eq %w[node5].sort
127
136
  end
128
137
  end
129
138
 
@@ -1,23 +1,25 @@
1
1
  describe HybridPlatformsConductor::NodesHandler do
2
2
 
3
- context 'checking Platform Handlers plugins\' API called by NodesHandler' do
3
+ context 'when checking Platform Handlers plugins\' API called by NodesHandler' do
4
4
 
5
5
  it 'returns nodes' do
6
- with_test_platform(nodes: { 'node1' => {}, 'node2' => {} }) do
6
+ with_test_platform({ nodes: { 'node1' => {}, 'node2' => {} } }) do
7
7
  expect(test_nodes_handler.known_nodes.sort).to eq %w[node1 node2].sort
8
8
  end
9
9
  end
10
10
 
11
11
  it 'returns nodes lists' do
12
- with_test_platform(nodes_lists: { 'test_nodes_list' => [] }) do
12
+ with_test_platform({ nodes_lists: { 'test_nodes_list' => [] } }) do
13
13
  expect(test_nodes_handler.known_nodes_lists).to eq ['test_nodes_list']
14
14
  end
15
15
  end
16
16
 
17
17
  it 'returns nodes defined in a nodes lists' do
18
18
  with_test_platform(
19
- nodes: { 'node1' => {}, 'node2' => {} },
20
- nodes_lists: { 'test_nodes_list' => %w[node1 node2] }
19
+ {
20
+ nodes: { 'node1' => {}, 'node2' => {} },
21
+ nodes_lists: { 'test_nodes_list' => %w[node1 node2] }
22
+ }
21
23
  ) do
22
24
  expect(test_nodes_handler.nodes_from_list('test_nodes_list').sort).to eq %w[node1 node2].sort
23
25
  end
@@ -25,13 +27,15 @@ describe HybridPlatformsConductor::NodesHandler do
25
27
 
26
28
  it 'returns nodes selectors defined in a nodes lists' do
27
29
  with_test_platform(
28
- nodes: {
29
- 'node10' => { services: ['test_service'] },
30
- 'node11' => { services: ['test_service_2'] },
31
- 'node20' => { services: ['test_service_3', 'test_service'] },
32
- 'node21' => { services: ['test_service_2'] }
33
- },
34
- nodes_lists: { 'test_nodes_list' => ['/node1.+/', { service: 'test_service' }] }
30
+ {
31
+ nodes: {
32
+ 'node10' => { services: ['test_service'] },
33
+ 'node11' => { services: ['test_service_2'] },
34
+ 'node20' => { services: %w[test_service_3 test_service] },
35
+ 'node21' => { services: ['test_service_2'] }
36
+ },
37
+ nodes_lists: { 'test_nodes_list' => ['/node1.+/', { service: 'test_service' }] }
38
+ }
35
39
  ) do
36
40
  expect(test_nodes_handler.nodes_from_list('test_nodes_list').sort).to eq %w[node10 node11 node20].sort
37
41
  end
@@ -39,8 +43,10 @@ describe HybridPlatformsConductor::NodesHandler do
39
43
 
40
44
  it 'returns nodes defined in a nodes lists while ignoring unknown ones' do
41
45
  with_test_platform(
42
- nodes: { 'node1' => {} },
43
- nodes_lists: { 'test_nodes_list' => %w[node1 node2] }
46
+ {
47
+ nodes: { 'node1' => {} },
48
+ nodes_lists: { 'test_nodes_list' => %w[node1 node2] }
49
+ }
44
50
  ) do
45
51
  expect(test_nodes_handler.nodes_from_list('test_nodes_list', ignore_unknowns: true).sort).to eq %w[node1 node2].sort
46
52
  end
@@ -48,8 +54,10 @@ describe HybridPlatformsConductor::NodesHandler do
48
54
 
49
55
  it 'fails when returning unknown nodes defined in a nodes lists' do
50
56
  with_test_platform(
51
- nodes: { 'node1' => {} },
52
- nodes_lists: { 'test_nodes_list' => %w[node1 node2] }
57
+ {
58
+ nodes: { 'node1' => {} },
59
+ nodes_lists: { 'test_nodes_list' => %w[node1 node2] }
60
+ }
53
61
  ) do
54
62
  expect { test_nodes_handler.nodes_from_list('test_nodes_list') }.to raise_error(RuntimeError, 'Unknown nodes: node2')
55
63
  end