ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akovale...@apache.org
Subject ambari git commit: AMBARI-12167. Progress bar remains blue on deploy finish (akovalenko)
Date Thu, 09 Jul 2015 17:40:21 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 5b3d80fbd -> a2afed306


AMBARI-12167. Progress bar remains blue on deploy finish (akovalenko)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a2afed30
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a2afed30
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a2afed30

Branch: refs/heads/branch-2.1
Commit: a2afed3065d9e16f502d1b19c4df390c1b574126
Parents: 5b3d80f
Author: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Authored: Thu Jul 9 20:38:13 2015 +0300
Committer: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Committed: Thu Jul 9 20:38:13 2015 +0300

----------------------------------------------------------------------
 .../app/controllers/wizard/step9_controller.js  |  2 +-
 .../test/controllers/wizard/step9_test.js       | 98 +++++++++++++++-----
 2 files changed, 74 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a2afed30/ambari-web/app/controllers/wizard/step9_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step9_controller.js b/ambari-web/app/controllers/wizard/step9_controller.js
index e5b6c15..1dae93b 100644
--- a/ambari-web/app/controllers/wizard/step9_controller.js
+++ b/ambari-web/app/controllers/wizard/step9_controller.js
@@ -705,7 +705,7 @@ App.WizardStep9Controller = Em.Controller.extend(App.ReloadPopupMixin,
{
         progress = actionsPerHost ? (Math.ceil(((queuedActions * 0.09) + (inProgressActions
* 0.35) + completedActions ) / actionsPerHost * 33)) : 33;
         break;
       case 'INSTALLED':
-        progress = actionsPerHost ? (34 + Math.ceil(((queuedActions * 0.09) + (inProgressActions
* 0.35) + completedActions ) / actionsPerHost * 66)) : 100;
+        progress = actionsPerHost ? (33 + Math.floor(((queuedActions * 0.09) + (inProgressActions
* 0.35) + completedActions ) / actionsPerHost * 67)) : 100;
         break;
       default:
         progress = 100;

http://git-wip-us.apache.org/repos/asf/ambari/blob/a2afed30/ambari-web/test/controllers/wizard/step9_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/wizard/step9_test.js b/ambari-web/test/controllers/wizard/step9_test.js
index 71f35a6..80982cb 100644
--- a/ambari-web/test/controllers/wizard/step9_test.js
+++ b/ambari-web/test/controllers/wizard/step9_test.js
@@ -905,57 +905,105 @@ describe('App.InstallerStep9Controller', function () {
       {
         cluster: {status: 'PENDING'},
         host: Em.Object.create({progress: 0}),
-        actions: [
-          {Tasks: {status: 'COMPLETED'}},
-          {Tasks: {status: 'COMPLETED'}},
-          {Tasks: {status: 'QUEUED'}},
-          {Tasks: {status: 'QUEUED'}},
-          {Tasks: {status: 'IN_PROGRESS'}}
-        ],
-        e: {ret: 17, host: '17'},
+        actions: {
+          'COMPLETED': 2,
+          'QUEUED': 2,
+          'IN_PROGRESS': 1
+        },
+        e: {progress: 17},
         m: 'All types of status available. cluster status PENDING'
       },
       {
         cluster: {status: 'PENDING'},
         host: Em.Object.create({progress: 0}),
-        actions: [],
-        e: {ret: 33, host: '33'},
+        actions: {},
+        e: {progress: 33},
         m: 'No tasks available. cluster status PENDING'
       },
       {
         cluster: {status: 'INSTALLED'},
         host: Em.Object.create({progress: 0}),
-        actions: [],
-        e: {ret: 100, host: '100'},
+        actions: {},
+        e: {progress: 100},
         m: 'No tasks available. cluster status INSTALLED'
       },
       {
         cluster: {status: 'INSTALLED'},
         host: Em.Object.create({progress: 0}),
-        actions: [
-          {Tasks: {status: 'COMPLETED'}},
-          {Tasks: {status: 'COMPLETED'}},
-          {Tasks: {status: 'QUEUED'}},
-          {Tasks: {status: 'QUEUED'}},
-          {Tasks: {status: 'IN_PROGRESS'}}
-        ],
-        e: {ret: 68, host: '68'},
+        actions: {
+          'COMPLETED': 2,
+          'QUEUED': 2,
+          'IN_PROGRESS': 1
+        },
+        e: {progress: 66},
         m: 'All types of status available. cluster status INSTALLED'
       },
       {
         cluster: {status: 'FAILED'},
         host: Em.Object.create({progress: 0}),
-        actions: [],
-        e: {ret: 100, host: '100'},
+        actions: {},
+        e: {progress: 100},
         m: 'Cluster status is not PENDING or INSTALLED'
+      },
+      {
+        cluster: {status: 'INSTALLED'},
+        host: Em.Object.create({progress: 0}),
+        actions: {
+          'COMPLETED': 150,
+          'QUEUED': 0,
+          'IN_PROGRESS': 1
+        },
+        e: {progress: 99},
+        m: '150 tasks on host'
+      },
+      {
+        cluster: {status: 'INSTALLED'},
+        host: Em.Object.create({progress: 0}),
+        actions: {
+          'COMPLETED': 498,
+          'QUEUED': 1,
+          'IN_PROGRESS': 1
+        },
+        e: {progress: 99},
+        m: '500 tasks on host'
+      },
+      {
+        cluster: {status: 'INSTALLED'},
+        host: Em.Object.create({progress: 0}),
+        actions: {
+          'COMPLETED': 150,
+          'QUEUED': 0,
+          'IN_PROGRESS': 0
+        },
+        e: {progress: 100},
+        m: '100 tasks, 100 completed'
+      },
+      {
+        cluster: {status: 'INSTALLED'},
+        host: Em.Object.create({progress: 0}),
+        actions: {
+          'COMPLETED': 1,
+          'QUEUED': 0,
+          'IN_PROGRESS': 0
+        },
+        e: {progress: 100},
+        m: '1 task, 1 completed'
       }
     ]);
     tests.forEach(function (test) {
       it(test.m, function () {
+        var actions = [];
+        for (var prop in test.actions) {
+          if (test.actions.hasOwnProperty(prop) && test.actions[prop]) {
+            for (var i = 0; i < test.actions[prop]; i++) {
+              actions.push({Tasks: {status: prop}});
+            }
+          }
+        }
         c.reopen({content: {cluster: {status: test.cluster.status}}});
-        var progress = c.progressPerHost(test.actions, test.host);
-        expect(progress).to.equal(test.e.ret);
-        expect(test.host.progress).to.equal(test.e.host);
+        var progress = c.progressPerHost(actions, test.host);
+        expect(progress).to.equal(test.e.progress);
+        expect(test.host.progress).to.equal(test.e.progress.toString());
       });
     });
   });


Mime
View raw message