Repository: ambari Updated Branches: refs/heads/trunk 2be0ec362 -> 18463c86a
AMBARI-14897 Rolling Upgrade: upgrade group status not updated. (atkach) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/18463c86 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/18463c86 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/18463c86 Branch: refs/heads/trunk Commit: 18463c86afc348d985c8638cd4542201372998e3 Parents: 2be0ec3 Author: Andrii Tkach <atk...@hortonworks.com> Authored: Wed Feb 3 12:50:07 2016 +0200 Committer: Andrii Tkach <atk...@hortonworks.com> Committed: Wed Feb 3 16:54:02 2016 +0200 ---------------------------------------------------------------------- .../main/admin/stack_and_upgrade_controller.js | 2 ++ ambari-web/app/models/upgrade_entity.js | 2 +- .../admin/stack_and_upgrade_controller_test.js | 17 +++++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/18463c86/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js b/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js index 16a58d6..c226059 100644 --- a/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js +++ b/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js @@ -377,10 +377,12 @@ App.MainAdminStackAndUpgradeController = Em.Controller.extend(App.LocalStorage, //update existed entities with new data oldData.upgradeGroups.forEach(function (oldGroup) { oldGroup.set('status', groupsMap[oldGroup.get('group_id')].status); + oldGroup.set('display_status', groupsMap[oldGroup.get('group_id')].display_status); oldGroup.set('progress_percent', groupsMap[oldGroup.get('group_id')].progress_percent); oldGroup.set('completed_task_count', groupsMap[oldGroup.get('group_id')].completed_task_count); oldGroup.upgradeItems.forEach(function (item) { item.set('status', itemsMap[item.get('stage_id')].status); + item.set('display_status', itemsMap[item.get('stage_id')].display_status); item.set('progress_percent', itemsMap[item.get('stage_id')].progress_percent); }); var hasExpandableItems = oldGroup.upgradeItems.some(function (item) { http://git-wip-us.apache.org/repos/asf/ambari/blob/18463c86/ambari-web/app/models/upgrade_entity.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/models/upgrade_entity.js b/ambari-web/app/models/upgrade_entity.js index 70d1840..7084185 100644 --- a/ambari-web/app/models/upgrade_entity.js +++ b/ambari-web/app/models/upgrade_entity.js @@ -87,5 +87,5 @@ App.upgradeEntity = Em.Object.extend({ if (this.get('type') === 'GROUP') { return !this.get('isActive') && this.get('hasExpandableItems') ? 'SUBITEM_FAILED' : this.get('display_status') || this.get('status'); } - }.property('isExpandableGroup') + }.property('isExpandableGroup', 'display_status', 'status') }); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/18463c86/ambari-web/test/controllers/main/admin/stack_and_upgrade_controller_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/controllers/main/admin/stack_and_upgrade_controller_test.js b/ambari-web/test/controllers/main/admin/stack_and_upgrade_controller_test.js index 508e2dd..1315477 100644 --- a/ambari-web/test/controllers/main/admin/stack_and_upgrade_controller_test.js +++ b/ambari-web/test/controllers/main/admin/stack_and_upgrade_controller_test.js @@ -635,6 +635,7 @@ describe('App.MainAdminStackAndUpgradeController', function() { UpgradeGroup: { group_id: 1, status: 'COMPLETED', + display_status: 'COMPLETED', progress_percent: 100, completed_task_count: 3 }, @@ -643,6 +644,7 @@ describe('App.MainAdminStackAndUpgradeController', function() { UpgradeItem: { stage_id: 1, status: 'COMPLETED', + display_status: 'COMPLETED', progress_percent: 100 } } @@ -652,6 +654,7 @@ describe('App.MainAdminStackAndUpgradeController', function() { UpgradeGroup: { group_id: 2, status: 'ABORTED', + display_status: 'ABORTED', progress_percent: 50, completed_task_count: 1 }, @@ -660,6 +663,7 @@ describe('App.MainAdminStackAndUpgradeController', function() { UpgradeItem: { stage_id: 2, status: 'ABORTED', + display_status: 'ABORTED', progress_percent: 99 } }, @@ -667,6 +671,7 @@ describe('App.MainAdminStackAndUpgradeController', function() { UpgradeItem: { stage_id: 3, status: 'PENDING', + display_status: 'PENDING', progress_percent: 0 } } @@ -683,6 +688,9 @@ describe('App.MainAdminStackAndUpgradeController', function() { it('status is COMPLETED', function () { expect(groups[0].get('status')).to.equal('COMPLETED'); }); + it('display_status is COMPLETED', function () { + expect(groups[0].get('display_status')).to.equal('COMPLETED'); + }); it('progress_percent is 100', function () { expect(groups[0].get('progress_percent')).to.equal(100); }); @@ -692,6 +700,9 @@ describe('App.MainAdminStackAndUpgradeController', function() { it('upgradeItems.0.status is COMPLETED', function () { expect(groups[0].get('upgradeItems')[0].get('status')).to.equal('COMPLETED'); }); + it('upgradeItems.0.display_status is COMPLETED', function () { + expect(groups[0].get('upgradeItems')[0].get('display_status')).to.equal('COMPLETED'); + }); it('upgradeItems.0.progress_percent is 100', function () { expect(groups[0].get('upgradeItems')[0].get('progress_percent')).to.equal(100); }); @@ -704,6 +715,9 @@ describe('App.MainAdminStackAndUpgradeController', function() { it('status is ABORTED', function () { expect(groups[1].get('status')).to.equal('ABORTED'); }); + it('display_status is ABORTED', function () { + expect(groups[1].get('display_status')).to.equal('ABORTED'); + }); it('progress_percent is 50', function () { expect(groups[1].get('progress_percent')).to.equal(50); }); @@ -713,6 +727,9 @@ describe('App.MainAdminStackAndUpgradeController', function() { it('upgradeItems.[].status = ["ABORTED", "PENDING"]', function () { expect(groups[1].get('upgradeItems').mapProperty('status')).to.eql(['ABORTED', 'PENDING']); }); + it('upgradeItems.[].display_status = ["ABORTED", "PENDING"]', function () { + expect(groups[1].get('upgradeItems').mapProperty('display_status')).to.eql(['ABORTED', 'PENDING']); + }); it('upgradeItems.[].progress_percent = [99, 0]', function () { expect(groups[1].get('upgradeItems').mapProperty('progress_percent')).to.eql([99, 0]); });