hybrid_platforms_conductor 32.17.0 → 33.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +36 -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 +46 -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/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/hostname.md +1 -0
- data/docs/plugins/test/ip.md +1 -0
- 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 +4 -3
- data/lib/hybrid_platforms_conductor/common_config_dsl/idempotence_tests.rb +2 -2
- data/lib/hybrid_platforms_conductor/config.rb +8 -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/cleanroom/fix_kwargs.rb +116 -0
- 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 +2 -3
- 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 +18 -11
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/actions/interactive_spec.rb +2 -2
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/actions/remote_bash_spec.rb +32 -21
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/actions/ruby_spec.rb +75 -49
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/actions/scp_spec.rb +27 -15
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/actions_spec.rb +90 -59
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/connection_spec.rb +46 -44
- 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 +106 -75
- 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 +167 -142
- 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 +16 -16
- 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 +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 +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 +195 -144
- data/spec/hybrid_platforms_conductor_test/helpers/deployer_test_helpers.rb +0 -916
|
@@ -1,8 +1,25 @@
|
|
|
1
|
+
# Specific test registered by the test platform handler
|
|
2
|
+
class SpecificPlatformHandlerTest < HybridPlatformsConductor::Test
|
|
3
|
+
|
|
4
|
+
class << self
|
|
5
|
+
|
|
6
|
+
attr_accessor :run
|
|
7
|
+
|
|
8
|
+
end
|
|
9
|
+
@run = false
|
|
10
|
+
|
|
11
|
+
def test
|
|
12
|
+
SpecificPlatformHandlerTest.run = true
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
end
|
|
16
|
+
|
|
1
17
|
describe HybridPlatformsConductor::TestsRunner do
|
|
2
18
|
|
|
3
19
|
it 'executes all tests when no test is selected' do
|
|
4
|
-
with_test_platform do
|
|
5
|
-
register_test_plugins(
|
|
20
|
+
with_test_platform({}) do
|
|
21
|
+
register_test_plugins(
|
|
22
|
+
test_tests_runner,
|
|
6
23
|
global_test: HybridPlatformsConductorTest::TestPlugins::Global,
|
|
7
24
|
global_test_2: HybridPlatformsConductorTest::TestPlugins::Global
|
|
8
25
|
)
|
|
@@ -12,8 +29,9 @@ describe HybridPlatformsConductor::TestsRunner do
|
|
|
12
29
|
end
|
|
13
30
|
|
|
14
31
|
it 'executes all tests when all tests are selected' do
|
|
15
|
-
with_test_platform do
|
|
16
|
-
register_test_plugins(
|
|
32
|
+
with_test_platform({}) do
|
|
33
|
+
register_test_plugins(
|
|
34
|
+
test_tests_runner,
|
|
17
35
|
global_test: HybridPlatformsConductorTest::TestPlugins::Global,
|
|
18
36
|
global_test_2: HybridPlatformsConductorTest::TestPlugins::Global
|
|
19
37
|
)
|
|
@@ -24,7 +42,7 @@ describe HybridPlatformsConductor::TestsRunner do
|
|
|
24
42
|
end
|
|
25
43
|
|
|
26
44
|
it 'returns 1 when tests are failing' do
|
|
27
|
-
with_test_platform do
|
|
45
|
+
with_test_platform({}) do
|
|
28
46
|
register_test_plugins(test_tests_runner, global_test: HybridPlatformsConductorTest::TestPlugins::Global)
|
|
29
47
|
HybridPlatformsConductorTest::TestPlugins::Global.fail = true
|
|
30
48
|
expect(test_tests_runner.run_tests([])).to eq 1
|
|
@@ -33,9 +51,12 @@ describe HybridPlatformsConductor::TestsRunner do
|
|
|
33
51
|
end
|
|
34
52
|
|
|
35
53
|
it 'returns 0 when tests are failing as expected' do
|
|
36
|
-
with_test_platform(
|
|
37
|
-
|
|
38
|
-
|
|
54
|
+
with_test_platform(
|
|
55
|
+
{},
|
|
56
|
+
additional_config: <<~'EO_CONFIG'
|
|
57
|
+
expect_tests_to_fail(:platform_test, 'Expected failure')
|
|
58
|
+
EO_CONFIG
|
|
59
|
+
) do
|
|
39
60
|
register_test_plugins(test_tests_runner, platform_test: HybridPlatformsConductorTest::TestPlugins::Platform)
|
|
40
61
|
HybridPlatformsConductorTest::TestPlugins::Platform.fail_for = ['platform']
|
|
41
62
|
expect(test_tests_runner.run_tests([])).to eq 0
|
|
@@ -44,11 +65,14 @@ describe HybridPlatformsConductor::TestsRunner do
|
|
|
44
65
|
end
|
|
45
66
|
|
|
46
67
|
it 'returns 0 when tests are failing as expected on a given node' do
|
|
47
|
-
with_test_platform(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
68
|
+
with_test_platform(
|
|
69
|
+
{ nodes: { 'node1' => {}, 'node2' => {}, 'node3' => {} } },
|
|
70
|
+
additional_config: <<~'EO_CONFIG'
|
|
71
|
+
for_nodes('node2') do
|
|
72
|
+
expect_tests_to_fail(:node_test, 'Expected failure')
|
|
73
|
+
end
|
|
74
|
+
EO_CONFIG
|
|
75
|
+
) do
|
|
52
76
|
register_test_plugins(test_tests_runner, node_test: HybridPlatformsConductorTest::TestPlugins::Node)
|
|
53
77
|
HybridPlatformsConductorTest::TestPlugins::Node.fail_for = { node_test: ['node2'] }
|
|
54
78
|
expect(test_tests_runner.run_tests(%w[node1 node2 node3])).to eq 0
|
|
@@ -57,9 +81,12 @@ describe HybridPlatformsConductor::TestsRunner do
|
|
|
57
81
|
end
|
|
58
82
|
|
|
59
83
|
it 'returns 1 when tests are succeeding but were expected to fail' do
|
|
60
|
-
with_test_platform(
|
|
61
|
-
|
|
62
|
-
|
|
84
|
+
with_test_platform(
|
|
85
|
+
{},
|
|
86
|
+
additional_config: <<~'EO_CONFIG'
|
|
87
|
+
expect_tests_to_fail(:platform_test, 'Expected failure')
|
|
88
|
+
EO_CONFIG
|
|
89
|
+
) do
|
|
63
90
|
register_test_plugins(test_tests_runner, platform_test: HybridPlatformsConductorTest::TestPlugins::Platform)
|
|
64
91
|
expect(test_tests_runner.run_tests([])).to eq 1
|
|
65
92
|
expect(HybridPlatformsConductorTest::TestPlugins::Platform.runs).to eq [[:platform_test, 'platform']]
|
|
@@ -67,11 +94,14 @@ describe HybridPlatformsConductor::TestsRunner do
|
|
|
67
94
|
end
|
|
68
95
|
|
|
69
96
|
it 'returns 1 when extra expected failures have not been tested when running all tests' do
|
|
70
|
-
with_test_platform(
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
97
|
+
with_test_platform(
|
|
98
|
+
{ nodes: { 'another_node' => {} } },
|
|
99
|
+
additional_config: <<~'EO_CONFIG'
|
|
100
|
+
for_nodes('another_node') do
|
|
101
|
+
expect_tests_to_fail(:platform_test, 'Expected failure')
|
|
102
|
+
end
|
|
103
|
+
EO_CONFIG
|
|
104
|
+
) do
|
|
75
105
|
register_test_plugins(test_tests_runner, platform_test: HybridPlatformsConductorTest::TestPlugins::Platform)
|
|
76
106
|
expect(test_tests_runner.run_tests([])).to eq 1
|
|
77
107
|
expect(HybridPlatformsConductorTest::TestPlugins::Platform.runs).to eq [[:platform_test, 'platform']]
|
|
@@ -79,11 +109,13 @@ describe HybridPlatformsConductor::TestsRunner do
|
|
|
79
109
|
end
|
|
80
110
|
|
|
81
111
|
it 'fails when expected failures reference missing nodes' do
|
|
82
|
-
with_test_platform(
|
|
83
|
-
|
|
84
|
-
|
|
112
|
+
with_test_platform(
|
|
113
|
+
{ nodes: { 'node' => {} } },
|
|
114
|
+
additional_config: <<~'EO_CONFIG'
|
|
115
|
+
for_nodes('missing_node') do
|
|
116
|
+
expect_tests_to_fail(:node_test, 'Expected failure')
|
|
85
117
|
end
|
|
86
|
-
|
|
118
|
+
EO_CONFIG
|
|
87
119
|
) do
|
|
88
120
|
register_test_plugins(test_tests_runner, node_test: HybridPlatformsConductorTest::TestPlugins::Node)
|
|
89
121
|
expect { test_tests_runner.run_tests([{ all: true }]) }.to raise_error 'Unknown nodes: missing_node'
|
|
@@ -91,7 +123,7 @@ describe HybridPlatformsConductor::TestsRunner do
|
|
|
91
123
|
end
|
|
92
124
|
|
|
93
125
|
it 'fails when we ask for an unknown test' do
|
|
94
|
-
with_test_platform do
|
|
126
|
+
with_test_platform({}) do
|
|
95
127
|
register_test_plugins(test_tests_runner, global_test: HybridPlatformsConductorTest::TestPlugins::Global)
|
|
96
128
|
test_tests_runner.tests = [:global_test_2]
|
|
97
129
|
expect { test_tests_runner.run_tests([]) }.to raise_error(RuntimeError, 'Unknown test names: global_test_2')
|
|
@@ -100,8 +132,10 @@ describe HybridPlatformsConductor::TestsRunner do
|
|
|
100
132
|
|
|
101
133
|
it 'executes different tests levels if 1 plugin defines them' do
|
|
102
134
|
with_test_platforms(
|
|
103
|
-
|
|
104
|
-
|
|
135
|
+
{
|
|
136
|
+
'platform1' => { nodes: { 'node11' => {}, 'node12' => {} } },
|
|
137
|
+
'platform2' => { nodes: { 'node21' => {}, 'node22' => {} } }
|
|
138
|
+
}
|
|
105
139
|
) do
|
|
106
140
|
register_test_plugins(test_tests_runner, several_tests: HybridPlatformsConductorTest::TestPlugins::SeveralChecks)
|
|
107
141
|
# Mock the Actions Executor and Deployer expected calls
|
|
@@ -128,23 +162,23 @@ describe HybridPlatformsConductor::TestsRunner do
|
|
|
128
162
|
'echo "$?"'
|
|
129
163
|
]
|
|
130
164
|
end
|
|
131
|
-
|
|
165
|
+
node_suffixes.map do |node_suffix|
|
|
132
166
|
[
|
|
133
167
|
"node#{node_suffix}",
|
|
134
168
|
[
|
|
135
169
|
0,
|
|
136
|
-
<<~
|
|
170
|
+
<<~EO_STDOUT,
|
|
137
171
|
===== TEST COMMAND EXECUTION ===== Separator generated by Hybrid Platforms Conductor test framework =====
|
|
138
172
|
stdout#{node_suffix}
|
|
139
173
|
0
|
|
140
|
-
|
|
141
|
-
<<~
|
|
174
|
+
EO_STDOUT
|
|
175
|
+
<<~EO_STDERR
|
|
142
176
|
===== TEST COMMAND EXECUTION ===== Separator generated by Hybrid Platforms Conductor test framework =====
|
|
143
177
|
stderr#{node_suffix}
|
|
144
|
-
|
|
178
|
+
EO_STDERR
|
|
145
179
|
]
|
|
146
180
|
]
|
|
147
|
-
end
|
|
181
|
+
end.to_h
|
|
148
182
|
end])
|
|
149
183
|
# Run everything
|
|
150
184
|
test_tests_runner.tests = [:several_tests]
|
|
@@ -169,22 +203,8 @@ describe HybridPlatformsConductor::TestsRunner do
|
|
|
169
203
|
end
|
|
170
204
|
end
|
|
171
205
|
|
|
172
|
-
# Specific test registered by the test platform handler
|
|
173
|
-
class SpecificPlatformHandlerTest < HybridPlatformsConductor::Test
|
|
174
|
-
|
|
175
|
-
class << self
|
|
176
|
-
attr_accessor :run
|
|
177
|
-
end
|
|
178
|
-
@run = false
|
|
179
|
-
|
|
180
|
-
def test
|
|
181
|
-
SpecificPlatformHandlerTest.run = true
|
|
182
|
-
end
|
|
183
|
-
|
|
184
|
-
end
|
|
185
|
-
|
|
186
206
|
it 'executes tests defined by a platform handler' do
|
|
187
|
-
with_test_platform(tests: { specific_platform_handler_test: SpecificPlatformHandlerTest }) do
|
|
207
|
+
with_test_platform({ tests: { specific_platform_handler_test: SpecificPlatformHandlerTest } }) do
|
|
188
208
|
test_tests_runner.tests = [:specific_platform_handler_test]
|
|
189
209
|
expect(test_tests_runner.run_tests([])).to eq 0
|
|
190
210
|
expect(SpecificPlatformHandlerTest.run).to eq true
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
describe HybridPlatformsConductor::TestsRunner do
|
|
2
2
|
|
|
3
|
-
context 'checking global tests execution' do
|
|
3
|
+
context 'when checking global tests execution' do
|
|
4
4
|
|
|
5
5
|
# Prepare the test platform with test plugins
|
|
6
6
|
#
|
|
7
7
|
# Parameters::
|
|
8
|
-
# * *platforms_info* (Hash): The
|
|
8
|
+
# * *platforms_info* (Hash): The platforms info [default: {}]
|
|
9
9
|
def with_test_platform_for_global_tests(platforms_info: {})
|
|
10
10
|
with_test_platform(platforms_info) do
|
|
11
|
-
register_test_plugins(
|
|
11
|
+
register_test_plugins(
|
|
12
|
+
test_tests_runner,
|
|
12
13
|
global_test: HybridPlatformsConductorTest::TestPlugins::Global,
|
|
13
14
|
global_test_2: HybridPlatformsConductorTest::TestPlugins::Global
|
|
14
15
|
)
|
|
@@ -26,7 +27,7 @@ describe HybridPlatformsConductor::TestsRunner do
|
|
|
26
27
|
|
|
27
28
|
it 'executes several global tests' do
|
|
28
29
|
with_test_platform_for_global_tests do
|
|
29
|
-
test_tests_runner.tests = [
|
|
30
|
+
test_tests_runner.tests = %i[global_test global_test_2]
|
|
30
31
|
expect(test_tests_runner.run_tests([])).to eq 0
|
|
31
32
|
expect(HybridPlatformsConductorTest::TestPlugins::Global.nbr_runs).to eq 2
|
|
32
33
|
end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
describe HybridPlatformsConductor::TestsRunner do
|
|
2
2
|
|
|
3
|
-
context 'checking node tests on check-node results' do
|
|
3
|
+
context 'when checking node tests on check-node results' do
|
|
4
4
|
|
|
5
5
|
# Prepare the test platform with test plugins
|
|
6
6
|
#
|
|
@@ -8,10 +8,13 @@ describe HybridPlatformsConductor::TestsRunner do
|
|
|
8
8
|
# * Proc: Code called with the platform setup
|
|
9
9
|
def with_test_platform_for_node_check_tests
|
|
10
10
|
with_test_platforms(
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
{
|
|
12
|
+
'platform1' => { nodes: { 'node11' => {}, 'node12' => {} } },
|
|
13
|
+
'platform2' => { nodes: { 'node21' => {}, 'node22' => {} }, platform_type: :test_2 }
|
|
14
|
+
}
|
|
13
15
|
) do
|
|
14
|
-
register_test_plugins(
|
|
16
|
+
register_test_plugins(
|
|
17
|
+
test_tests_runner,
|
|
15
18
|
node_check_test: HybridPlatformsConductorTest::TestPlugins::NodeCheck,
|
|
16
19
|
node_check_test_2: HybridPlatformsConductorTest::TestPlugins::NodeCheck
|
|
17
20
|
)
|
|
@@ -61,7 +64,7 @@ describe HybridPlatformsConductor::TestsRunner do
|
|
|
61
64
|
|
|
62
65
|
it 'executes check node tests once per node even if there are several tests using check reports' do
|
|
63
66
|
with_test_platform_for_node_check_tests do
|
|
64
|
-
test_tests_runner.tests = [
|
|
67
|
+
test_tests_runner.tests = %i[node_check_test node_check_test_2]
|
|
65
68
|
expect(test_deployer).to receive(:deploy_on).with(%w[node11 node12 node21 node22]).once do
|
|
66
69
|
expect(test_deployer.use_why_run).to eq true
|
|
67
70
|
{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
describe HybridPlatformsConductor::TestsRunner do
|
|
2
2
|
|
|
3
|
-
context 'checking node tests execution' do
|
|
3
|
+
context 'when checking node tests execution' do
|
|
4
4
|
|
|
5
5
|
# Prepare the test platform with test plugins
|
|
6
6
|
#
|
|
@@ -8,10 +8,13 @@ describe HybridPlatformsConductor::TestsRunner do
|
|
|
8
8
|
# * Proc: Code called with the platform setup
|
|
9
9
|
def with_test_platform_for_node_tests
|
|
10
10
|
with_test_platforms(
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
{
|
|
12
|
+
'platform1' => { nodes: { 'node11' => {}, 'node12' => {}, 'node13' => {} } },
|
|
13
|
+
'platform2' => { nodes: { 'node21' => {}, 'node22' => {}, 'node23' => {} }, platform_type: :test_2 }
|
|
14
|
+
}
|
|
13
15
|
) do
|
|
14
|
-
register_test_plugins(
|
|
16
|
+
register_test_plugins(
|
|
17
|
+
test_tests_runner,
|
|
15
18
|
node_test: HybridPlatformsConductorTest::TestPlugins::Node,
|
|
16
19
|
node_test_2: HybridPlatformsConductorTest::TestPlugins::Node
|
|
17
20
|
)
|
|
@@ -47,7 +50,7 @@ describe HybridPlatformsConductor::TestsRunner do
|
|
|
47
50
|
|
|
48
51
|
it 'executes several node tests' do
|
|
49
52
|
with_test_platform_for_node_tests do
|
|
50
|
-
test_tests_runner.tests = [
|
|
53
|
+
test_tests_runner.tests = %i[node_test node_test_2]
|
|
51
54
|
expect(test_tests_runner.run_tests([{ all: true }])).to eq 0
|
|
52
55
|
expect(HybridPlatformsConductorTest::TestPlugins::Node.runs.sort).to eq [
|
|
53
56
|
[:node_test, 'node11'],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
describe HybridPlatformsConductor::TestsRunner do
|
|
2
2
|
|
|
3
|
-
context 'checking connection node tests execution' do
|
|
3
|
+
context 'when checking connection node tests execution' do
|
|
4
4
|
|
|
5
5
|
# Prepare the test platform with test plugins
|
|
6
6
|
#
|
|
@@ -8,10 +8,13 @@ describe HybridPlatformsConductor::TestsRunner do
|
|
|
8
8
|
# * Proc: Code called with the platform setup
|
|
9
9
|
def with_test_platform_for_node_connection_tests
|
|
10
10
|
with_test_platforms(
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
{
|
|
12
|
+
'platform1' => { nodes: { 'node11' => {}, 'node12' => {} } },
|
|
13
|
+
'platform2' => { nodes: { 'node21' => {}, 'node22' => {} }, platform_type: :test_2 }
|
|
14
|
+
}
|
|
13
15
|
) do
|
|
14
|
-
register_test_plugins(
|
|
16
|
+
register_test_plugins(
|
|
17
|
+
test_tests_runner,
|
|
15
18
|
node_ssh_test: HybridPlatformsConductorTest::TestPlugins::NodeSsh,
|
|
16
19
|
node_ssh_test_2: HybridPlatformsConductorTest::TestPlugins::NodeSsh
|
|
17
20
|
)
|
|
@@ -40,23 +43,23 @@ describe HybridPlatformsConductor::TestsRunner do
|
|
|
40
43
|
'echo "$?"'
|
|
41
44
|
]
|
|
42
45
|
end
|
|
43
|
-
|
|
46
|
+
node_suffixes.map do |node_suffix|
|
|
44
47
|
[
|
|
45
48
|
"node#{node_suffix}",
|
|
46
49
|
[
|
|
47
50
|
0,
|
|
48
|
-
<<~
|
|
51
|
+
<<~EO_STDOUT,
|
|
49
52
|
===== TEST COMMAND EXECUTION ===== Separator generated by Hybrid Platforms Conductor test framework =====
|
|
50
53
|
stdout#{node_suffix}
|
|
51
54
|
#{fails_on.include?(node_suffix) ? 1 : 0}
|
|
52
|
-
|
|
53
|
-
<<~
|
|
55
|
+
EO_STDOUT
|
|
56
|
+
<<~EO_STDERR
|
|
54
57
|
===== TEST COMMAND EXECUTION ===== Separator generated by Hybrid Platforms Conductor test framework =====
|
|
55
58
|
stderr#{node_suffix}
|
|
56
|
-
|
|
59
|
+
EO_STDERR
|
|
57
60
|
]
|
|
58
61
|
]
|
|
59
|
-
end
|
|
62
|
+
end.to_h
|
|
60
63
|
end
|
|
61
64
|
|
|
62
65
|
it 'executes SSH node tests once per node with the correct command' do
|
|
@@ -126,34 +129,34 @@ describe HybridPlatformsConductor::TestsRunner do
|
|
|
126
129
|
'echo "$?"',
|
|
127
130
|
'echo \'===== TEST COMMAND EXECUTION ===== Separator generated by Hybrid Platforms Conductor test framework =====\'',
|
|
128
131
|
'>&2 echo \'===== TEST COMMAND EXECUTION ===== Separator generated by Hybrid Platforms Conductor test framework =====\'',
|
|
129
|
-
"
|
|
132
|
+
"test_2_node#{node_suffix}.sh",
|
|
130
133
|
'echo "$?"'
|
|
131
134
|
]
|
|
132
135
|
end
|
|
133
|
-
|
|
136
|
+
node_suffixes.map do |node_suffix|
|
|
134
137
|
[
|
|
135
138
|
"node#{node_suffix}",
|
|
136
139
|
[
|
|
137
140
|
0,
|
|
138
|
-
<<~
|
|
141
|
+
<<~EO_STDOUT,
|
|
139
142
|
===== TEST COMMAND EXECUTION ===== Separator generated by Hybrid Platforms Conductor test framework =====
|
|
140
143
|
stdout#{node_suffix}
|
|
141
144
|
0
|
|
142
145
|
===== TEST COMMAND EXECUTION ===== Separator generated by Hybrid Platforms Conductor test framework =====
|
|
143
146
|
stdout#{node_suffix}_2
|
|
144
147
|
0
|
|
145
|
-
|
|
146
|
-
<<~
|
|
148
|
+
EO_STDOUT
|
|
149
|
+
<<~EO_STDERR
|
|
147
150
|
===== TEST COMMAND EXECUTION ===== Separator generated by Hybrid Platforms Conductor test framework =====
|
|
148
151
|
stderr#{node_suffix}
|
|
149
152
|
===== TEST COMMAND EXECUTION ===== Separator generated by Hybrid Platforms Conductor test framework =====
|
|
150
153
|
stderr#{node_suffix}_2
|
|
151
|
-
|
|
154
|
+
EO_STDERR
|
|
152
155
|
]
|
|
153
156
|
]
|
|
154
|
-
end
|
|
157
|
+
end.to_h
|
|
155
158
|
end])
|
|
156
|
-
test_tests_runner.tests = [
|
|
159
|
+
test_tests_runner.tests = %i[node_ssh_test node_ssh_test_2]
|
|
157
160
|
ssh_executions = []
|
|
158
161
|
HybridPlatformsConductorTest::TestPlugins::NodeSsh.node_tests = {
|
|
159
162
|
node_ssh_test: {
|
|
@@ -163,10 +166,10 @@ describe HybridPlatformsConductor::TestsRunner do
|
|
|
163
166
|
'node22' => { 'test_node22.sh' => proc { |stdout, stderr, exit_code| ssh_executions << ['node22', stdout, stderr, exit_code] } }
|
|
164
167
|
},
|
|
165
168
|
node_ssh_test_2: {
|
|
166
|
-
'node11' => { '
|
|
167
|
-
'node12' => { '
|
|
168
|
-
'node21' => { '
|
|
169
|
-
'node22' => { '
|
|
169
|
+
'node11' => { 'test_2_node11.sh' => proc { |stdout, stderr, exit_code| ssh_executions << ['node11', stdout, stderr, exit_code] } },
|
|
170
|
+
'node12' => { 'test_2_node12.sh' => proc { |stdout, stderr, exit_code| ssh_executions << ['node12', stdout, stderr, exit_code] } },
|
|
171
|
+
'node21' => { 'test_2_node21.sh' => proc { |stdout, stderr, exit_code| ssh_executions << ['node21', stdout, stderr, exit_code] } },
|
|
172
|
+
'node22' => { 'test_2_node22.sh' => proc { |stdout, stderr, exit_code| ssh_executions << ['node22', stdout, stderr, exit_code] } }
|
|
170
173
|
}
|
|
171
174
|
}
|
|
172
175
|
expect(test_tests_runner.run_tests([{ all: true }])).to eq 0
|
|
@@ -193,7 +196,7 @@ describe HybridPlatformsConductor::TestsRunner do
|
|
|
193
196
|
'node12' => { 'test_node12.sh' => proc { |stdout, stderr, exit_code| ssh_executions << ['node12', stdout, stderr, exit_code] } },
|
|
194
197
|
'node21' => { 'test_node21.sh' => proc { |stdout, stderr, exit_code| ssh_executions << ['node21', stdout, stderr, exit_code] } },
|
|
195
198
|
'node22' => { 'test_node22.sh' => proc { |stdout, stderr, exit_code| ssh_executions << ['node22', stdout, stderr, exit_code] } }
|
|
196
|
-
}}
|
|
199
|
+
} }
|
|
197
200
|
expect(test_tests_runner.run_tests([{ all: true }])).to eq 1
|
|
198
201
|
expect(ssh_executions.sort).to eq [
|
|
199
202
|
['node11', ['stdout11'], ['stderr11'], 0],
|
|
@@ -211,10 +214,10 @@ describe HybridPlatformsConductor::TestsRunner do
|
|
|
211
214
|
ssh_executions = []
|
|
212
215
|
HybridPlatformsConductorTest::TestPlugins::NodeSsh.node_tests = { node_ssh_test: {
|
|
213
216
|
'node11' => { 'test_node11.sh' => proc { |stdout, stderr, exit_code| ssh_executions << ['node11', stdout, stderr, exit_code] } },
|
|
214
|
-
'node12' => { 'test_node12.sh' => proc {
|
|
217
|
+
'node12' => { 'test_node12.sh' => proc { raise 'Failure on this node' } },
|
|
215
218
|
'node21' => { 'test_node21.sh' => proc { |stdout, stderr, exit_code| ssh_executions << ['node21', stdout, stderr, exit_code] } },
|
|
216
219
|
'node22' => { 'test_node22.sh' => proc { |stdout, stderr, exit_code| ssh_executions << ['node22', stdout, stderr, exit_code] } }
|
|
217
|
-
}}
|
|
220
|
+
} }
|
|
218
221
|
expect(test_tests_runner.run_tests([{ all: true }])).to eq 1
|
|
219
222
|
expect(ssh_executions.sort).to eq [
|
|
220
223
|
['node11', ['stdout11'], ['stderr11'], 0],
|
|
@@ -233,7 +236,7 @@ describe HybridPlatformsConductor::TestsRunner do
|
|
|
233
236
|
HybridPlatformsConductorTest::TestPlugins::NodeSsh.node_tests = { node_ssh_test: {
|
|
234
237
|
'node12' => { 'test_node12.sh' => proc { |stdout, stderr, exit_code| ssh_executions << ['node12', stdout, stderr, exit_code] } },
|
|
235
238
|
'node22' => { 'test_node22.sh' => proc { |stdout, stderr, exit_code| ssh_executions << ['node22', stdout, stderr, exit_code] } }
|
|
236
|
-
}}
|
|
239
|
+
} }
|
|
237
240
|
expect(test_tests_runner.run_tests([{ all: true }])).to eq 0
|
|
238
241
|
expect(ssh_executions.sort).to eq [
|
|
239
242
|
['node12', ['stdout12'], ['stderr12'], 0],
|
|
@@ -253,7 +256,7 @@ describe HybridPlatformsConductor::TestsRunner do
|
|
|
253
256
|
'node12' => { 'test_node12.sh' => proc { |stdout, stderr, exit_code| ssh_executions << ['node12', stdout, stderr, exit_code] } },
|
|
254
257
|
'node21' => { 'test_node21.sh' => proc { |stdout, stderr, exit_code| ssh_executions << ['node21', stdout, stderr, exit_code] } },
|
|
255
258
|
'node22' => { 'test_node22.sh' => proc { |stdout, stderr, exit_code| ssh_executions << ['node22', stdout, stderr, exit_code] } }
|
|
256
|
-
}}
|
|
259
|
+
} }
|
|
257
260
|
expect(test_tests_runner.run_tests([{ all: true }])).to eq 0
|
|
258
261
|
expect(test_tests_runner.max_threads_connection_on_nodes).to eq 43
|
|
259
262
|
expect(ssh_executions.sort).to eq [
|