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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/bin/check-node +0 -1
- data/bin/deploy +0 -1
- data/bin/get_impacted_nodes +0 -1
- data/bin/last_deploys +8 -7
- data/bin/nodes_to_deploy +2 -2
- data/bin/setup +6 -6
- data/bin/topograph +1 -1
- data/lib/hybrid_platforms_conductor/action.rb +4 -4
- data/lib/hybrid_platforms_conductor/actions_executor.rb +37 -42
- data/lib/hybrid_platforms_conductor/bitbucket.rb +5 -4
- data/lib/hybrid_platforms_conductor/cmd_runner.rb +13 -12
- data/lib/hybrid_platforms_conductor/cmdb.rb +2 -2
- data/lib/hybrid_platforms_conductor/common_config_dsl/bitbucket.rb +2 -1
- data/lib/hybrid_platforms_conductor/common_config_dsl/confluence.rb +2 -1
- data/lib/hybrid_platforms_conductor/common_config_dsl/file_system_tests.rb +5 -4
- data/lib/hybrid_platforms_conductor/common_config_dsl/github.rb +4 -3
- data/lib/hybrid_platforms_conductor/common_config_dsl/idempotence_tests.rb +2 -2
- data/lib/hybrid_platforms_conductor/config.rb +7 -4
- data/lib/hybrid_platforms_conductor/confluence.rb +1 -1
- data/lib/hybrid_platforms_conductor/connector.rb +5 -2
- data/lib/hybrid_platforms_conductor/core_extensions/symbol/zero.rb +24 -0
- data/lib/hybrid_platforms_conductor/credentials.rb +39 -36
- data/lib/hybrid_platforms_conductor/current_dir_monitor.rb +4 -1
- data/lib/hybrid_platforms_conductor/deployer.rb +95 -96
- data/lib/hybrid_platforms_conductor/executable.rb +20 -15
- data/lib/hybrid_platforms_conductor/hpc_plugins/cmdb/config.rb +10 -7
- data/lib/hybrid_platforms_conductor/hpc_plugins/cmdb/host_ip.rb +1 -1
- data/lib/hybrid_platforms_conductor/hpc_plugins/cmdb/host_keys.rb +2 -2
- data/lib/hybrid_platforms_conductor/hpc_plugins/cmdb/platform_handlers.rb +4 -4
- data/lib/hybrid_platforms_conductor/hpc_plugins/connector/local.rb +2 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/connector/ssh.rb +45 -49
- data/lib/hybrid_platforms_conductor/hpc_plugins/log/remote_fs.rb +6 -5
- data/lib/hybrid_platforms_conductor/hpc_plugins/platform_handler/serverless_chef.rb +68 -66
- data/lib/hybrid_platforms_conductor/hpc_plugins/platform_handler/serverless_chef/dsl_parser.rb +13 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/platform_handler/serverless_chef/recipes_tree_builder.rb +39 -38
- data/lib/hybrid_platforms_conductor/hpc_plugins/platform_handler/yaml_inventory.rb +5 -4
- data/lib/hybrid_platforms_conductor/hpc_plugins/provisioner/docker.rb +43 -45
- data/lib/hybrid_platforms_conductor/hpc_plugins/provisioner/podman.rb +18 -20
- data/lib/hybrid_platforms_conductor/hpc_plugins/provisioner/proxmox.rb +118 -117
- data/lib/hybrid_platforms_conductor/hpc_plugins/provisioner/proxmox/proxmox_waiter.rb +39 -43
- data/lib/hybrid_platforms_conductor/hpc_plugins/provisioner/proxmox/reserve_proxmox_container +9 -13
- data/lib/hybrid_platforms_conductor/hpc_plugins/report/confluence.rb +2 -2
- data/lib/hybrid_platforms_conductor/hpc_plugins/report/mediawiki.rb +28 -21
- data/lib/hybrid_platforms_conductor/hpc_plugins/report/stdout.rb +26 -22
- data/lib/hybrid_platforms_conductor/hpc_plugins/secrets_reader/cli.rb +8 -6
- data/lib/hybrid_platforms_conductor/hpc_plugins/secrets_reader/thycotic.rb +7 -4
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/bitbucket_conf.rb +3 -3
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/check_deploy_and_idempotence.rb +4 -2
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/deploy_freshness.rb +0 -1
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/deploy_removes_root_access.rb +21 -19
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/divergence.rb +2 -2
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/executables.rb +2 -2
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/file_system.rb +19 -21
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/file_system_hdfs.rb +19 -21
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/github_ci.rb +2 -3
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/idempotence.rb +2 -2
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/ip.rb +1 -1
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/jenkins_ci_conf.rb +21 -22
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/jenkins_ci_masters_ok.rb +10 -12
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/linear_strategy.rb +9 -9
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/local_users.rb +2 -2
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/mounts.rb +2 -2
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/orphan_files.rb +10 -9
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/ports.rb +2 -2
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/private_ips.rb +5 -5
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/public_ips.rb +5 -5
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/spectre.rb +4 -6
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/veids.rb +3 -3
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/vulnerabilities.rb +25 -24
- data/lib/hybrid_platforms_conductor/hpc_plugins/test_report/confluence.rb +2 -2
- data/lib/hybrid_platforms_conductor/hpc_plugins/test_report/stdout.rb +8 -6
- data/lib/hybrid_platforms_conductor/io_router.rb +14 -13
- data/lib/hybrid_platforms_conductor/json_dumper.rb +2 -2
- data/lib/hybrid_platforms_conductor/log.rb +2 -2
- data/lib/hybrid_platforms_conductor/logger_helpers.rb +19 -16
- data/lib/hybrid_platforms_conductor/nodes_handler.rb +89 -71
- data/lib/hybrid_platforms_conductor/parallel_threads.rb +7 -11
- data/lib/hybrid_platforms_conductor/platform_handler.rb +7 -7
- data/lib/hybrid_platforms_conductor/platforms_handler.rb +5 -3
- data/lib/hybrid_platforms_conductor/plugin.rb +2 -2
- data/lib/hybrid_platforms_conductor/plugins.rb +13 -8
- data/lib/hybrid_platforms_conductor/provisioner.rb +4 -4
- data/lib/hybrid_platforms_conductor/report.rb +2 -2
- data/lib/hybrid_platforms_conductor/reports_handler.rb +3 -2
- data/lib/hybrid_platforms_conductor/secrets_reader.rb +2 -2
- data/lib/hybrid_platforms_conductor/services_handler.rb +32 -29
- data/lib/hybrid_platforms_conductor/test_only_remote_node.rb +1 -1
- data/lib/hybrid_platforms_conductor/test_report.rb +15 -18
- data/lib/hybrid_platforms_conductor/tests_runner.rb +116 -118
- data/lib/hybrid_platforms_conductor/thycotic.rb +28 -19
- data/lib/hybrid_platforms_conductor/topographer.rb +200 -190
- data/lib/hybrid_platforms_conductor/topographer/plugins/graphviz.rb +8 -8
- data/lib/hybrid_platforms_conductor/topographer/plugins/json.rb +4 -4
- data/lib/hybrid_platforms_conductor/version.rb +1 -1
- data/spec/hybrid_platforms_conductor_test.rb +6 -6
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/actions/bash_spec.rb +16 -11
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/actions/interactive_spec.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/actions/remote_bash_spec.rb +23 -18
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/actions/ruby_spec.rb +67 -49
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/actions/scp_spec.rb +20 -14
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/actions_spec.rb +63 -50
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/connection_spec.rb +35 -35
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/local/connectable_nodes_spec.rb +12 -8
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/local/remote_actions_spec.rb +4 -7
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/cli_options_spec.rb +21 -22
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/config_dsl_spec.rb +23 -24
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/connectable_nodes_spec.rb +10 -6
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/connections_spec.rb +73 -54
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/global_helpers_spec.rb +145 -126
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/node_helpers_spec.rb +3 -3
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/remote_actions_spec.rb +29 -25
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/logging_spec.rb +106 -91
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/parallel_spec.rb +272 -244
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/timeout_spec.rb +10 -12
- data/spec/hybrid_platforms_conductor_test/api/cmd_runner_spec.rb +36 -36
- data/spec/hybrid_platforms_conductor_test/api/config_spec.rb +24 -22
- data/spec/hybrid_platforms_conductor_test/api/deployer/check_spec.rb +4 -2
- data/spec/hybrid_platforms_conductor_test/api/deployer/config_dsl_spec.rb +7 -11
- data/spec/hybrid_platforms_conductor_test/api/deployer/deploy_spec.rb +34 -26
- data/spec/hybrid_platforms_conductor_test/api/deployer/log_plugins/remote_fs_spec.rb +21 -21
- data/spec/hybrid_platforms_conductor_test/api/deployer/parse_deploy_output_spec.rb +55 -59
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioner_spec.rb +36 -62
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/podman_spec.rb +17 -17
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/config_dsl_spec.rb +4 -4
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/create_spec.rb +44 -51
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/destroy_spec.rb +3 -3
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/ip_spec.rb +12 -16
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/reserve_proxmox_container/destroy_vm_spec.rb +31 -19
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/reserve_proxmox_container/expired_containers_spec.rb +324 -266
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/reserve_proxmox_container/ips_assignment_spec.rb +89 -61
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/reserve_proxmox_container/other_lxc_containers_resources_spec.rb +117 -93
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/reserve_proxmox_container/pve_node_resources_spec.rb +71 -54
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/reserve_proxmox_container/retries_spec.rb +10 -8
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/reserve_proxmox_container/vm_ids_assignment_spec.rb +80 -60
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/start_spec.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/state_spec.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/stop_spec.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/api/deployer/secrets_reader_plugins/cli_spec.rb +21 -20
- data/spec/hybrid_platforms_conductor_test/api/deployer/secrets_reader_plugins/thycotic_spec.rb +70 -55
- data/spec/hybrid_platforms_conductor_test/api/nodes_handler/cmdbs/config_spec.rb +8 -10
- data/spec/hybrid_platforms_conductor_test/api/nodes_handler/cmdbs/host_ip_spec.rb +33 -24
- data/spec/hybrid_platforms_conductor_test/api/nodes_handler/cmdbs/host_keys_spec.rb +64 -51
- data/spec/hybrid_platforms_conductor_test/api/nodes_handler/cmdbs/platform_handlers_spec.rb +3 -3
- data/spec/hybrid_platforms_conductor_test/api/nodes_handler/cmdbs_plugins_api_spec.rb +50 -51
- data/spec/hybrid_platforms_conductor_test/api/nodes_handler/common_spec.rb +91 -81
- data/spec/hybrid_platforms_conductor_test/api/nodes_handler/config_dsl_spec.rb +14 -16
- data/spec/hybrid_platforms_conductor_test/api/nodes_handler/git_diff_impacts_spec.rb +51 -75
- data/spec/hybrid_platforms_conductor_test/api/nodes_handler/nodes_selectors_spec.rb +35 -26
- data/spec/hybrid_platforms_conductor_test/api/nodes_handler/platform_handlers_plugins_api_spec.rb +24 -16
- data/spec/hybrid_platforms_conductor_test/api/nodes_handler/several_platforms_spec.rb +29 -19
- data/spec/hybrid_platforms_conductor_test/api/platform_handler_spec.rb +4 -4
- data/spec/hybrid_platforms_conductor_test/api/platform_handlers/serverless_chef/config_dsl_spec.rb +2 -2
- data/spec/hybrid_platforms_conductor_test/api/platform_handlers/serverless_chef/deploy_output_parsing_spec.rb +6 -6
- data/spec/hybrid_platforms_conductor_test/api/platform_handlers/serverless_chef/diff_impacts_spec.rb +57 -99
- data/spec/hybrid_platforms_conductor_test/api/platform_handlers/serverless_chef/inventory_spec.rb +4 -4
- data/spec/hybrid_platforms_conductor_test/api/platform_handlers/serverless_chef/packaging_spec.rb +32 -35
- data/spec/hybrid_platforms_conductor_test/api/platform_handlers/serverless_chef/services_deployment_spec.rb +10 -10
- data/spec/hybrid_platforms_conductor_test/api/platforms_handler_spec.rb +38 -27
- data/spec/hybrid_platforms_conductor_test/api/plugins_spec.rb +46 -52
- data/spec/hybrid_platforms_conductor_test/api/reports_handler_spec.rb +2 -2
- data/spec/hybrid_platforms_conductor_test/api/services_handler/actions_to_deploy_spec.rb +90 -58
- data/spec/hybrid_platforms_conductor_test/api/services_handler/deploy_allowed_spec.rb +38 -34
- data/spec/hybrid_platforms_conductor_test/api/services_handler/log_info_spec.rb +11 -9
- data/spec/hybrid_platforms_conductor_test/api/services_handler/package_spec.rb +193 -171
- data/spec/hybrid_platforms_conductor_test/api/services_handler/parse_deploy_output_spec.rb +66 -54
- data/spec/hybrid_platforms_conductor_test/api/services_handler/prepare_for_deploy_spec.rb +147 -133
- data/spec/hybrid_platforms_conductor_test/api/tests_runner/common_spec.rb +69 -49
- data/spec/hybrid_platforms_conductor_test/api/tests_runner/global_spec.rb +4 -3
- data/spec/hybrid_platforms_conductor_test/api/tests_runner/node_check_spec.rb +8 -5
- data/spec/hybrid_platforms_conductor_test/api/tests_runner/node_spec.rb +8 -5
- data/spec/hybrid_platforms_conductor_test/api/tests_runner/node_ssh_spec.rb +30 -27
- data/spec/hybrid_platforms_conductor_test/api/tests_runner/platform_spec.rb +12 -9
- data/spec/hybrid_platforms_conductor_test/api/tests_runner/reports_spec.rb +48 -47
- data/spec/hybrid_platforms_conductor_test/api/tests_runner/test_plugins/bitbucket_conf_spec.rb +5 -5
- data/spec/hybrid_platforms_conductor_test/api/tests_runner/test_plugins/github_ci_spec.rb +5 -5
- data/spec/hybrid_platforms_conductor_test/api/tests_runner/test_reports_plugins/confluence_spec.rb +5 -5
- data/spec/hybrid_platforms_conductor_test/cmdb_plugins/test_cmdb.rb +9 -9
- data/spec/hybrid_platforms_conductor_test/cmdb_plugins/{test_cmdb2.rb → test_cmdb_2.rb} +6 -6
- data/spec/hybrid_platforms_conductor_test/cmdb_plugins/test_cmdb_others.rb +3 -3
- data/spec/hybrid_platforms_conductor_test/cmdb_plugins/{test_cmdb_others2.rb → test_cmdb_others_2.rb} +2 -2
- data/spec/hybrid_platforms_conductor_test/docs_spec.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/executables/{check-node_spec.rb → check_node_spec.rb} +4 -6
- data/spec/hybrid_platforms_conductor_test/executables/deploy_spec.rb +4 -6
- data/spec/hybrid_platforms_conductor_test/executables/get_impacted_nodes_spec.rb +76 -77
- data/spec/hybrid_platforms_conductor_test/executables/last_deploys_spec.rb +13 -15
- data/spec/hybrid_platforms_conductor_test/executables/nodes_to_deploy_spec.rb +289 -307
- data/spec/hybrid_platforms_conductor_test/executables/options/actions_executor_spec.rb +4 -6
- data/spec/hybrid_platforms_conductor_test/executables/options/cmd_runner_spec.rb +3 -5
- data/spec/hybrid_platforms_conductor_test/executables/options/common_spec.rb +8 -9
- data/spec/hybrid_platforms_conductor_test/executables/options/deployer_spec.rb +12 -14
- data/spec/hybrid_platforms_conductor_test/executables/options/nodes_handler_spec.rb +9 -10
- data/spec/hybrid_platforms_conductor_test/executables/options/nodes_selectors_spec.rb +9 -10
- data/spec/hybrid_platforms_conductor_test/executables/options/reports_handler_spec.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/executables/options/tests_runner_spec.rb +22 -22
- data/spec/hybrid_platforms_conductor_test/executables/report_spec.rb +22 -16
- data/spec/hybrid_platforms_conductor_test/executables/run_spec.rb +32 -32
- data/spec/hybrid_platforms_conductor_test/executables/ssh_config_spec.rb +7 -9
- data/spec/hybrid_platforms_conductor_test/executables/test_spec.rb +3 -5
- data/spec/hybrid_platforms_conductor_test/helpers/actions_executor_helpers.rb +2 -2
- data/spec/hybrid_platforms_conductor_test/helpers/cmd_runner_helpers.rb +4 -3
- data/spec/hybrid_platforms_conductor_test/helpers/cmdb_helpers.rb +2 -2
- data/spec/hybrid_platforms_conductor_test/helpers/config_helpers.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/helpers/connector_ssh_helpers.rb +12 -13
- data/spec/hybrid_platforms_conductor_test/helpers/deployer_helpers.rb +216 -14
- data/spec/hybrid_platforms_conductor_test/helpers/executables_helpers.rb +11 -11
- data/spec/hybrid_platforms_conductor_test/helpers/nodes_handler_helpers.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/helpers/platforms_handler_helpers.rb +39 -28
- data/spec/hybrid_platforms_conductor_test/helpers/plugins_helpers.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/helpers/provisioner_proxmox_helpers.rb +86 -111
- data/spec/hybrid_platforms_conductor_test/helpers/reports_handler_helpers.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/helpers/serverless_chef_helpers.rb +3 -3
- data/spec/hybrid_platforms_conductor_test/helpers/services_handler_helpers.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/helpers/tests_runner_helpers.rb +1 -1
- 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
- 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
- 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
- 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
- data/spec/hybrid_platforms_conductor_test/platform_handler_plugins/test.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/platform_handler_plugins/{test2.rb → test_2.rb} +0 -0
- data/spec/hybrid_platforms_conductor_test/rubocop_spec.rb +31 -0
- data/spec/hybrid_platforms_conductor_test/serverless_chef_repositories/1_node/nodes/node.json +3 -3
- data/spec/hybrid_platforms_conductor_test/serverless_chef_repositories/data_bags/nodes/node.json +3 -3
- data/spec/hybrid_platforms_conductor_test/serverless_chef_repositories/recipes/cookbooks/test_cookbook_2/libraries/default.rb +1 -0
- data/spec/hybrid_platforms_conductor_test/serverless_chef_repositories/several_cookbooks/other_cookbooks/test_cookbook_2/libraries/default.rb +1 -0
- data/spec/hybrid_platforms_conductor_test/shared_examples/deployer.rb +952 -0
- data/spec/hybrid_platforms_conductor_test/test_connector.rb +3 -3
- data/spec/hybrid_platforms_conductor_test/test_log_no_read_plugin.rb +3 -1
- data/spec/hybrid_platforms_conductor_test/test_log_plugin.rb +3 -1
- data/spec/hybrid_platforms_conductor_test/test_plugins/global.rb +1 -0
- data/spec/hybrid_platforms_conductor_test/test_plugins/node.rb +1 -0
- data/spec/hybrid_platforms_conductor_test/test_plugins/node_check.rb +1 -0
- data/spec/hybrid_platforms_conductor_test/test_plugins/platform.rb +1 -0
- data/spec/hybrid_platforms_conductor_test/test_plugins/several_checks.rb +2 -2
- data/spec/hybrid_platforms_conductor_test/test_secrets_reader_plugin.rb +4 -4
- data/spec/hybrid_platforms_conductor_test/tests_report_plugin.rb +5 -6
- data/spec/spec_helper.rb +17 -18
- data/tools/check_md +16 -20
- data/tools/generate_mermaid +1 -1
- metadata +43 -13
- 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
|
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
|
data/spec/hybrid_platforms_conductor_test/executables/{check-node_spec.rb → check_node_spec.rb}
RENAMED
@@ -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' => {} } })
|
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
|
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' => {} } })
|
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
|
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
|
-
|
18
|
-
|
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
|
-
)
|
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 <<~
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
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
|
-
)
|
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 <<~
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
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
|
-
)
|
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 <<~
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
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
|
-
)
|
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 <<~
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
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
|
-
)
|
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 <<~
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
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' => {} } })
|
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
|
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
|
-
|
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
|
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
|
-
|
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
|
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
|
-
|
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
|
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
|
-
|
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
|
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
|
-
|
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
|
-
|
14
|
-
|
15
|
-
)
|
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])
|
23
|
-
{
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
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
|
-
|
36
|
-
|
37
|
-
|
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
|
-
|
48
|
-
expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform', from_commit: 'abcdef1', to_commit: 'master')
|
49
|
-
expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform', from_commit: 'abcdef2', to_commit: 'master')
|
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 <<~
|
48
|
+
expect(stdout).to eq <<~EO_STDOUT
|
53
49
|
===== Nodes to deploy =====
|
54
50
|
node1
|
55
51
|
node2
|
56
|
-
|
57
|
-
expect(stderr).to match
|
58
|
-
expect(stderr).to match
|
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])
|
65
|
-
{
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
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
|
-
|
79
|
-
expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform', from_commit: 'abcdef2', to_commit: 'master')
|
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 <<~
|
76
|
+
expect(stdout).to eq <<~EO_STDOUT
|
83
77
|
===== Nodes to deploy =====
|
84
78
|
node2
|
85
|
-
|
86
|
-
expect(stderr).not_to match
|
87
|
-
expect(stderr).to match
|
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])
|
94
|
-
{
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
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
|
-
|
107
|
-
|
108
|
-
|
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
|
-
|
119
|
-
expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform', from_commit: 'abcdef1', to_commit: 'master')
|
120
|
-
expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform', from_commit: 'abcdef2', to_commit: 'master')
|
121
|
-
exit_code, stdout
|
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 <<~
|
115
|
+
expect(stdout).to eq <<~EO_STDOUT
|
124
116
|
===== Nodes to deploy =====
|
125
117
|
node1
|
126
|
-
|
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])
|
133
|
-
{
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
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
|
-
|
142
|
-
|
143
|
-
|
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
|
-
|
154
|
-
expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform', from_commit: 'abcdef2', to_commit: 'master')
|
155
|
-
exit_code, stdout
|
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 <<~
|
147
|
+
expect(stdout).to eq <<~EO_STDOUT
|
158
148
|
===== Nodes to deploy =====
|
159
149
|
node1
|
160
|
-
|
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])
|
167
|
-
{
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
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
|
-
|
180
|
-
|
181
|
-
|
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
|
-
|
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')
|
196
|
-
exit_code, stdout
|
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 <<~
|
186
|
+
expect(stdout).to eq <<~EO_STDOUT
|
199
187
|
===== Nodes to deploy =====
|
200
188
|
node1
|
201
|
-
|
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
|
195
|
+
exit_code, stdout = run 'nodes_to_deploy', '--ignore-deployed-info'
|
208
196
|
expect(exit_code).to eq 0
|
209
|
-
expect(stdout).to eq <<~
|
197
|
+
expect(stdout).to eq <<~EO_STDOUT
|
210
198
|
===== Nodes to deploy =====
|
211
199
|
node1
|
212
200
|
node2
|
213
|
-
|
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])
|
223
|
-
{
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
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
|
-
|
237
|
-
expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform', from_commit: 'abcdef2', to_commit: 'master')
|
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 <<~
|
226
|
+
expect(stdout).to eq <<~EO_STDOUT
|
241
227
|
===== Nodes to deploy =====
|
242
228
|
node2
|
243
|
-
|
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])
|
254
|
-
{
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
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
|
-
|
268
|
-
expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform', from_commit: 'abcdef1', to_commit: 'master')
|
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 <<~
|
256
|
+
expect(stdout).to eq <<~EO_STDOUT
|
273
257
|
===== Nodes to deploy =====
|
274
258
|
node1
|
275
|
-
|
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])
|
286
|
-
{
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
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
|
-
|
299
|
-
|
300
|
-
|
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
|
-
|
311
|
-
expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform', from_commit: 'abcdef1', to_commit: 'master')
|
312
|
-
expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform', from_commit: 'abcdef2', to_commit: 'master')
|
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 <<~
|
297
|
+
expect(stdout).to eq <<~EO_STDOUT
|
316
298
|
===== Nodes to deploy =====
|
317
299
|
node1
|
318
300
|
node2
|
319
|
-
|
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
|
-
|
327
|
-
|
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])
|
330
|
-
{
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
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
|
-
|
343
|
-
|
344
|
-
|
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
|
-
|
355
|
-
expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform1', from_commit: 'abcdef1', to_commit: 'master')
|
356
|
-
expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform2', from_commit: 'abcdef2', to_commit: 'master')
|
357
|
-
exit_code, stdout
|
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 <<~
|
341
|
+
expect(stdout).to eq <<~EO_STDOUT
|
360
342
|
===== Nodes to deploy =====
|
361
343
|
node1
|
362
344
|
node2
|
363
|
-
|
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
|
-
|
370
|
-
|
371
|
-
|
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])
|
374
|
-
{
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
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
|
-
|
389
|
-
|
390
|
-
|
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
|
-
|
403
|
-
expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform1', from_commit: 'abcdef1', to_commit: 'master')
|
404
|
-
expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform2', from_commit: '1234567', to_commit: 'master')
|
405
|
-
expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform2', from_commit: 'abcdef2', to_commit: 'master')
|
406
|
-
expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform3', from_commit: '2345678', to_commit: 'master')
|
407
|
-
exit_code, stdout
|
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 <<~
|
391
|
+
expect(stdout).to eq <<~EO_STDOUT
|
410
392
|
===== Nodes to deploy =====
|
411
393
|
node1
|
412
394
|
node2
|
413
|
-
|
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
|
-
|
420
|
-
|
421
|
-
|
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])
|
424
|
-
{
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
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
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
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
|
-
|
453
|
-
expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform1', from_commit: 'abcdef1', to_commit: 'master')
|
454
|
-
expect(test_nodes_handler).to receive(:impacted_nodes_from_git_diff).with('platform2', from_commit: 'abcdef2', to_commit: 'master')
|
455
|
-
exit_code, stdout
|
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 <<~
|
439
|
+
expect(stdout).to eq <<~EO_STDOUT
|
458
440
|
===== Nodes to deploy =====
|
459
441
|
node1
|
460
442
|
node2
|
461
|
-
|
443
|
+
EO_STDOUT
|
462
444
|
end
|
463
445
|
end
|
464
446
|
|