Always send 100% progress status for all nodes after tasks run
Change-Id: I48b74a286640a9c0e13872bf04a3c07ed9d24d36 Closes-Bug: #1621456
This commit is contained in:
parent
c33fe77e77
commit
3446b69a23
|
@ -82,13 +82,13 @@ module Astute
|
|||
Deployment::Log.logger = Astute.logger if Astute.respond_to? :logger
|
||||
write_graph_to_file(cluster)
|
||||
result = if dry_run
|
||||
report_final_node_progress(cluster)
|
||||
{:success => true}
|
||||
else
|
||||
run_result = cluster.run
|
||||
# imitate dry_run results for noop run after deployment
|
||||
cluster.noop_run ? {:success => true } : run_result
|
||||
end
|
||||
report_final_node_progress(cluster)
|
||||
report_deploy_result(result)
|
||||
end
|
||||
|
||||
|
|
|
@ -345,10 +345,14 @@ describe Astute::TaskDeployment do
|
|||
|
||||
context 'should report final status' do
|
||||
|
||||
it 'succeed status' do
|
||||
it 'succeed status and 100 progress for all nodes' do
|
||||
Astute::TaskCluster.any_instance.stubs(:run).returns({:success => true})
|
||||
task_deployment.stubs(:fail_offline_nodes).returns([])
|
||||
task_deployment.stubs(:write_graph_to_file)
|
||||
ctx.expects(:report).with('nodes' => [
|
||||
{'uid' => '1', 'progress' => 100},
|
||||
{'uid' => 'virtual_sync_node', 'progress' => 100}]
|
||||
)
|
||||
ctx.expects(:report).with({'status' => 'ready', 'progress' => 100})
|
||||
|
||||
task_deployment.deploy(
|
||||
|
@ -357,7 +361,7 @@ describe Astute::TaskDeployment do
|
|||
tasks_directory: tasks_directory)
|
||||
end
|
||||
|
||||
it 'failed status' do
|
||||
it 'failed status and 100 progress for all nodes' do
|
||||
failed_node = mock('node')
|
||||
failed_task = mock('task')
|
||||
|
||||
|
@ -368,6 +372,10 @@ describe Astute::TaskDeployment do
|
|||
:status => 'Failed because of'})
|
||||
task_deployment.stubs(:fail_offline_nodes).returns([])
|
||||
task_deployment.stubs(:write_graph_to_file)
|
||||
ctx.expects(:report).with('nodes' => [
|
||||
{'uid' => '1', 'progress' => 100},
|
||||
{'uid' => 'virtual_sync_node', 'progress' => 100}]
|
||||
)
|
||||
ctx.expects(:report).with({
|
||||
'status' => 'error',
|
||||
'progress' => 100,
|
||||
|
|
Loading…
Reference in New Issue