Merge "Fix wrong ready status instead of stopped for stop deployment"

This commit is contained in:
Jenkins 2017-03-20 12:52:44 +00:00 committed by Gerrit Code Review
commit 2f01ecc857
2 changed files with 23 additions and 2 deletions

View File

@ -124,10 +124,10 @@ module Astute
def node_report_status
if !finished?
{}
elsif successful?
cluster.node_statuses_transitions.fetch('successful', {})
elsif skipped?
cluster.node_statuses_transitions.fetch('stopped', {})
elsif successful?
cluster.node_statuses_transitions.fetch('successful', {})
else
cluster.node_statuses_transitions.fetch('failed', {})
end

View File

@ -378,6 +378,27 @@ describe Astute::TaskNode do
})
task_node.poll
end
it 'should report stopped if node skipped' do
cluster.node_statuses_transitions['stopped'] = {
'status' => 'stopped'
}
cluster.node_statuses_transitions['successful'] = {
'status' => 'ready'
}
task_node.set_status_skipped
task_node.stubs(:finished?).returns(true)
task_node.stubs(:successful?).returns(true)
ctx.expects(:report).with({
'nodes' => [{
'uid' => 'node_id',
'status' => 'stopped',
'progress' => 100}]
})
task_node.report_node_status
end
end
it 'should report error if task failed and no more task' do