hybrid_platforms_conductor 32.16.4 → 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 +42 -0
- data/README.md +6 -3
- data/bin/check-node +0 -1
- data/bin/deploy +0 -1
- data/bin/get_impacted_nodes +0 -1
- data/bin/last_deploys +12 -8
- data/bin/nodes_to_deploy +6 -6
- data/bin/setup +6 -6
- data/bin/topograph +1 -1
- data/docs/config_dsl.md +45 -1
- data/docs/executables.md +6 -7
- data/docs/executables/check-node.md +3 -3
- data/docs/executables/deploy.md +3 -3
- data/docs/executables/dump_nodes_json.md +3 -3
- data/docs/executables/test.md +3 -3
- data/docs/executables/topograph.md +3 -3
- data/docs/gen/mermaid/README.md-0.png +0 -0
- data/docs/gen/mermaid/docs/executables/check-node.md-0.png +0 -0
- data/docs/gen/mermaid/docs/executables/deploy.md-0.png +0 -0
- data/docs/gen/mermaid/docs/executables/free_ips.md-0.png +0 -0
- data/docs/gen/mermaid/docs/executables/get_impacted_nodes.md-0.png +0 -0
- data/docs/gen/mermaid/docs/executables/last_deploys.md-0.png +0 -0
- data/docs/gen/mermaid/docs/executables/nodes_to_deploy.md-0.png +0 -0
- data/docs/gen/mermaid/docs/executables/report.md-0.png +0 -0
- data/docs/gen/mermaid/docs/executables/run.md-0.png +0 -0
- data/docs/gen/mermaid/docs/executables/ssh_config.md-0.png +0 -0
- data/docs/gen/mermaid/docs/executables/test.md-0.png +0 -0
- data/docs/plugins.md +47 -0
- data/docs/plugins/connector/ssh.md +1 -1
- data/docs/plugins/log/remote_fs.md +26 -0
- data/docs/plugins/secrets_reader/cli.md +31 -0
- data/docs/plugins/secrets_reader/thycotic.md +46 -0
- data/docs/plugins/test/bitbucket_conf.md +1 -1
- data/docs/plugins/test/check_deploy_and_idempotence.md +1 -1
- data/docs/plugins/test/connection.md +1 -0
- data/docs/plugins/test/deploy_removes_root_access.md +1 -1
- data/docs/plugins/test/file_system.md +1 -0
- data/docs/plugins/test/github_ci.md +48 -0
- data/docs/plugins/test/hostname.md +1 -0
- data/docs/plugins/test/ip.md +1 -0
- data/docs/plugins/test/jenkins_ci_conf.md +1 -1
- data/docs/plugins/test/jenkins_ci_masters_ok.md +1 -1
- data/docs/plugins/test/local_users.md +1 -0
- data/docs/plugins/test/mounts.md +1 -0
- data/docs/plugins/test/orphan_files.md +1 -0
- data/docs/plugins/test/ports.md +1 -0
- data/docs/plugins/test/spectre.md +1 -0
- data/docs/plugins/test/vulnerabilities.md +1 -0
- data/lib/hybrid_platforms_conductor/action.rb +4 -4
- data/lib/hybrid_platforms_conductor/actions_executor.rb +45 -43
- 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 +63 -0
- 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 +275 -224
- 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/my_log_plugin.rb.sample +100 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/log/remote_fs.rb +180 -0
- 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 +77 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/secrets_reader/my_secrets_reader_plugin.rb.sample +46 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/secrets_reader/thycotic.rb +90 -0
- 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/connection.rb +3 -1
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/deploy_freshness.rb +7 -21
- 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 +21 -22
- 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 +31 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/hostname.rb +3 -1
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/idempotence.rb +2 -2
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/ip.rb +4 -2
- 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 +5 -3
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/mounts.rb +5 -3
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/orphan_files.rb +13 -10
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/ports.rb +5 -3
- 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 +7 -7
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/veids.rb +3 -3
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/vulnerabilities.rb +27 -25
- 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 +31 -0
- 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 +14 -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 +31 -0
- data/lib/hybrid_platforms_conductor/services_handler.rb +32 -29
- data/lib/hybrid_platforms_conductor/test_only_remote_node.rb +18 -0
- 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 +33 -12
- 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 +43 -5
- data/spec/hybrid_platforms_conductor_test/api/deployer/deploy_spec.rb +199 -216
- data/spec/hybrid_platforms_conductor_test/api/deployer/log_plugins/remote_fs_spec.rb +223 -0
- 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 +64 -0
- data/spec/hybrid_platforms_conductor_test/api/deployer/secrets_reader_plugins/thycotic_spec.rb +268 -0
- 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 +5 -4
- 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 +72 -0
- 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 +159 -113
- data/spec/hybrid_platforms_conductor_test/executables/nodes_to_deploy_spec.rb +299 -160
- 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 -8
- data/spec/hybrid_platforms_conductor_test/executables/options/deployer_spec.rb +12 -196
- 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 +245 -56
- 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 +84 -0
- data/spec/hybrid_platforms_conductor_test/test_log_plugin.rb +105 -0
- 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 +45 -0
- 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 +82 -13
- data/spec/hybrid_platforms_conductor_test/helpers/deployer_test_helpers.rb +0 -916
data/tools/generate_mermaid
CHANGED
@@ -64,7 +64,7 @@ def gen_mermaid(file)
|
|
64
64
|
markdown << line
|
65
65
|
end
|
66
66
|
end
|
67
|
-
File.write(file, markdown.map { |line| "#{line}\n" }.join) if idx_mermaid
|
67
|
+
File.write(file, markdown.map { |line| "#{line}\n" }.join) if idx_mermaid.positive?
|
68
68
|
end
|
69
69
|
|
70
70
|
Tempfile.create('puppeteer') do |puppeteer_file|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hybrid_platforms_conductor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 33.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Muriel Salvan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-06-
|
11
|
+
date: 2021-06-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: range_operators
|
@@ -248,6 +248,20 @@ dependencies:
|
|
248
248
|
- - "~>"
|
249
249
|
- !ruby/object:Gem::Version
|
250
250
|
version: '0.16'
|
251
|
+
- !ruby/object:Gem::Dependency
|
252
|
+
name: octokit
|
253
|
+
requirement: !ruby/object:Gem::Requirement
|
254
|
+
requirements:
|
255
|
+
- - "~>"
|
256
|
+
- !ruby/object:Gem::Version
|
257
|
+
version: '4.21'
|
258
|
+
type: :runtime
|
259
|
+
prerelease: false
|
260
|
+
version_requirements: !ruby/object:Gem::Requirement
|
261
|
+
requirements:
|
262
|
+
- - "~>"
|
263
|
+
- !ruby/object:Gem::Version
|
264
|
+
version: '4.21'
|
251
265
|
- !ruby/object:Gem::Dependency
|
252
266
|
name: rspec
|
253
267
|
requirement: !ruby/object:Gem::Requirement
|
@@ -276,6 +290,34 @@ dependencies:
|
|
276
290
|
- - "~>"
|
277
291
|
- !ruby/object:Gem::Version
|
278
292
|
version: '0.0'
|
293
|
+
- !ruby/object:Gem::Dependency
|
294
|
+
name: rubocop
|
295
|
+
requirement: !ruby/object:Gem::Requirement
|
296
|
+
requirements:
|
297
|
+
- - "~>"
|
298
|
+
- !ruby/object:Gem::Version
|
299
|
+
version: '1.16'
|
300
|
+
type: :development
|
301
|
+
prerelease: false
|
302
|
+
version_requirements: !ruby/object:Gem::Requirement
|
303
|
+
requirements:
|
304
|
+
- - "~>"
|
305
|
+
- !ruby/object:Gem::Version
|
306
|
+
version: '1.16'
|
307
|
+
- !ruby/object:Gem::Dependency
|
308
|
+
name: rubocop-rspec
|
309
|
+
requirement: !ruby/object:Gem::Requirement
|
310
|
+
requirements:
|
311
|
+
- - "~>"
|
312
|
+
- !ruby/object:Gem::Version
|
313
|
+
version: '2.4'
|
314
|
+
type: :development
|
315
|
+
prerelease: false
|
316
|
+
version_requirements: !ruby/object:Gem::Requirement
|
317
|
+
requirements:
|
318
|
+
- - "~>"
|
319
|
+
- !ruby/object:Gem::Version
|
320
|
+
version: '2.4'
|
279
321
|
description: Provides a complete toolset to help DevOps maintain, deploy, monitor
|
280
322
|
and test multiple platforms using various technologies
|
281
323
|
email:
|
@@ -340,11 +382,13 @@ extra_rdoc_files:
|
|
340
382
|
- docs/executables/dump_nodes_json.md
|
341
383
|
- docs/plugins/platform_handler/serverless_chef.md
|
342
384
|
- docs/plugins/platform_handler/yaml_inventory.md
|
385
|
+
- docs/plugins/log/remote_fs.md
|
343
386
|
- docs/plugins/provisioner/proxmox.md
|
344
387
|
- docs/plugins/provisioner/podman.md
|
345
388
|
- docs/plugins/provisioner/docker.md
|
346
389
|
- docs/plugins/test/spectre.md
|
347
390
|
- docs/plugins/test/bitbucket_conf.md
|
391
|
+
- docs/plugins/test/github_ci.md
|
348
392
|
- docs/plugins/test/vulnerabilities.md
|
349
393
|
- docs/plugins/test/deploy_removes_root_access.md
|
350
394
|
- docs/plugins/test/private_ips.md
|
@@ -382,6 +426,8 @@ extra_rdoc_files:
|
|
382
426
|
- docs/plugins/action/remote_bash.md
|
383
427
|
- docs/plugins/action/ruby.md
|
384
428
|
- docs/plugins/action/bash.md
|
429
|
+
- docs/plugins/secrets_reader/cli.md
|
430
|
+
- docs/plugins/secrets_reader/thycotic.md
|
385
431
|
- docs/plugins/cmdb/host_ip.md
|
386
432
|
- docs/plugins/cmdb/config.md
|
387
433
|
- docs/plugins/cmdb/platform_handlers.md
|
@@ -518,6 +564,7 @@ files:
|
|
518
564
|
- docs/plugins/cmdb/platform_handlers.md
|
519
565
|
- docs/plugins/connector/local.md
|
520
566
|
- docs/plugins/connector/ssh.md
|
567
|
+
- docs/plugins/log/remote_fs.md
|
521
568
|
- docs/plugins/platform_handler/serverless_chef.md
|
522
569
|
- docs/plugins/platform_handler/yaml_inventory.md
|
523
570
|
- docs/plugins/provisioner/docker.md
|
@@ -526,6 +573,8 @@ files:
|
|
526
573
|
- docs/plugins/report/confluence.md
|
527
574
|
- docs/plugins/report/mediawiki.md
|
528
575
|
- docs/plugins/report/stdout.md
|
576
|
+
- docs/plugins/secrets_reader/cli.md
|
577
|
+
- docs/plugins/secrets_reader/thycotic.md
|
529
578
|
- docs/plugins/test/bitbucket_conf.md
|
530
579
|
- docs/plugins/test/can_be_checked.md
|
531
580
|
- docs/plugins/test/check_deploy_and_idempotence.md
|
@@ -538,6 +587,7 @@ files:
|
|
538
587
|
- docs/plugins/test/executables.md
|
539
588
|
- docs/plugins/test/file_system.md
|
540
589
|
- docs/plugins/test/file_system_hdfs.md
|
590
|
+
- docs/plugins/test/github_ci.md
|
541
591
|
- docs/plugins/test/hostname.md
|
542
592
|
- docs/plugins/test/idempotence.md
|
543
593
|
- docs/plugins/test/ip.md
|
@@ -640,10 +690,12 @@ files:
|
|
640
690
|
- lib/hybrid_platforms_conductor/common_config_dsl/bitbucket.rb
|
641
691
|
- lib/hybrid_platforms_conductor/common_config_dsl/confluence.rb
|
642
692
|
- lib/hybrid_platforms_conductor/common_config_dsl/file_system_tests.rb
|
693
|
+
- lib/hybrid_platforms_conductor/common_config_dsl/github.rb
|
643
694
|
- lib/hybrid_platforms_conductor/common_config_dsl/idempotence_tests.rb
|
644
695
|
- lib/hybrid_platforms_conductor/config.rb
|
645
696
|
- lib/hybrid_platforms_conductor/confluence.rb
|
646
697
|
- lib/hybrid_platforms_conductor/connector.rb
|
698
|
+
- lib/hybrid_platforms_conductor/core_extensions/symbol/zero.rb
|
647
699
|
- lib/hybrid_platforms_conductor/credentials.rb
|
648
700
|
- lib/hybrid_platforms_conductor/current_dir_monitor.rb
|
649
701
|
- lib/hybrid_platforms_conductor/deployer.rb
|
@@ -662,6 +714,8 @@ files:
|
|
662
714
|
- lib/hybrid_platforms_conductor/hpc_plugins/connector/local.rb
|
663
715
|
- lib/hybrid_platforms_conductor/hpc_plugins/connector/my_connector.rb.sample
|
664
716
|
- lib/hybrid_platforms_conductor/hpc_plugins/connector/ssh.rb
|
717
|
+
- lib/hybrid_platforms_conductor/hpc_plugins/log/my_log_plugin.rb.sample
|
718
|
+
- lib/hybrid_platforms_conductor/hpc_plugins/log/remote_fs.rb
|
665
719
|
- lib/hybrid_platforms_conductor/hpc_plugins/platform_handler/platform_handler_plugin.rb.sample
|
666
720
|
- lib/hybrid_platforms_conductor/hpc_plugins/platform_handler/serverless_chef.rb
|
667
721
|
- lib/hybrid_platforms_conductor/hpc_plugins/platform_handler/serverless_chef/dsl_parser.rb
|
@@ -678,6 +732,9 @@ files:
|
|
678
732
|
- lib/hybrid_platforms_conductor/hpc_plugins/report/my_report_plugin.rb.sample
|
679
733
|
- lib/hybrid_platforms_conductor/hpc_plugins/report/stdout.rb
|
680
734
|
- lib/hybrid_platforms_conductor/hpc_plugins/report/templates/confluence_inventory.html.erb
|
735
|
+
- lib/hybrid_platforms_conductor/hpc_plugins/secrets_reader/cli.rb
|
736
|
+
- lib/hybrid_platforms_conductor/hpc_plugins/secrets_reader/my_secrets_reader_plugin.rb.sample
|
737
|
+
- lib/hybrid_platforms_conductor/hpc_plugins/secrets_reader/thycotic.rb
|
681
738
|
- lib/hybrid_platforms_conductor/hpc_plugins/test/bitbucket_conf.rb
|
682
739
|
- lib/hybrid_platforms_conductor/hpc_plugins/test/can_be_checked.rb
|
683
740
|
- lib/hybrid_platforms_conductor/hpc_plugins/test/check_deploy_and_idempotence.rb
|
@@ -690,6 +747,7 @@ files:
|
|
690
747
|
- lib/hybrid_platforms_conductor/hpc_plugins/test/executables.rb
|
691
748
|
- lib/hybrid_platforms_conductor/hpc_plugins/test/file_system.rb
|
692
749
|
- lib/hybrid_platforms_conductor/hpc_plugins/test/file_system_hdfs.rb
|
750
|
+
- lib/hybrid_platforms_conductor/hpc_plugins/test/github_ci.rb
|
693
751
|
- lib/hybrid_platforms_conductor/hpc_plugins/test/hostname.rb
|
694
752
|
- lib/hybrid_platforms_conductor/hpc_plugins/test/idempotence.rb
|
695
753
|
- lib/hybrid_platforms_conductor/hpc_plugins/test/ip.rb
|
@@ -715,6 +773,7 @@ files:
|
|
715
773
|
- lib/hybrid_platforms_conductor/hpc_plugins/test_report/templates/confluence.html.erb
|
716
774
|
- lib/hybrid_platforms_conductor/io_router.rb
|
717
775
|
- lib/hybrid_platforms_conductor/json_dumper.rb
|
776
|
+
- lib/hybrid_platforms_conductor/log.rb
|
718
777
|
- lib/hybrid_platforms_conductor/logger_helpers.rb
|
719
778
|
- lib/hybrid_platforms_conductor/mutex_dir
|
720
779
|
- lib/hybrid_platforms_conductor/nodes_handler.rb
|
@@ -726,9 +785,11 @@ files:
|
|
726
785
|
- lib/hybrid_platforms_conductor/provisioner.rb
|
727
786
|
- lib/hybrid_platforms_conductor/report.rb
|
728
787
|
- lib/hybrid_platforms_conductor/reports_handler.rb
|
788
|
+
- lib/hybrid_platforms_conductor/secrets_reader.rb
|
729
789
|
- lib/hybrid_platforms_conductor/services_handler.rb
|
730
790
|
- lib/hybrid_platforms_conductor/test.rb
|
731
791
|
- lib/hybrid_platforms_conductor/test_by_service.rb
|
792
|
+
- lib/hybrid_platforms_conductor/test_only_remote_node.rb
|
732
793
|
- lib/hybrid_platforms_conductor/test_report.rb
|
733
794
|
- lib/hybrid_platforms_conductor/tests_runner.rb
|
734
795
|
- lib/hybrid_platforms_conductor/thycotic.rb
|
@@ -764,6 +825,7 @@ files:
|
|
764
825
|
- spec/hybrid_platforms_conductor_test/api/deployer/check_spec.rb
|
765
826
|
- spec/hybrid_platforms_conductor_test/api/deployer/config_dsl_spec.rb
|
766
827
|
- spec/hybrid_platforms_conductor_test/api/deployer/deploy_spec.rb
|
828
|
+
- spec/hybrid_platforms_conductor_test/api/deployer/log_plugins/remote_fs_spec.rb
|
767
829
|
- spec/hybrid_platforms_conductor_test/api/deployer/parse_deploy_output_spec.rb
|
768
830
|
- spec/hybrid_platforms_conductor_test/api/deployer/provisioner_spec.rb
|
769
831
|
- spec/hybrid_platforms_conductor_test/api/deployer/provisioners/docker/Dockerfile
|
@@ -784,6 +846,8 @@ files:
|
|
784
846
|
- spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/start_spec.rb
|
785
847
|
- spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/state_spec.rb
|
786
848
|
- spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/stop_spec.rb
|
849
|
+
- spec/hybrid_platforms_conductor_test/api/deployer/secrets_reader_plugins/cli_spec.rb
|
850
|
+
- spec/hybrid_platforms_conductor_test/api/deployer/secrets_reader_plugins/thycotic_spec.rb
|
787
851
|
- spec/hybrid_platforms_conductor_test/api/nodes_handler/cmdbs/config_spec.rb
|
788
852
|
- spec/hybrid_platforms_conductor_test/api/nodes_handler/cmdbs/host_ip_spec.rb
|
789
853
|
- spec/hybrid_platforms_conductor_test/api/nodes_handler/cmdbs/host_keys_spec.rb
|
@@ -819,13 +883,14 @@ files:
|
|
819
883
|
- spec/hybrid_platforms_conductor_test/api/tests_runner/platform_spec.rb
|
820
884
|
- spec/hybrid_platforms_conductor_test/api/tests_runner/reports_spec.rb
|
821
885
|
- spec/hybrid_platforms_conductor_test/api/tests_runner/test_plugins/bitbucket_conf_spec.rb
|
886
|
+
- spec/hybrid_platforms_conductor_test/api/tests_runner/test_plugins/github_ci_spec.rb
|
822
887
|
- spec/hybrid_platforms_conductor_test/api/tests_runner/test_reports_plugins/confluence_spec.rb
|
823
888
|
- spec/hybrid_platforms_conductor_test/cmdb_plugins/test_cmdb.rb
|
824
|
-
- spec/hybrid_platforms_conductor_test/cmdb_plugins/
|
889
|
+
- spec/hybrid_platforms_conductor_test/cmdb_plugins/test_cmdb_2.rb
|
825
890
|
- spec/hybrid_platforms_conductor_test/cmdb_plugins/test_cmdb_others.rb
|
826
|
-
- spec/hybrid_platforms_conductor_test/cmdb_plugins/
|
891
|
+
- spec/hybrid_platforms_conductor_test/cmdb_plugins/test_cmdb_others_2.rb
|
827
892
|
- spec/hybrid_platforms_conductor_test/docs_spec.rb
|
828
|
-
- spec/hybrid_platforms_conductor_test/executables/
|
893
|
+
- spec/hybrid_platforms_conductor_test/executables/check_node_spec.rb
|
829
894
|
- spec/hybrid_platforms_conductor_test/executables/deploy_spec.rb
|
830
895
|
- spec/hybrid_platforms_conductor_test/executables/get_impacted_nodes_spec.rb
|
831
896
|
- spec/hybrid_platforms_conductor_test/executables/last_deploys_spec.rb
|
@@ -848,7 +913,6 @@ files:
|
|
848
913
|
- spec/hybrid_platforms_conductor_test/helpers/config_helpers.rb
|
849
914
|
- spec/hybrid_platforms_conductor_test/helpers/connector_ssh_helpers.rb
|
850
915
|
- spec/hybrid_platforms_conductor_test/helpers/deployer_helpers.rb
|
851
|
-
- spec/hybrid_platforms_conductor_test/helpers/deployer_test_helpers.rb
|
852
916
|
- spec/hybrid_platforms_conductor_test/helpers/executables_helpers.rb
|
853
917
|
- spec/hybrid_platforms_conductor_test/helpers/nodes_handler_helpers.rb
|
854
918
|
- spec/hybrid_platforms_conductor_test/helpers/platform_handler_helpers.rb
|
@@ -859,13 +923,14 @@ files:
|
|
859
923
|
- spec/hybrid_platforms_conductor_test/helpers/serverless_chef_helpers.rb
|
860
924
|
- spec/hybrid_platforms_conductor_test/helpers/services_handler_helpers.rb
|
861
925
|
- spec/hybrid_platforms_conductor_test/helpers/tests_runner_helpers.rb
|
862
|
-
- spec/hybrid_platforms_conductor_test/mocked_lib/my_test_gem/hpc_plugins/test_plugin_type/
|
863
|
-
- spec/hybrid_platforms_conductor_test/mocked_lib/my_test_gem/hpc_plugins/test_plugin_type/
|
864
|
-
- spec/hybrid_platforms_conductor_test/mocked_lib/my_test_gem2/sub_dir/hpc_plugins/test_plugin_type/
|
865
|
-
- spec/hybrid_platforms_conductor_test/mocked_lib/my_test_gem2/sub_dir/hpc_plugins/
|
926
|
+
- spec/hybrid_platforms_conductor_test/mocked_lib/my_test_gem/hpc_plugins/test_plugin_type/test_plugin_id_1.rb
|
927
|
+
- spec/hybrid_platforms_conductor_test/mocked_lib/my_test_gem/hpc_plugins/test_plugin_type/test_plugin_id_2.rb
|
928
|
+
- spec/hybrid_platforms_conductor_test/mocked_lib/my_test_gem2/sub_dir/hpc_plugins/test_plugin_type/test_plugin_id_3.rb
|
929
|
+
- spec/hybrid_platforms_conductor_test/mocked_lib/my_test_gem2/sub_dir/hpc_plugins/test_plugin_type_2/test_plugin_id_4.rb
|
866
930
|
- spec/hybrid_platforms_conductor_test/platform_handler_plugins/test.rb
|
867
|
-
- spec/hybrid_platforms_conductor_test/platform_handler_plugins/
|
931
|
+
- spec/hybrid_platforms_conductor_test/platform_handler_plugins/test_2.rb
|
868
932
|
- spec/hybrid_platforms_conductor_test/report_plugin.rb
|
933
|
+
- spec/hybrid_platforms_conductor_test/rubocop_spec.rb
|
869
934
|
- spec/hybrid_platforms_conductor_test/serverless_chef_repositories/1_node/chef_versions.yml
|
870
935
|
- spec/hybrid_platforms_conductor_test/serverless_chef_repositories/1_node/nodes/node.json
|
871
936
|
- spec/hybrid_platforms_conductor_test/serverless_chef_repositories/1_node/policyfiles/test_policy.rb
|
@@ -903,8 +968,11 @@ files:
|
|
903
968
|
- spec/hybrid_platforms_conductor_test/serverless_chef_repositories/several_nodes/nodes/node2.json
|
904
969
|
- spec/hybrid_platforms_conductor_test/serverless_chef_repositories/several_nodes/policyfiles/test_policy_1.rb
|
905
970
|
- spec/hybrid_platforms_conductor_test/serverless_chef_repositories/several_nodes/policyfiles/test_policy_2.rb
|
971
|
+
- spec/hybrid_platforms_conductor_test/shared_examples/deployer.rb
|
906
972
|
- spec/hybrid_platforms_conductor_test/test_action.rb
|
907
973
|
- spec/hybrid_platforms_conductor_test/test_connector.rb
|
974
|
+
- spec/hybrid_platforms_conductor_test/test_log_no_read_plugin.rb
|
975
|
+
- spec/hybrid_platforms_conductor_test/test_log_plugin.rb
|
908
976
|
- spec/hybrid_platforms_conductor_test/test_plugins/global.rb
|
909
977
|
- spec/hybrid_platforms_conductor_test/test_plugins/node.rb
|
910
978
|
- spec/hybrid_platforms_conductor_test/test_plugins/node_check.rb
|
@@ -912,6 +980,7 @@ files:
|
|
912
980
|
- spec/hybrid_platforms_conductor_test/test_plugins/platform.rb
|
913
981
|
- spec/hybrid_platforms_conductor_test/test_plugins/several_checks.rb
|
914
982
|
- spec/hybrid_platforms_conductor_test/test_provisioner.rb
|
983
|
+
- spec/hybrid_platforms_conductor_test/test_secrets_reader_plugin.rb
|
915
984
|
- spec/hybrid_platforms_conductor_test/tests_report_plugin.rb
|
916
985
|
- spec/spec_helper.rb
|
917
986
|
- tools/check_md
|
@@ -926,9 +995,9 @@ require_paths:
|
|
926
995
|
- lib
|
927
996
|
required_ruby_version: !ruby/object:Gem::Requirement
|
928
997
|
requirements:
|
929
|
-
- - "
|
998
|
+
- - "~>"
|
930
999
|
- !ruby/object:Gem::Version
|
931
|
-
version: '
|
1000
|
+
version: '2.6'
|
932
1001
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
933
1002
|
requirements:
|
934
1003
|
- - ">="
|
@@ -1,916 +0,0 @@
|
|
1
|
-
require 'timeout'
|
2
|
-
|
3
|
-
module HybridPlatformsConductorTest
|
4
|
-
|
5
|
-
module Helpers
|
6
|
-
|
7
|
-
module DeployerTestHelpers
|
8
|
-
|
9
|
-
# Define deployment specs that are common for check mode and real deployment
|
10
|
-
#
|
11
|
-
# Parameters::
|
12
|
-
# * *check_mode* (Boolean): Are we in check-mode? [default: true]
|
13
|
-
def deploy_specs_for(check_mode: true)
|
14
|
-
expected_deploy_result = [0, "#{check_mode ? 'Check' : 'Deploy'} successful", '']
|
15
|
-
platform_name = check_mode ? 'platform' : 'my_remote_platform'
|
16
|
-
|
17
|
-
context "testing deployment#{check_mode ? ' in why-run mode' : ''}" do
|
18
|
-
|
19
|
-
# Get expected actions for a deployment
|
20
|
-
#
|
21
|
-
# Parameters::
|
22
|
-
# * *services* (Hash<String, Array<String> >): Expected nodes that should be deployed, with their corresponding services [default: { 'node' => %w[service] }]
|
23
|
-
# * *sudo* (String or nil): sudo supposed to be used, or nil if none [default: 'sudo -u root']
|
24
|
-
# * *check_mode* (Boolean): Are we testing in check mode? [default: @check_mode]
|
25
|
-
# * *mocked_deploy_result* (Hash or nil): Mocked result of the deployment actions, or nil to use the helper's default [default: nil]
|
26
|
-
# * *additional_expected_actions* (Array): Additional expected actions [default: []]
|
27
|
-
# * *expect_concurrent_actions* (Boolean): Are actions expected to be run in parallel? [default: false]
|
28
|
-
# * *expect_actions_timeout* (Integer or nil): Expected timeout in actions, or nil for none [default: nil]
|
29
|
-
def expected_actions_for_deploy_on(
|
30
|
-
services: { 'node' => %w[service] },
|
31
|
-
sudo: 'sudo -u root',
|
32
|
-
check_mode: @check_mode,
|
33
|
-
mocked_deploy_result: nil,
|
34
|
-
additional_expected_actions: [],
|
35
|
-
expect_concurrent_actions: false,
|
36
|
-
expect_actions_timeout: nil
|
37
|
-
)
|
38
|
-
actions = [
|
39
|
-
# First run, we expect the mutex to be setup, and the deployment actions to be run
|
40
|
-
proc do |actions_per_nodes, timeout: nil, concurrent: false, log_to_dir: 'run_logs', log_to_stdout: true|
|
41
|
-
expect(timeout).to eq expect_actions_timeout
|
42
|
-
expect(concurrent).to eq expect_concurrent_actions
|
43
|
-
expect(log_to_dir).to eq 'run_logs'
|
44
|
-
expect_actions_to_deploy_on(
|
45
|
-
actions_per_nodes,
|
46
|
-
services.keys,
|
47
|
-
check: check_mode,
|
48
|
-
sudo: sudo,
|
49
|
-
mocked_result: mocked_deploy_result,
|
50
|
-
expected_actions: additional_expected_actions
|
51
|
-
)
|
52
|
-
end,
|
53
|
-
# Second run, we expect the mutex to be released
|
54
|
-
proc { |actions_per_nodes| expect_actions_to_unlock(actions_per_nodes, services.keys, sudo: sudo) }
|
55
|
-
]
|
56
|
-
services.each do |node, node_services|
|
57
|
-
expect(test_services_handler).to receive(:actions_to_deploy_on).with(node, node_services, check_mode) do
|
58
|
-
[{ bash: "echo \"#{check_mode ? 'Checking' : 'Deploying'} on #{node}\"" }]
|
59
|
-
end
|
60
|
-
end
|
61
|
-
# Third run, we expect logs to be uploaded on the node (only if not check mode)
|
62
|
-
unless check_mode
|
63
|
-
services.each do |node, node_services|
|
64
|
-
expect(test_services_handler).to receive(:log_info_for).with(node, node_services) do
|
65
|
-
{
|
66
|
-
repo_name_0: 'platform',
|
67
|
-
commit_id_0: '123456',
|
68
|
-
commit_message_0: 'Test commit'
|
69
|
-
}
|
70
|
-
end
|
71
|
-
end
|
72
|
-
actions << proc { |actions_per_nodes| expect_actions_to_upload_logs(actions_per_nodes, services.keys, sudo: sudo) }
|
73
|
-
end
|
74
|
-
actions
|
75
|
-
end
|
76
|
-
|
77
|
-
# Prepare a platform ready to test deployments on.
|
78
|
-
#
|
79
|
-
# Parameters::
|
80
|
-
# * *nodes_info* (Hash): Node info to give the platform [default: 1 node having 1 service]
|
81
|
-
# * *expect_package* (Boolean): Should we expect packaging? [default: true]
|
82
|
-
# * *expect_prepare_for_deploy* (Boolean): Should we expect calls to prepare for deploy? [default: true]
|
83
|
-
# * *expect_connections_to_nodes* (Boolean): Should we expect connections to nodes? [default: true]
|
84
|
-
# * *expect_default_actions* (Boolean): Should we expect default actions? [default: true]
|
85
|
-
# * *expect_sudo* (String or nil): Expected sudo command, or nil if none [default: 'sudo -u root']
|
86
|
-
# * *expect_secrets* (Hash): Secrets to be expected during deployment [default: {}]
|
87
|
-
# * *expect_local_environment* (Boolean): Expected local environment flag [default: false]
|
88
|
-
# * *expect_additional_actions* (Array): Additional expected actions [default: []]
|
89
|
-
# * *expect_concurrent_actions* (Boolean): Are actions expected to be run in parallel? [default: false]
|
90
|
-
# * *expect_actions_timeout* (Integer or nil): Expected timeout in actions, or nil for none [default: nil]
|
91
|
-
# * *check_mode* (Boolean): Are we testing in check mode? [default: @check_mode]
|
92
|
-
# * *additional_config* (String): Additional configuration to set [default: '']
|
93
|
-
# * Proc: Code called once the platform is ready for testing the deployer
|
94
|
-
# * Parameters::
|
95
|
-
# * *repository* (String): Path to the repository
|
96
|
-
def with_platform_to_deploy(
|
97
|
-
nodes_info: { nodes: { 'node' => { services: %w[service] } } },
|
98
|
-
expect_package: true,
|
99
|
-
expect_prepare_for_deploy: true,
|
100
|
-
expect_connections_to_nodes: true,
|
101
|
-
expect_default_actions: true,
|
102
|
-
expect_sudo: 'sudo -u root',
|
103
|
-
expect_secrets: {},
|
104
|
-
expect_local_environment: false,
|
105
|
-
expect_additional_actions: [],
|
106
|
-
expect_concurrent_actions: false,
|
107
|
-
expect_actions_timeout: nil,
|
108
|
-
check_mode: @check_mode,
|
109
|
-
additional_config: ''
|
110
|
-
)
|
111
|
-
platform_name = check_mode ? 'platform' : 'my_remote_platform'
|
112
|
-
with_test_platform(nodes_info, !check_mode, additional_config) do |repository|
|
113
|
-
# Mock the ServicesHandler accesses
|
114
|
-
expect_services_to_deploy = Hash[nodes_info[:nodes].map do |node, node_info|
|
115
|
-
[node, node_info[:services]]
|
116
|
-
end]
|
117
|
-
unless check_mode
|
118
|
-
expect(test_services_handler).to receive(:deploy_allowed?).with(
|
119
|
-
services: expect_services_to_deploy,
|
120
|
-
secrets: expect_secrets,
|
121
|
-
local_environment: expect_local_environment
|
122
|
-
) do
|
123
|
-
nil
|
124
|
-
end
|
125
|
-
end
|
126
|
-
if expect_package
|
127
|
-
expect(test_services_handler).to receive(:package).with(
|
128
|
-
services: expect_services_to_deploy,
|
129
|
-
secrets: expect_secrets,
|
130
|
-
local_environment: expect_local_environment
|
131
|
-
)
|
132
|
-
else
|
133
|
-
expect(test_services_handler).not_to receive(:package)
|
134
|
-
end
|
135
|
-
if expect_prepare_for_deploy
|
136
|
-
expect(test_services_handler).to receive(:prepare_for_deploy).with(
|
137
|
-
services: expect_services_to_deploy,
|
138
|
-
secrets: expect_secrets,
|
139
|
-
local_environment: expect_local_environment,
|
140
|
-
why_run: check_mode
|
141
|
-
)
|
142
|
-
else
|
143
|
-
expect(test_services_handler).not_to receive(:prepare_for_deploy)
|
144
|
-
end
|
145
|
-
test_deployer.use_why_run = true if check_mode
|
146
|
-
if expect_connections_to_nodes
|
147
|
-
with_connections_mocked_on(nodes_info[:nodes].keys) do
|
148
|
-
expect_actions_executor_runs(expected_actions_for_deploy_on(
|
149
|
-
services: expect_services_to_deploy,
|
150
|
-
check_mode: check_mode,
|
151
|
-
sudo: expect_sudo,
|
152
|
-
additional_expected_actions: expect_additional_actions,
|
153
|
-
expect_concurrent_actions: expect_concurrent_actions,
|
154
|
-
expect_actions_timeout: expect_actions_timeout
|
155
|
-
)) if expect_default_actions
|
156
|
-
yield repository
|
157
|
-
end
|
158
|
-
else
|
159
|
-
yield repository
|
160
|
-
end
|
161
|
-
end
|
162
|
-
end
|
163
|
-
|
164
|
-
# Prepare a directory with certificates
|
165
|
-
#
|
166
|
-
# Parameters::
|
167
|
-
# * Proc: Code called with the directory created with a mocked certificate
|
168
|
-
# * Parameters::
|
169
|
-
# * *certs_dir* (String): Directory containing certificates
|
170
|
-
def with_certs_dir
|
171
|
-
with_repository do |repository|
|
172
|
-
certs_dir = "#{repository}/certificates"
|
173
|
-
FileUtils.mkdir_p certs_dir
|
174
|
-
File.write("#{certs_dir}/test_cert.crt", 'Hello')
|
175
|
-
yield certs_dir
|
176
|
-
end
|
177
|
-
end
|
178
|
-
|
179
|
-
before :each do
|
180
|
-
@check_mode = check_mode
|
181
|
-
end
|
182
|
-
|
183
|
-
it 'deploys on 1 node' do
|
184
|
-
with_platform_to_deploy do
|
185
|
-
expect(test_deployer.deploy_on('node')).to eq('node' => expected_deploy_result)
|
186
|
-
end
|
187
|
-
end
|
188
|
-
|
189
|
-
it 'deploys on 1 node having several services' do
|
190
|
-
with_platform_to_deploy(nodes_info: { nodes: { 'node' => { services: %w[service1 service2 service3] } } }) do
|
191
|
-
expect(test_deployer.deploy_on('node')).to eq('node' => expected_deploy_result)
|
192
|
-
end
|
193
|
-
end
|
194
|
-
|
195
|
-
it 'deploys on 1 node in a local environment' do
|
196
|
-
with_platform_to_deploy(expect_local_environment: true) do
|
197
|
-
test_deployer.local_environment = true
|
198
|
-
expect(test_deployer.deploy_on('node')).to eq('node' => expected_deploy_result)
|
199
|
-
expect(test_deployer.local_environment).to eq true
|
200
|
-
end
|
201
|
-
end
|
202
|
-
|
203
|
-
it 'deploys on 1 node using root' do
|
204
|
-
with_platform_to_deploy(expect_sudo: nil) do
|
205
|
-
test_actions_executor.connector(:ssh).ssh_user = 'root'
|
206
|
-
expect(test_deployer.deploy_on('node')).to eq('node' => expected_deploy_result)
|
207
|
-
end
|
208
|
-
end
|
209
|
-
|
210
|
-
it 'deploys on 1 node using an alternate sudo' do
|
211
|
-
with_platform_to_deploy(
|
212
|
-
expect_sudo: 'other_sudo --user root',
|
213
|
-
additional_config: 'sudo_for { |user| "other_sudo --user #{user}" }'
|
214
|
-
) do
|
215
|
-
expect(test_deployer.deploy_on('node')).to eq('node' => expected_deploy_result)
|
216
|
-
end
|
217
|
-
end
|
218
|
-
|
219
|
-
it 'deploys on 1 node using 1 secret' do
|
220
|
-
with_platform_to_deploy(expect_secrets: { 'secret1' => 'password1' }) do
|
221
|
-
test_deployer.secrets = [{ 'secret1' => 'password1' }]
|
222
|
-
expect(test_deployer.deploy_on('node')).to eq('node' => expected_deploy_result)
|
223
|
-
end
|
224
|
-
end
|
225
|
-
|
226
|
-
it 'deploys on 1 node using several secrets' do
|
227
|
-
with_platform_to_deploy(expect_secrets: { 'secret1' => 'password1', 'secret2' => 'password2' }) do
|
228
|
-
test_deployer.secrets = [{ 'secret1' => 'password1' }, { 'secret2' => 'password2' }]
|
229
|
-
expect(test_deployer.deploy_on('node')).to eq('node' => expected_deploy_result)
|
230
|
-
end
|
231
|
-
end
|
232
|
-
|
233
|
-
it 'deploys on 1 node in local environment with certificates to install using hpc_certificates on Debian' do
|
234
|
-
with_certs_dir do |certs_dir|
|
235
|
-
with_platform_to_deploy(
|
236
|
-
nodes_info: { nodes: { 'node' => { meta: { image: 'debian_9' }, services: %w[service] } } },
|
237
|
-
expect_local_environment: true,
|
238
|
-
expect_additional_actions: [
|
239
|
-
{ remote_bash: 'sudo -u root apt update && sudo -u root apt install -y ca-certificates' },
|
240
|
-
{
|
241
|
-
remote_bash: 'sudo -u root update-ca-certificates',
|
242
|
-
scp: {
|
243
|
-
certs_dir => '/usr/local/share/ca-certificates',
|
244
|
-
:sudo => true
|
245
|
-
}
|
246
|
-
}
|
247
|
-
]
|
248
|
-
) do
|
249
|
-
ENV['hpc_certificates'] = certs_dir
|
250
|
-
test_deployer.local_environment = true
|
251
|
-
expect(test_deployer.deploy_on('node')).to eq('node' => expected_deploy_result)
|
252
|
-
end
|
253
|
-
end
|
254
|
-
end
|
255
|
-
|
256
|
-
it 'deploys on 1 node in local environment with certificates to install using hpc_certificates on Debian and an alternate sudo' do
|
257
|
-
with_certs_dir do |certs_dir|
|
258
|
-
with_platform_to_deploy(
|
259
|
-
nodes_info: { nodes: { 'node' => { meta: { image: 'debian_9' }, services: %w[service] } } },
|
260
|
-
expect_sudo: 'other_sudo --user root',
|
261
|
-
expect_local_environment: true,
|
262
|
-
expect_additional_actions: [
|
263
|
-
{ remote_bash: 'other_sudo --user root apt update && other_sudo --user root apt install -y ca-certificates' },
|
264
|
-
{
|
265
|
-
remote_bash: 'other_sudo --user root update-ca-certificates',
|
266
|
-
scp: {
|
267
|
-
certs_dir => '/usr/local/share/ca-certificates',
|
268
|
-
:sudo => true
|
269
|
-
}
|
270
|
-
}
|
271
|
-
],
|
272
|
-
additional_config: 'sudo_for { |user| "other_sudo --user #{user}" }'
|
273
|
-
) do
|
274
|
-
ENV['hpc_certificates'] = certs_dir
|
275
|
-
test_deployer.local_environment = true
|
276
|
-
expect(test_deployer.deploy_on('node')).to eq('node' => expected_deploy_result)
|
277
|
-
end
|
278
|
-
end
|
279
|
-
end
|
280
|
-
|
281
|
-
it 'deploys on 1 node with certificates to install using hpc_certificates on Debian but ignores them in non-local environment' do
|
282
|
-
with_certs_dir do |certs_dir|
|
283
|
-
with_platform_to_deploy(nodes_info: { nodes: { 'node' => { meta: { image: 'debian_9' }, services: %w[service] } } }) do
|
284
|
-
ENV['hpc_certificates'] = certs_dir
|
285
|
-
expect(test_deployer.deploy_on('node')).to eq('node' => expected_deploy_result)
|
286
|
-
end
|
287
|
-
end
|
288
|
-
end
|
289
|
-
|
290
|
-
it 'deploys on 1 node with certificates to install using hpc_certificates on Debian using root' do
|
291
|
-
with_certs_dir do |certs_dir|
|
292
|
-
with_platform_to_deploy(
|
293
|
-
nodes_info: { nodes: { 'node' => { meta: { image: 'debian_9' }, services: %w[service] } } },
|
294
|
-
expect_sudo: nil,
|
295
|
-
expect_local_environment: true,
|
296
|
-
expect_additional_actions: [
|
297
|
-
{ remote_bash: 'apt update && apt install -y ca-certificates' },
|
298
|
-
{
|
299
|
-
remote_bash: 'update-ca-certificates',
|
300
|
-
scp: {
|
301
|
-
certs_dir => '/usr/local/share/ca-certificates',
|
302
|
-
:sudo => false
|
303
|
-
}
|
304
|
-
}
|
305
|
-
]
|
306
|
-
) do
|
307
|
-
ENV['hpc_certificates'] = certs_dir
|
308
|
-
test_actions_executor.connector(:ssh).ssh_user = 'root'
|
309
|
-
test_deployer.local_environment = true
|
310
|
-
expect(test_deployer.deploy_on('node')).to eq('node' => expected_deploy_result)
|
311
|
-
end
|
312
|
-
end
|
313
|
-
end
|
314
|
-
|
315
|
-
it 'deploys on 1 node with certificates to install using hpc_certificates on CentOS' do
|
316
|
-
with_certs_dir do |certs_dir|
|
317
|
-
with_platform_to_deploy(
|
318
|
-
nodes_info: { nodes: { 'node' => { meta: { image: 'centos_7' }, services: %w[service] } } },
|
319
|
-
expect_local_environment: true,
|
320
|
-
expect_additional_actions: [
|
321
|
-
{ remote_bash: 'sudo -u root yum install -y ca-certificates' },
|
322
|
-
{
|
323
|
-
remote_bash: ['sudo -u root update-ca-trust enable', 'sudo -u root update-ca-trust extract'],
|
324
|
-
scp: {
|
325
|
-
"#{certs_dir}/test_cert.crt" => '/etc/pki/ca-trust/source/anchors',
|
326
|
-
:sudo => true
|
327
|
-
}
|
328
|
-
}
|
329
|
-
]
|
330
|
-
) do
|
331
|
-
ENV['hpc_certificates'] = certs_dir
|
332
|
-
test_deployer.local_environment = true
|
333
|
-
expect(test_deployer.deploy_on('node')).to eq('node' => expected_deploy_result)
|
334
|
-
end
|
335
|
-
end
|
336
|
-
end
|
337
|
-
|
338
|
-
it 'deploys on 1 node with certificates to install using hpc_certificates on CentOS and an alternate sudo' do
|
339
|
-
with_certs_dir do |certs_dir|
|
340
|
-
with_platform_to_deploy(
|
341
|
-
nodes_info: { nodes: { 'node' => { meta: { image: 'centos_7' }, services: %w[service] } } },
|
342
|
-
expect_sudo: 'other_sudo --user root',
|
343
|
-
expect_local_environment: true,
|
344
|
-
expect_additional_actions: [
|
345
|
-
{ remote_bash: 'other_sudo --user root yum install -y ca-certificates' },
|
346
|
-
{
|
347
|
-
remote_bash: ['other_sudo --user root update-ca-trust enable', 'other_sudo --user root update-ca-trust extract'],
|
348
|
-
scp: {
|
349
|
-
"#{certs_dir}/test_cert.crt" => '/etc/pki/ca-trust/source/anchors',
|
350
|
-
:sudo => true
|
351
|
-
}
|
352
|
-
}
|
353
|
-
],
|
354
|
-
additional_config: 'sudo_for { |user| "other_sudo --user #{user}" }'
|
355
|
-
) do
|
356
|
-
ENV['hpc_certificates'] = certs_dir
|
357
|
-
test_deployer.local_environment = true
|
358
|
-
expect(test_deployer.deploy_on('node')).to eq('node' => expected_deploy_result)
|
359
|
-
end
|
360
|
-
end
|
361
|
-
end
|
362
|
-
|
363
|
-
it 'deploys on 1 node with certificates to install using hpc_certificates on CentOS using root' do
|
364
|
-
with_certs_dir do |certs_dir|
|
365
|
-
with_platform_to_deploy(
|
366
|
-
nodes_info: { nodes: { 'node' => { meta: { image: 'centos_7' }, services: %w[service] } } },
|
367
|
-
expect_sudo: nil,
|
368
|
-
expect_local_environment: true,
|
369
|
-
expect_additional_actions: [
|
370
|
-
{ remote_bash: 'yum install -y ca-certificates' },
|
371
|
-
{
|
372
|
-
remote_bash: ['update-ca-trust enable', 'update-ca-trust extract'],
|
373
|
-
scp: {
|
374
|
-
"#{certs_dir}/test_cert.crt" => '/etc/pki/ca-trust/source/anchors',
|
375
|
-
:sudo => false
|
376
|
-
}
|
377
|
-
}
|
378
|
-
]
|
379
|
-
) do
|
380
|
-
ENV['hpc_certificates'] = certs_dir
|
381
|
-
test_actions_executor.connector(:ssh).ssh_user = 'root'
|
382
|
-
test_deployer.local_environment = true
|
383
|
-
expect(test_deployer.deploy_on('node')).to eq('node' => expected_deploy_result)
|
384
|
-
end
|
385
|
-
end
|
386
|
-
end
|
387
|
-
|
388
|
-
it 'deploys on several nodes' do
|
389
|
-
with_platform_to_deploy(nodes_info: { nodes: {
|
390
|
-
'node1' => { services: %w[service1] },
|
391
|
-
'node2' => { services: %w[service2] },
|
392
|
-
'node3' => { services: %w[service3] }
|
393
|
-
} }) do
|
394
|
-
expect(test_deployer.deploy_on(%w[node1 node2 node3])).to eq(
|
395
|
-
'node1' => expected_deploy_result,
|
396
|
-
'node2' => expected_deploy_result,
|
397
|
-
'node3' => expected_deploy_result
|
398
|
-
)
|
399
|
-
end
|
400
|
-
end
|
401
|
-
|
402
|
-
it 'deploys on several nodes in parallel' do
|
403
|
-
with_platform_to_deploy(
|
404
|
-
nodes_info: {
|
405
|
-
nodes: {
|
406
|
-
'node1' => { services: %w[service1] },
|
407
|
-
'node2' => { services: %w[service2] },
|
408
|
-
'node3' => { services: %w[service3] }
|
409
|
-
}
|
410
|
-
},
|
411
|
-
expect_concurrent_actions: true
|
412
|
-
) do
|
413
|
-
test_deployer.concurrent_execution = true
|
414
|
-
expect(test_deployer.deploy_on(%w[node1 node2 node3])).to eq(
|
415
|
-
'node1' => expected_deploy_result,
|
416
|
-
'node2' => expected_deploy_result,
|
417
|
-
'node3' => expected_deploy_result
|
418
|
-
)
|
419
|
-
end
|
420
|
-
end
|
421
|
-
|
422
|
-
it 'deploys on several nodes with timeout' do
|
423
|
-
with_platform_to_deploy(
|
424
|
-
nodes_info: {
|
425
|
-
nodes: {
|
426
|
-
'node1' => { services: %w[service1] },
|
427
|
-
'node2' => { services: %w[service2] },
|
428
|
-
'node3' => { services: %w[service3] }
|
429
|
-
}
|
430
|
-
},
|
431
|
-
expect_actions_timeout: 5
|
432
|
-
) do
|
433
|
-
test_deployer.timeout = 5
|
434
|
-
expect(test_deployer.deploy_on(%w[node1 node2 node3])).to eq(
|
435
|
-
'node1' => expected_deploy_result,
|
436
|
-
'node2' => expected_deploy_result,
|
437
|
-
'node3' => expected_deploy_result
|
438
|
-
)
|
439
|
-
end
|
440
|
-
end
|
441
|
-
|
442
|
-
it 'fails when packaging timeout has been reached while taking the futex' do
|
443
|
-
with_platform_to_deploy(
|
444
|
-
additional_config: 'packaging_timeout 1',
|
445
|
-
expect_package: false,
|
446
|
-
expect_prepare_for_deploy: false,
|
447
|
-
expect_connections_to_nodes: false
|
448
|
-
) do
|
449
|
-
# Simulate another process taking the packaging futex
|
450
|
-
futex_file = HybridPlatformsConductor::Deployer.const_get(:PACKAGING_FUTEX_FILE)
|
451
|
-
Futex.new(futex_file).open do
|
452
|
-
# Expect the error to be raised within 2 seconds (as it should timeout after 1 second)
|
453
|
-
begin
|
454
|
-
Timeout::timeout(2) {
|
455
|
-
expect { test_deployer.deploy_on('node') }.to raise_error(
|
456
|
-
Futex::CantLock,
|
457
|
-
/can't get exclusive access to the file #{Regexp.escape(futex_file)} because of the lock at #{Regexp.escape(futex_file)}\.lock, after 1\.\d+s of waiting/
|
458
|
-
)
|
459
|
-
}
|
460
|
-
rescue Timeout::Error
|
461
|
-
raise 'The packaging timeout (set to 1 seconds) did not fire within 2 seconds. Looks like it is not working properly.'
|
462
|
-
end
|
463
|
-
end
|
464
|
-
end
|
465
|
-
end
|
466
|
-
|
467
|
-
context 'checking deployment retries' do
|
468
|
-
|
469
|
-
# Prepare a platform ready to test deployments' retries on.
|
470
|
-
#
|
471
|
-
# Parameters::
|
472
|
-
# * *nodes_info* (Hash): Node info to give the platform [default: { nodes: { 'node' => {} } }]
|
473
|
-
# * Proc: Code called once the platform is ready for testing the deployer
|
474
|
-
# * Parameters::
|
475
|
-
# * *repository* (String): Path to the repository
|
476
|
-
def with_platform_to_retry_deploy(nodes_info: { nodes: { 'node' => { services: %w[service] } } })
|
477
|
-
with_platform_to_deploy(
|
478
|
-
nodes_info: nodes_info,
|
479
|
-
expect_default_actions: false,
|
480
|
-
additional_config: "
|
481
|
-
for_nodes([#{nodes_info[:nodes].keys.map { |node| "'#{node}'" }.join(', ')}]) do
|
482
|
-
retry_deploy_for_errors_on_stdout [
|
483
|
-
'stdout non-deterministic error'
|
484
|
-
]
|
485
|
-
retry_deploy_for_errors_on_stderr [
|
486
|
-
'stderr non-deterministic error',
|
487
|
-
/stderr regexp error \\d+/
|
488
|
-
]
|
489
|
-
end
|
490
|
-
for_nodes([#{nodes_info[:nodes].keys.map { |node| "'#{node}'" }.join(', ')}]) do
|
491
|
-
retry_deploy_for_errors_on_stdout [
|
492
|
-
/stdout regexp error \\d+/
|
493
|
-
]
|
494
|
-
end
|
495
|
-
"
|
496
|
-
) do |repository|
|
497
|
-
yield repository
|
498
|
-
end
|
499
|
-
end
|
500
|
-
|
501
|
-
# Mock a sequential list of deployments
|
502
|
-
#
|
503
|
-
# Parameters::
|
504
|
-
# * *statuses* (Array<Hash<String,Status> or Status>)>): List of mocked deployment statuses per node name, or just the status for the default node.
|
505
|
-
# A status is a triplet [Integer or Symbol, String, String]: exit status, stdout and stderr.
|
506
|
-
def mock_deploys_with(statuses)
|
507
|
-
expect_actions_executor_runs(statuses.map do |status|
|
508
|
-
status = { 'node' => status } if status.is_a?(Array)
|
509
|
-
expected_actions_for_deploy_on(
|
510
|
-
services: Hash[status.keys.map { |node| [node, %w[service]] }],
|
511
|
-
mocked_deploy_result: status
|
512
|
-
)
|
513
|
-
end.flatten)
|
514
|
-
end
|
515
|
-
|
516
|
-
it 'restarts deployment for a non-deterministic error' do
|
517
|
-
with_platform_to_retry_deploy do
|
518
|
-
test_deployer.nbr_retries_on_error = 1
|
519
|
-
mock_deploys_with [
|
520
|
-
[1, "Error: This is a stdout non-deterministic error\nDeploy failed\n", ''],
|
521
|
-
[0, 'Deploy ok', '']
|
522
|
-
]
|
523
|
-
expect(test_deployer.deploy_on('node')).to eq('node' => [
|
524
|
-
0,
|
525
|
-
<<~EOS,
|
526
|
-
Error: This is a stdout non-deterministic error
|
527
|
-
Deploy failed
|
528
|
-
|
529
|
-
Deployment exit status code: 1
|
530
|
-
!!! Retry deployment due to non-deterministic error (0 remaining attempts)...
|
531
|
-
Deploy ok
|
532
|
-
EOS
|
533
|
-
<<~EOS
|
534
|
-
!!! 1 retriable errors detected in this deployment:
|
535
|
-
* stdout non-deterministic error
|
536
|
-
|
537
|
-
!!! Retry deployment due to non-deterministic error (0 remaining attempts)...
|
538
|
-
|
539
|
-
EOS
|
540
|
-
])
|
541
|
-
end
|
542
|
-
end
|
543
|
-
|
544
|
-
it 'restarts deployment for a non-deterministic error matched with a Regexp' do
|
545
|
-
with_platform_to_retry_deploy do
|
546
|
-
test_deployer.nbr_retries_on_error = 1
|
547
|
-
mock_deploys_with [
|
548
|
-
[1, "Error: This is a stdout regexp error 42\nDeploy failed\n", ''],
|
549
|
-
[0, 'Deploy ok', '']
|
550
|
-
]
|
551
|
-
expect(test_deployer.deploy_on('node')).to eq('node' => [
|
552
|
-
0,
|
553
|
-
<<~EOS,
|
554
|
-
Error: This is a stdout regexp error 42
|
555
|
-
Deploy failed
|
556
|
-
|
557
|
-
Deployment exit status code: 1
|
558
|
-
!!! Retry deployment due to non-deterministic error (0 remaining attempts)...
|
559
|
-
Deploy ok
|
560
|
-
EOS
|
561
|
-
<<~EOS
|
562
|
-
!!! 1 retriable errors detected in this deployment:
|
563
|
-
* /stdout regexp error \\d+/ matched 'stdout regexp error 42'
|
564
|
-
|
565
|
-
!!! Retry deployment due to non-deterministic error (0 remaining attempts)...
|
566
|
-
|
567
|
-
EOS
|
568
|
-
])
|
569
|
-
end
|
570
|
-
end
|
571
|
-
|
572
|
-
it 'restarts deployment for a non-deterministic error on stderr' do
|
573
|
-
with_platform_to_retry_deploy do
|
574
|
-
test_deployer.nbr_retries_on_error = 1
|
575
|
-
mock_deploys_with [
|
576
|
-
[1, '', "Error: This is a stderr non-deterministic error\nDeploy failed\n"],
|
577
|
-
[0, 'Deploy ok', '']
|
578
|
-
]
|
579
|
-
expect(test_deployer.deploy_on('node')).to eq('node' => [
|
580
|
-
0,
|
581
|
-
<<~EOS,
|
582
|
-
|
583
|
-
Deployment exit status code: 1
|
584
|
-
!!! Retry deployment due to non-deterministic error (0 remaining attempts)...
|
585
|
-
Deploy ok
|
586
|
-
EOS
|
587
|
-
<<~EOS
|
588
|
-
Error: This is a stderr non-deterministic error
|
589
|
-
Deploy failed
|
590
|
-
!!! 1 retriable errors detected in this deployment:
|
591
|
-
* stderr non-deterministic error
|
592
|
-
|
593
|
-
!!! Retry deployment due to non-deterministic error (0 remaining attempts)...
|
594
|
-
|
595
|
-
EOS
|
596
|
-
])
|
597
|
-
end
|
598
|
-
end
|
599
|
-
|
600
|
-
it 'restarts deployment for a non-deterministic error on stderr matched with a Regexp' do
|
601
|
-
with_platform_to_retry_deploy do
|
602
|
-
test_deployer.nbr_retries_on_error = 1
|
603
|
-
mock_deploys_with [
|
604
|
-
[1, '', "Error: This is a stderr regexp error 42\nDeploy failed\n"],
|
605
|
-
[0, 'Deploy ok', '']
|
606
|
-
]
|
607
|
-
expect(test_deployer.deploy_on('node')).to eq('node' => [
|
608
|
-
0,
|
609
|
-
<<~EOS,
|
610
|
-
|
611
|
-
Deployment exit status code: 1
|
612
|
-
!!! Retry deployment due to non-deterministic error (0 remaining attempts)...
|
613
|
-
Deploy ok
|
614
|
-
EOS
|
615
|
-
<<~EOS
|
616
|
-
Error: This is a stderr regexp error 42
|
617
|
-
Deploy failed
|
618
|
-
!!! 1 retriable errors detected in this deployment:
|
619
|
-
* /stderr regexp error \\d+/ matched 'stderr regexp error 42'
|
620
|
-
|
621
|
-
!!! Retry deployment due to non-deterministic error (0 remaining attempts)...
|
622
|
-
|
623
|
-
EOS
|
624
|
-
])
|
625
|
-
end
|
626
|
-
end
|
627
|
-
|
628
|
-
it 'stops restarting deployments for a non-deterministic error when errors has disappeared, even if retries were remaining' do
|
629
|
-
with_platform_to_retry_deploy do
|
630
|
-
test_deployer.nbr_retries_on_error = 5
|
631
|
-
mock_deploys_with [
|
632
|
-
[1, "Error: This is a stdout non-deterministic error 1\nDeploy failed", ''],
|
633
|
-
[1, "Error: This is a stdout non-deterministic error 2\nDeploy failed", ''],
|
634
|
-
[0, 'Deploy ok', '']
|
635
|
-
]
|
636
|
-
expect(test_deployer.deploy_on('node')).to eq('node' => [
|
637
|
-
0,
|
638
|
-
<<~EOS,
|
639
|
-
Error: This is a stdout non-deterministic error 1
|
640
|
-
Deploy failed
|
641
|
-
Deployment exit status code: 1
|
642
|
-
!!! Retry deployment due to non-deterministic error (4 remaining attempts)...
|
643
|
-
Error: This is a stdout non-deterministic error 2
|
644
|
-
Deploy failed
|
645
|
-
|
646
|
-
Deployment exit status code: 1
|
647
|
-
!!! Retry deployment due to non-deterministic error (3 remaining attempts)...
|
648
|
-
Deploy ok
|
649
|
-
EOS
|
650
|
-
<<~EOS
|
651
|
-
!!! 1 retriable errors detected in this deployment:
|
652
|
-
* stdout non-deterministic error
|
653
|
-
|
654
|
-
!!! Retry deployment due to non-deterministic error (4 remaining attempts)...
|
655
|
-
!!! 1 retriable errors detected in this deployment:
|
656
|
-
* stdout non-deterministic error
|
657
|
-
|
658
|
-
|
659
|
-
!!! Retry deployment due to non-deterministic error (3 remaining attempts)...
|
660
|
-
|
661
|
-
EOS
|
662
|
-
])
|
663
|
-
end
|
664
|
-
end
|
665
|
-
|
666
|
-
it 'stops restarting deployments for a non-deterministic error that became deterministic, even if retries were remaining' do
|
667
|
-
with_platform_to_retry_deploy do
|
668
|
-
test_deployer.nbr_retries_on_error = 5
|
669
|
-
mock_deploys_with [
|
670
|
-
[1, "Error: This is a stdout non-deterministic error 1\nDeploy failed", ''],
|
671
|
-
[1, "Error: This is a stdout non-deterministic error 2\nDeploy failed", ''],
|
672
|
-
[1, "Error: This is a stdout deterministic error 3\nDeploy failed", '']
|
673
|
-
]
|
674
|
-
expect(test_deployer.deploy_on('node')).to eq('node' => [
|
675
|
-
1,
|
676
|
-
<<~EOS,
|
677
|
-
Error: This is a stdout non-deterministic error 1
|
678
|
-
Deploy failed
|
679
|
-
Deployment exit status code: 1
|
680
|
-
!!! Retry deployment due to non-deterministic error (4 remaining attempts)...
|
681
|
-
Error: This is a stdout non-deterministic error 2
|
682
|
-
Deploy failed
|
683
|
-
|
684
|
-
Deployment exit status code: 1
|
685
|
-
!!! Retry deployment due to non-deterministic error (3 remaining attempts)...
|
686
|
-
Error: This is a stdout deterministic error 3
|
687
|
-
Deploy failed
|
688
|
-
EOS
|
689
|
-
<<~EOS
|
690
|
-
!!! 1 retriable errors detected in this deployment:
|
691
|
-
* stdout non-deterministic error
|
692
|
-
|
693
|
-
!!! Retry deployment due to non-deterministic error (4 remaining attempts)...
|
694
|
-
!!! 1 retriable errors detected in this deployment:
|
695
|
-
* stdout non-deterministic error
|
696
|
-
|
697
|
-
|
698
|
-
!!! Retry deployment due to non-deterministic error (3 remaining attempts)...
|
699
|
-
|
700
|
-
EOS
|
701
|
-
])
|
702
|
-
end
|
703
|
-
end
|
704
|
-
|
705
|
-
it 'does not restart deployment for a deterministic error' do
|
706
|
-
with_platform_to_retry_deploy do
|
707
|
-
test_deployer.nbr_retries_on_error = 5
|
708
|
-
mock_deploys_with [
|
709
|
-
[1, "Error: This is a stdout deterministic error\nDeploy failed\n", '']
|
710
|
-
]
|
711
|
-
expect(test_deployer.deploy_on('node')).to eq('node' => [
|
712
|
-
1,
|
713
|
-
<<~EOS,
|
714
|
-
Error: This is a stdout deterministic error
|
715
|
-
Deploy failed
|
716
|
-
EOS
|
717
|
-
''
|
718
|
-
])
|
719
|
-
end
|
720
|
-
end
|
721
|
-
|
722
|
-
it 'does not restart deployment for a non-deterministic error logged during a successful deploy' do
|
723
|
-
with_platform_to_retry_deploy do
|
724
|
-
test_deployer.nbr_retries_on_error = 5
|
725
|
-
mock_deploys_with [
|
726
|
-
[0, "Error: This is a stdout non-deterministic error\nDeploy failed\n", '']
|
727
|
-
]
|
728
|
-
expect(test_deployer.deploy_on('node')).to eq('node' => [
|
729
|
-
0,
|
730
|
-
<<~EOS,
|
731
|
-
Error: This is a stdout non-deterministic error
|
732
|
-
Deploy failed
|
733
|
-
EOS
|
734
|
-
''
|
735
|
-
])
|
736
|
-
end
|
737
|
-
end
|
738
|
-
|
739
|
-
it 'does not restart deployment for a non-deterministic error if retries are 0' do
|
740
|
-
with_platform_to_retry_deploy do
|
741
|
-
test_deployer.nbr_retries_on_error = 0
|
742
|
-
mock_deploys_with [
|
743
|
-
[1, "Error: This is a stdout non-deterministic error\nDeploy failed\n", '']
|
744
|
-
]
|
745
|
-
expect(test_deployer.deploy_on('node')).to eq('node' => [
|
746
|
-
1,
|
747
|
-
<<~EOS,
|
748
|
-
Error: This is a stdout non-deterministic error
|
749
|
-
Deploy failed
|
750
|
-
EOS
|
751
|
-
''
|
752
|
-
])
|
753
|
-
end
|
754
|
-
end
|
755
|
-
|
756
|
-
it 'restarts deployment for non-deterministic errors with a limited amount of retries' do
|
757
|
-
with_platform_to_retry_deploy do
|
758
|
-
test_deployer.nbr_retries_on_error = 2
|
759
|
-
mock_deploys_with [
|
760
|
-
[1, "Error: This is a stdout non-deterministic error 1\nDeploy failed", ''],
|
761
|
-
[1, "Error: This is a stdout non-deterministic error 2\nDeploy failed", ''],
|
762
|
-
[1, "Error: This is a stdout non-deterministic error 3\nDeploy failed", '']
|
763
|
-
]
|
764
|
-
expect(test_deployer.deploy_on('node')).to eq('node' => [
|
765
|
-
1,
|
766
|
-
<<~EOS,
|
767
|
-
Error: This is a stdout non-deterministic error 1
|
768
|
-
Deploy failed
|
769
|
-
Deployment exit status code: 1
|
770
|
-
!!! Retry deployment due to non-deterministic error (1 remaining attempts)...
|
771
|
-
Error: This is a stdout non-deterministic error 2
|
772
|
-
Deploy failed
|
773
|
-
|
774
|
-
Deployment exit status code: 1
|
775
|
-
!!! Retry deployment due to non-deterministic error (0 remaining attempts)...
|
776
|
-
Error: This is a stdout non-deterministic error 3
|
777
|
-
Deploy failed
|
778
|
-
EOS
|
779
|
-
<<~EOS
|
780
|
-
!!! 1 retriable errors detected in this deployment:
|
781
|
-
* stdout non-deterministic error
|
782
|
-
|
783
|
-
!!! Retry deployment due to non-deterministic error (1 remaining attempts)...
|
784
|
-
!!! 1 retriable errors detected in this deployment:
|
785
|
-
* stdout non-deterministic error
|
786
|
-
|
787
|
-
|
788
|
-
!!! Retry deployment due to non-deterministic error (0 remaining attempts)...
|
789
|
-
|
790
|
-
EOS
|
791
|
-
])
|
792
|
-
end
|
793
|
-
end
|
794
|
-
|
795
|
-
it 'restarts deployment for non-deterministic errors only on nodes needing it' do
|
796
|
-
with_platform_to_retry_deploy(nodes_info: { nodes: {
|
797
|
-
'node1' => { services: %w[service] },
|
798
|
-
'node2' => { services: %w[service] },
|
799
|
-
'node3' => { services: %w[service] },
|
800
|
-
'node4' => { services: %w[service] }
|
801
|
-
} }) do
|
802
|
-
test_deployer.nbr_retries_on_error = 2
|
803
|
-
# Some nodes deploy successfully,
|
804
|
-
# others have deterministic errors,
|
805
|
-
# others have non-deterministic errors being corrected
|
806
|
-
# others have non-deterministic errors not being corrected
|
807
|
-
mock_deploys_with [
|
808
|
-
{
|
809
|
-
'node1' => [1, "Error: This is a stdout non-deterministic error\n[node1] Deploy failed\n", ''],
|
810
|
-
'node2' => [0, '[node2] Deploy ok', ''],
|
811
|
-
'node3' => [1, "Error: This is a stdout non-deterministic error\n[node3] Deploy failed\n", ''],
|
812
|
-
'node4' => [1, "Error: This is a stdout non-deterministic error\n[node4] Deploy failed\n", '']
|
813
|
-
},
|
814
|
-
{
|
815
|
-
'node1' => [0, '[node1] Deploy ok', ''],
|
816
|
-
'node3' => [1, "Error: This is a stdout deterministic error\n[node3] Deploy failed\n", ''],
|
817
|
-
'node4' => [1, "Error: This is a stdout non-deterministic error\n[node4] Deploy failed\n", '']
|
818
|
-
},
|
819
|
-
{
|
820
|
-
'node4' => [1, "Error: This is a stdout non-deterministic error\n[node4] Deploy failed\n", '']
|
821
|
-
}
|
822
|
-
]
|
823
|
-
expect(test_deployer.deploy_on(%w[node1 node2 node3 node4])).to eq(
|
824
|
-
'node1' => [
|
825
|
-
0,
|
826
|
-
<<~EOS,
|
827
|
-
Error: This is a stdout non-deterministic error
|
828
|
-
[node1] Deploy failed
|
829
|
-
|
830
|
-
Deployment exit status code: 1
|
831
|
-
!!! Retry deployment due to non-deterministic error (1 remaining attempts)...
|
832
|
-
[node1] Deploy ok
|
833
|
-
EOS
|
834
|
-
<<~EOS
|
835
|
-
!!! 1 retriable errors detected in this deployment:
|
836
|
-
* stdout non-deterministic error
|
837
|
-
|
838
|
-
!!! Retry deployment due to non-deterministic error (1 remaining attempts)...
|
839
|
-
|
840
|
-
EOS
|
841
|
-
],
|
842
|
-
'node2' => [
|
843
|
-
0,
|
844
|
-
'[node2] Deploy ok',
|
845
|
-
''
|
846
|
-
],
|
847
|
-
'node3' => [
|
848
|
-
1,
|
849
|
-
<<~EOS,
|
850
|
-
Error: This is a stdout non-deterministic error
|
851
|
-
[node3] Deploy failed
|
852
|
-
|
853
|
-
Deployment exit status code: 1
|
854
|
-
!!! Retry deployment due to non-deterministic error (1 remaining attempts)...
|
855
|
-
Error: This is a stdout deterministic error
|
856
|
-
[node3] Deploy failed
|
857
|
-
|
858
|
-
EOS
|
859
|
-
<<~EOS
|
860
|
-
!!! 1 retriable errors detected in this deployment:
|
861
|
-
* stdout non-deterministic error
|
862
|
-
|
863
|
-
!!! Retry deployment due to non-deterministic error (1 remaining attempts)...
|
864
|
-
|
865
|
-
EOS
|
866
|
-
],
|
867
|
-
'node4' => [
|
868
|
-
1,
|
869
|
-
<<~EOS,
|
870
|
-
Error: This is a stdout non-deterministic error
|
871
|
-
[node4] Deploy failed
|
872
|
-
|
873
|
-
Deployment exit status code: 1
|
874
|
-
!!! Retry deployment due to non-deterministic error (1 remaining attempts)...
|
875
|
-
Error: This is a stdout non-deterministic error
|
876
|
-
[node4] Deploy failed
|
877
|
-
|
878
|
-
|
879
|
-
Deployment exit status code: 1
|
880
|
-
!!! Retry deployment due to non-deterministic error (0 remaining attempts)...
|
881
|
-
Error: This is a stdout non-deterministic error
|
882
|
-
[node4] Deploy failed
|
883
|
-
|
884
|
-
EOS
|
885
|
-
<<~EOS
|
886
|
-
!!! 1 retriable errors detected in this deployment:
|
887
|
-
* stdout non-deterministic error
|
888
|
-
|
889
|
-
!!! Retry deployment due to non-deterministic error (1 remaining attempts)...
|
890
|
-
!!! 1 retriable errors detected in this deployment:
|
891
|
-
* stdout non-deterministic error
|
892
|
-
|
893
|
-
|
894
|
-
!!! Retry deployment due to non-deterministic error (0 remaining attempts)...
|
895
|
-
|
896
|
-
EOS
|
897
|
-
]
|
898
|
-
)
|
899
|
-
end
|
900
|
-
end
|
901
|
-
|
902
|
-
end
|
903
|
-
|
904
|
-
end
|
905
|
-
|
906
|
-
end
|
907
|
-
|
908
|
-
end
|
909
|
-
|
910
|
-
end
|
911
|
-
|
912
|
-
end
|
913
|
-
|
914
|
-
RSpec.configure do |c|
|
915
|
-
c.extend HybridPlatformsConductorTest::Helpers::DeployerTestHelpers
|
916
|
-
end
|