Merge "Enabled task based deployment engine by default"
This commit is contained in:
commit
04b4ecc84a
|
@ -919,14 +919,11 @@
|
||||||
weight: 70
|
weight: 70
|
||||||
type: "textarea"
|
type: "textarea"
|
||||||
task_deploy:
|
task_deploy:
|
||||||
value: false
|
value: true
|
||||||
label: "Enable task based deploy"
|
label: "Enable task based deploy"
|
||||||
description: "Enables new deployment engine based on cross-node dependencies for deployment tasks which allows to deploy all nodes simultaneously. Works only for deployment tasks with version >= 2.0.0."
|
description: "The new deployment engine based on cross-node dependencies for deployment tasks."
|
||||||
weight: 11
|
weight: 11
|
||||||
type: "checkbox"
|
type: "hidden"
|
||||||
restrictions:
|
|
||||||
- condition: "not ('experimental' in version:feature_groups)"
|
|
||||||
action: "hide"
|
|
||||||
|
|
||||||
public_network_assignment:
|
public_network_assignment:
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
@ -44,9 +44,9 @@ class TestTaskDeploy(BaseIntegrationTest):
|
||||||
)
|
)
|
||||||
self.cluster = self.env.clusters[-1]
|
self.cluster = self.env.clusters[-1]
|
||||||
|
|
||||||
def enable_deploy_task(self, enable=True):
|
def disable_task_deploy(self):
|
||||||
cluster_attrs = copy.deepcopy(self.cluster.attributes.editable)
|
cluster_attrs = copy.deepcopy(self.cluster.attributes.editable)
|
||||||
cluster_attrs['common']['task_deploy']['value'] = enable
|
cluster_attrs['common']['task_deploy']['value'] = False
|
||||||
self.cluster.attributes.editable = cluster_attrs
|
self.cluster.attributes.editable = cluster_attrs
|
||||||
self.db().flush()
|
self.db().flush()
|
||||||
|
|
||||||
|
@ -78,8 +78,7 @@ class TestTaskDeploy(BaseIntegrationTest):
|
||||||
return args[1][1]
|
return args[1][1]
|
||||||
|
|
||||||
@mock.patch.object(TaskProcessor, "ensure_task_based_deploy_allowed")
|
@mock.patch.object(TaskProcessor, "ensure_task_based_deploy_allowed")
|
||||||
def test_task_deploy_used_if_option_enabled(self, _):
|
def test_task_deploy_used_by_default(self, _):
|
||||||
self.enable_deploy_task(True)
|
|
||||||
message = self.get_deploy_message()
|
message = self.get_deploy_message()
|
||||||
self.assertEqual("task_deploy", message["method"])
|
self.assertEqual("task_deploy", message["method"])
|
||||||
self.assertItemsEqual(
|
self.assertItemsEqual(
|
||||||
|
@ -90,7 +89,6 @@ class TestTaskDeploy(BaseIntegrationTest):
|
||||||
@mock.patch.object(TaskProcessor, "ensure_task_based_deploy_allowed")
|
@mock.patch.object(TaskProcessor, "ensure_task_based_deploy_allowed")
|
||||||
def test_fallback_to_granular_deploy(self, ensure_allowed):
|
def test_fallback_to_granular_deploy(self, ensure_allowed):
|
||||||
ensure_allowed.side_effect = errors.TaskBaseDeploymentNotAllowed
|
ensure_allowed.side_effect = errors.TaskBaseDeploymentNotAllowed
|
||||||
self.enable_deploy_task(True)
|
|
||||||
message = self.get_deploy_message()
|
message = self.get_deploy_message()
|
||||||
self.assertEqual("granular_deploy", message["method"])
|
self.assertEqual("granular_deploy", message["method"])
|
||||||
self.assertItemsEqual(
|
self.assertItemsEqual(
|
||||||
|
@ -101,7 +99,7 @@ class TestTaskDeploy(BaseIntegrationTest):
|
||||||
ensure_allowed.assert_called_once_with(mock.ANY)
|
ensure_allowed.assert_called_once_with(mock.ANY)
|
||||||
|
|
||||||
def test_granular_deploy_if_not_enabled(self):
|
def test_granular_deploy_if_not_enabled(self):
|
||||||
self.enable_deploy_task(False)
|
self.disable_task_deploy()
|
||||||
message = self.get_deploy_message()
|
message = self.get_deploy_message()
|
||||||
self.assertEqual("granular_deploy", message["method"])
|
self.assertEqual("granular_deploy", message["method"])
|
||||||
self.assertItemsEqual(
|
self.assertItemsEqual(
|
||||||
|
@ -114,7 +112,6 @@ class TestTaskDeploy(BaseIntegrationTest):
|
||||||
@mock.patch('nailgun.plugins.adapters.os.path.exists', return_value=True)
|
@mock.patch('nailgun.plugins.adapters.os.path.exists', return_value=True)
|
||||||
@mock.patch('nailgun.plugins.adapters.PluginAdapterBase._load_tasks')
|
@mock.patch('nailgun.plugins.adapters.PluginAdapterBase._load_tasks')
|
||||||
def test_task_deploy_with_plugins(self, load_tasks, *_):
|
def test_task_deploy_with_plugins(self, load_tasks, *_):
|
||||||
self.enable_deploy_task(True)
|
|
||||||
self.add_plugin_with_tasks("plugin_deployment_task")
|
self.add_plugin_with_tasks("plugin_deployment_task")
|
||||||
# There is bug[1] in PluginAdapters,
|
# There is bug[1] in PluginAdapters,
|
||||||
# it always reads the tasks from local file sytem.
|
# it always reads the tasks from local file sytem.
|
||||||
|
@ -147,7 +144,6 @@ class TestTaskDeploy(BaseIntegrationTest):
|
||||||
@mock.patch.object(TaskProcessor, "ensure_task_based_deploy_allowed")
|
@mock.patch.object(TaskProcessor, "ensure_task_based_deploy_allowed")
|
||||||
@mock.patch('nailgun.rpc.cast')
|
@mock.patch('nailgun.rpc.cast')
|
||||||
def test_task_deploy_specified_tasks(self, rpc_cast, *_):
|
def test_task_deploy_specified_tasks(self, rpc_cast, *_):
|
||||||
self.enable_deploy_task(True)
|
|
||||||
compute = next(
|
compute = next(
|
||||||
(x for x in self.env.nodes if 'compute' in x.roles), None
|
(x for x in self.env.nodes if 'compute' in x.roles), None
|
||||||
)
|
)
|
||||||
|
@ -182,7 +178,6 @@ class TestTaskDeploy(BaseIntegrationTest):
|
||||||
@mock.patch.object(TaskProcessor, "ensure_task_based_deploy_allowed")
|
@mock.patch.object(TaskProcessor, "ensure_task_based_deploy_allowed")
|
||||||
@mock.patch('nailgun.rpc.cast')
|
@mock.patch('nailgun.rpc.cast')
|
||||||
def test_task_deploy_all_tasks(self, rpc_cast, *_):
|
def test_task_deploy_all_tasks(self, rpc_cast, *_):
|
||||||
self.enable_deploy_task(True)
|
|
||||||
compute = next(
|
compute = next(
|
||||||
(x for x in self.env.nodes if 'compute' in x.roles), None
|
(x for x in self.env.nodes if 'compute' in x.roles), None
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue