ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From onechipore...@apache.org
Subject ambari git commit: AMBARI-12721. Assign Slaves and Clients. Table timings issue (onechiporenko)
Date Tue, 11 Aug 2015 14:55:04 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk ff953625b -> 6cd51d246


AMBARI-12721. Assign Slaves and Clients. Table timings issue (onechiporenko)


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

Branch: refs/heads/trunk
Commit: 6cd51d24602973d4ec37a530fb4b89b6b1320788
Parents: ff95362
Author: Oleg Nechiporenko <onechiporenko@apache.org>
Authored: Tue Aug 11 17:48:27 2015 +0300
Committer: Oleg Nechiporenko <onechiporenko@apache.org>
Committed: Tue Aug 11 17:54:47 2015 +0300

----------------------------------------------------------------------
 .../app/controllers/wizard/step6_controller.js  |  21 +-
 ambari-web/app/mixins/common/blueprint.js       |  10 +-
 ambari-web/app/templates/wizard/step6.hbs       |  36 +--
 ambari-web/app/utils/blueprint.js               | 219 ++++++++++++++-----
 ambari-web/app/views/wizard/step6_view.js       |  34 ++-
 ambari-web/test/utils/blueprint_test.js         |  37 ----
 ambari-web/test/views/wizard/step6_view_test.js |   9 +-
 7 files changed, 217 insertions(+), 149 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6cd51d24/ambari-web/app/controllers/wizard/step6_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step6_controller.js b/ambari-web/app/controllers/wizard/step6_controller.js
index 8934d06..a714908 100644
--- a/ambari-web/app/controllers/wizard/step6_controller.js
+++ b/ambari-web/app/controllers/wizard/step6_controller.js
@@ -532,9 +532,6 @@ App.WizardStep6Controller = Em.Controller.extend(App.BlueprintMixin, {
   callServerSideValidation: function (successCallback) {
     var self = this;
 
-    // We do not want to disable Next due to server validation issues - hence commented out
line below
-    // self.set('submitDisabled', true);
-
     var selectedServices = App.StackService.find().filterProperty('isSelected').mapProperty('serviceName');
     var installedServices = App.StackService.find().filterProperty('isInstalled').mapProperty('serviceName');
     var services = installedServices.concat(selectedServices).uniq();
@@ -552,9 +549,11 @@ App.WizardStep6Controller = Em.Controller.extend(App.BlueprintMixin,
{
       var invisibleMasters = [];
       if (this.get('isInstallerWizard')) {
         invisibleMasters = App.StackServiceComponent.find().filterProperty("isMaster").filterProperty("isShownOnInstallerAssignMasterPage",
false).mapProperty("componentName");
-      } else if (this.get('isAddServiceWizard')) {
-        invisibleMasters = App.StackServiceComponent.find().filterProperty("isMaster").filterProperty("isShownOnAddServiceAssignMasterPage",
false).mapProperty("componentName");
       }
+      else
+        if (this.get('isAddServiceWizard')) {
+          invisibleMasters = App.StackServiceComponent.find().filterProperty("isMaster").filterProperty("isShownOnAddServiceAssignMasterPage",
false).mapProperty("componentName");
+        }
 
       var selectedClientComponents = self.get('content.clients').mapProperty('component_name');
       var alreadyInstalledClients = App.get('components.clients').reject(function (c) {
@@ -565,16 +564,18 @@ App.WizardStep6Controller = Em.Controller.extend(App.BlueprintMixin,
{
 
       var invisibleBlueprint = blueprintUtils.filterByComponents(this.get('content.recommendations'),
invisibleComponents);
       masterBlueprint = blueprintUtils.mergeBlueprints(masterBlueprint, invisibleBlueprint);
-    } else if (this.get('isAddHostWizard')) {
-      masterBlueprint = self.getCurrentMasterSlaveBlueprint();
-      hostNames = hostNames.concat(App.Host.find().mapProperty("hostName")).uniq();
-      slaveBlueprint = blueprintUtils.addComponentsToBlueprint(slaveBlueprint, invisibleSlavesAndClients);
     }
+    else
+      if (this.get('isAddHostWizard')) {
+        masterBlueprint = self.getCurrentMasterSlaveBlueprint();
+        hostNames = hostNames.concat(App.Host.find().mapProperty("hostName")).uniq();
+        slaveBlueprint = blueprintUtils.addComponentsToBlueprint(slaveBlueprint, invisibleSlavesAndClients);
+      }
 
     var bluePrintsForValidation = blueprintUtils.mergeBlueprints(masterBlueprint, slaveBlueprint);
     this.set('content.recommendationsHostGroups', bluePrintsForValidation);
 
-    App.ajax.send({
+    return App.ajax.send({
       name: 'config.validations',
       sender: self,
       data: {

http://git-wip-us.apache.org/repos/asf/ambari/blob/6cd51d24/ambari-web/app/mixins/common/blueprint.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/common/blueprint.js b/ambari-web/app/mixins/common/blueprint.js
index 938fca9..4889b3d 100644
--- a/ambari-web/app/mixins/common/blueprint.js
+++ b/ambari-web/app/mixins/common/blueprint.js
@@ -53,16 +53,16 @@ App.BlueprintMixin = Em.Mixin.create({
   },
 
   /**
-   * returns blueprint for all currenlty installed slave and client components
+   * Returns blueprint for all currently installed slave and client components
    */
   getCurrentSlaveBlueprint: function () {
     var self = this;
     var fullBlueprint = self.getCurrentMasterSlaveBlueprint();
 
-    var slaveComponents = App.StackServiceComponent.find().filterProperty("isSlave").mapProperty("componentName");
-    var clientComponents = App.StackServiceComponent.find().filterProperty("isClient").mapProperty("componentName");
-    var slaveAndClientComponents = slaveComponents.concat(clientComponents);
+    var components = App.StackServiceComponent.find().filter(function (c) {
+      return c.get('isSlave') || c.get('isClient');
+    }).mapProperty("componentName");
 
-    return blueprintUtils.filterByComponents(fullBlueprint, slaveAndClientComponents);
+    return blueprintUtils.filterByComponents(fullBlueprint, components);
   }
 });
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/6cd51d24/ambari-web/app/templates/wizard/step6.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/wizard/step6.hbs b/ambari-web/app/templates/wizard/step6.hbs
index 215dc2b..29ed76c 100644
--- a/ambari-web/app/templates/wizard/step6.hbs
+++ b/ambari-web/app/templates/wizard/step6.hbs
@@ -17,15 +17,15 @@
 }}
 
 <div id="step6">
-  <h2>{{view.title}}</h2>
+  <h2>{{t installer.step6.header}}</h2>
 
   <div class="alert alert-info">{{{view.label}}}</div>
   {{#if anyGeneralIssues}}
-  <div class="alert alert-error">
-    {{t installer.step6.validationSlavesAndClients.hasIssues}}
-    <a href="javascript:void(null);" {{action openSlavesAndClientsIssues target="controller"}}>{{t
installer.step6.validationSlavesAndClients.click}}</a>
-    {{t installer.step6.validationSlavesAndClients.forDetails}}
-  </div>
+    <div class="alert alert-error">
+      {{t installer.step6.validationSlavesAndClients.hasIssues}}
+      <a href="javascript:void(null);" {{action openSlavesAndClientsIssues target="controller"}}>{{t
installer.step6.validationSlavesAndClients.click}}</a>
+      {{t installer.step6.validationSlavesAndClients.forDetails}}
+    </div>
   {{/if}}
 
   <div class="pre-scrollable">
@@ -46,7 +46,6 @@
       </tr>
       </thead>
       <tbody>
-      {{#if view.pageContent}}
         {{#each host in view.pageContent}}
           <tr>
             {{#view App.WizardStep6HostView hostBinding="host" }}
@@ -64,18 +63,19 @@
               </td>
             {{/each}}
           </tr>
-          <tr {{bindAttr class="host.anyMessage::hidden"}}>
-            <td {{bindAttr colspan="view.columnCount"}} class="no-borders">
-              {{#each errorMsg in host.errorMessages}}
-                  <div class="alert alert-error">{{errorMsg}}</div>
-              {{/each}}
-              {{#each warnMsg in host.warnMessages}}
-                <div class="alert alert-warning">{{warnMsg}}</div>
-              {{/each}}
-            </td>
-          </tr>
+          {{#if host.anyMessage}}
+            <tr>
+              <td {{bindAttr colspan="view.columnCount"}} class="no-borders">
+                {{#each errorMsg in host.errorMessages}}
+                    <div class="alert alert-error">{{errorMsg}}</div>
+                {{/each}}
+                {{#each warnMsg in host.warnMessages}}
+                  <div class="alert alert-warning">{{warnMsg}}</div>
+                {{/each}}
+              </td>
+            </tr>
+          {{/if}}
         {{/each}}
-      {{/if}}
       </tbody>
     </table>
   </div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/6cd51d24/ambari-web/app/utils/blueprint.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/blueprint.js b/ambari-web/app/utils/blueprint.js
index 6ccd86c..687c7fd 100644
--- a/ambari-web/app/utils/blueprint.js
+++ b/ambari-web/app/utils/blueprint.js
@@ -17,17 +17,23 @@
  */
 
 module.exports = {
+
   mergeBlueprints: function(masterBlueprint, slaveBlueprint) {
+    console.time('mergeBlueprints');
     var self = this;
 
     // Check edge cases
     if (!slaveBlueprint && !masterBlueprint) {
       throw 'slaveBlueprint or masterBlueprint should not be empty';
-    } else if (slaveBlueprint && !masterBlueprint) {
-      return slaveBlueprint;
-    } else if (!slaveBlueprint && masterBlueprint) {
-      return masterBlueprint;
     }
+    else
+      if (slaveBlueprint && !masterBlueprint) {
+        return slaveBlueprint;
+      }
+      else
+        if (!slaveBlueprint && masterBlueprint) {
+          return masterBlueprint;
+        }
 
     // Work with main case (both blueprint are presented)
     var matches = self.matchGroups(masterBlueprint, slaveBlueprint);
@@ -37,53 +43,109 @@ module.exports = {
       blueprint_cluster_binding: { host_groups: [] }
     };
 
-    matches.forEach(function(match, i){
-      var group_name = 'host-group-' + (i+1);
+    var tmpObj = {hosts: [], components: []};
+    var masterBluePrintHostGroupsCluster = this.blueprintToObject(masterBlueprint, 'blueprint_cluster_binding.host_groups');
+    var slaveBluePrintHostGroupsCluster = this.blueprintToObject(slaveBlueprint, 'blueprint_cluster_binding.host_groups');
+    var masterBluePrintHostGroupsBlueprint = this.blueprintToObject(masterBlueprint, 'blueprint.host_groups');
+    var slaveBluePrintHostGroupsBlueprint = this.blueprintToObject(slaveBlueprint, 'blueprint.host_groups');
 
-      var masterComponents = self.getComponentsFromBlueprintByGroupName(masterBlueprint,
match.g1);
-      var slaveComponents = self.getComponentsFromBlueprintByGroupName(slaveBlueprint, match.g2);
+    matches.forEach(function (match, i) {
+      var group_name = 'host-group-' + (i + 1);
+
+      var masterComponents = match.g1 ? Em.getWithDefault(masterBluePrintHostGroupsBlueprint,
match.g1, tmpObj).components : [];
+      var slaveComponents = match.g2 ? Em.getWithDefault(slaveBluePrintHostGroupsBlueprint,
match.g2, tmpObj).components : [];
 
       res.blueprint.host_groups.push({
         name: group_name,
         components: masterComponents.concat(slaveComponents)
       });
 
+      var hosts = match.g1 ? Em.getWithDefault(masterBluePrintHostGroupsCluster, match.g1,
tmpObj).hosts :
+        Em.getWithDefault(slaveBluePrintHostGroupsCluster, match.g2, tmpObj).hosts;
+
       res.blueprint_cluster_binding.host_groups.push({
         name: group_name,
-        hosts: self.getHostsFromBlueprintByGroupName(match.g1 ? masterBlueprint : slaveBlueprint,
match.g1 ? match.g1 : match.g2)
+        hosts: hosts
       });
     });
+    console.timeEnd('mergeBlueprints');
     return res;
   },
 
-  getHostsFromBlueprint: function(blueprint) {
-    return blueprint.blueprint_cluster_binding.host_groups.mapProperty("hosts").reduce(function(prev,
curr){ return prev.concat(curr); }, []).mapProperty("fqdn");
-  },
-
-  getHostsFromBlueprintByGroupName: function(blueprint, groupName) {
-    if (groupName) {
-      var group = blueprint.blueprint_cluster_binding.host_groups.find(function(g) {
-        return g.name === groupName;
-      });
-
-      if (group) {
-        return group.hosts;
-      }
-    }
-    return [];
-  },
-
-  getComponentsFromBlueprintByGroupName: function(blueprint, groupName) {
-    if (groupName) {
-      var group = blueprint.blueprint.host_groups.find(function(g) {
-        return g.name === groupName;
-      });
-
-      if (group) {
-        return group.components;
-      }
+  /**
+   * Convert <code>blueprint</code>-object to the array with keys equal to the
host-groups names
+   * Used to improve performance when user try to search value in the blueprint using host-group
name as search-field
+   * Example:
+   *  Before:
+   *  <pre>
+   *    // blueprint
+   *    {
+   *      blueprint: {
+   *        host_groups: [
+   *          {
+   *            components: [{}, {}, ...],
+   *            name: 'n1'
+   *          },
+   *          {
+   *            components: [{}, {}, ...],
+   *            name: 'n2'
+   *          }
+   *        ]
+   *      },
+   *      blueprint_cluster_binding: {
+   *        host_groups: [
+   *          {
+   *            hosts: [{}, {}, ...],
+   *            name: 'n1'
+   *          },
+   *          {
+   *            hosts: [{}, {}, ...],
+   *            name: 'n2'
+   *          }
+   *        ]
+   *      }
+   *    }
+   *  </pre>
+   *  Return:
+   *  <pre>
+   *    // field = 'blueprint_cluster_binding.host_groups'
+   *    {
+   *      n1: {
+   *        hosts: [{}, {}, ...],
+   *        name: 'n1'
+   *      },
+   *      n2: {
+   *        hosts: [{}, {}, ...],
+   *        name: 'n2'
+   *      }
+   *    }
+   *
+   *    // field = 'blueprint.host_groups'
+   *    {
+   *      n1: {
+   *        components: [{}, {}, ...],
+   *        name: 'n1'
+   *      },
+   *      n2: {
+   *        components: [{}, {}, ...],
+   *        name: 'n2'
+   *      }
+   *    }
+   *  </pre>
+   * @param {object} blueprint
+   * @param {string} field
+   * @returns {object}
+   */
+  blueprintToObject: function(blueprint, field) {
+    var ret = {};
+    var valueToMap = Em.get(blueprint, field);
+    if (!Array.isArray(valueToMap)) {
+      return ret;
     }
-    return [];
+    valueToMap.forEach(function(n) {
+      ret[Em.get(n, 'name')] = n;
+    });
+    return ret;
   },
 
   matchGroups: function(masterBlueprint, slaveBlueprint) {
@@ -103,6 +165,7 @@ module.exports = {
   },
 
   matchGroupsWithLeft: function(groups1, groups2, groups1_used, groups2_used, res, inverse)
{
+    var gs2 = this.groupsToObject(groups2);
     for (var i = 0; i < groups1.length; i++) {
       if (groups1_used[i]) {
         continue;
@@ -111,20 +174,10 @@ module.exports = {
       var group1 = groups1[i];
       groups1_used[i] = true;
 
-      var group2 = groups2.find(function(g2, index) {
-        if (group1.hosts.length != g2.hosts.length) {
-          return false;
-        }
-
-        for (var gi = 0; gi < group1.hosts.length; gi++) {
-          if (group1.hosts[gi].fqdn != g2.hosts[gi].fqdn) {
-            return false;
-          }
-        }
-
-        groups2_used[index] = true;
-        return true;
-      });
+      var group2 = gs2[group1.hosts.mapProperty('fqdn').join(',')];
+      if (group2) {
+        groups2_used[group2.index] = true;
+      }
 
       var item = {};
 
@@ -133,7 +186,8 @@ module.exports = {
         if (group2) {
           item.g1 = group2.name;
         }
-      } else {
+      }
+      else {
         item.g1 = group1.name;
         if (group2) {
           item.g2 = group2.name;
@@ -141,12 +195,69 @@ module.exports = {
       }
       res.push(item);
     }
+
+    // remove unneeded property
+    groups2.forEach(function(group) {
+      delete group.index;
+    });
+  },
+
+  /**
+   * Convert array of objects to the one object to improve performance with searching objects
in the provided array
+   * Example:
+   *  Before:
+   *  <pre>
+   *    // groups
+   *    [
+   *      {
+   *        hosts: [
+   *          {fqdn: 'h1'}, {fqdn: 'h2'}
+   *        ],
+   *        name: 'n1'
+   *      },
+   *      {
+   *        hosts: [
+   *          {fqdn: 'h3'}, {fqdn: 'h4'}
+   *        ]
+   *      }
+   *    ]
+   *  </pre>
+   *  Return:
+   *  <pre>
+   *    {
+   *      'h1,h2': {
+   *        hosts: [
+   *          {fqdn: 'h1'}, {fqdn: 'h2'}
+   *        ],
+   *        name: 'n1',
+   *        index: 0
+   *      },
+   *      'h3,h4': {
+   *        hosts: [
+   *          {fqdn: 'h3'}, {fqdn: 'h4'}
+   *        ],
+   *        name: 'n2',
+   *        index: 1
+   *      }
+   *    }
+   *  </pre>
+   * @param {{hosts: object[], name: string}[]} groups
+   * @returns {object}
+   */
+  groupsToObject: function (groups) {
+    var ret = {};
+    groups.forEach(function (group, index) {
+      var key = group.hosts.mapProperty('fqdn').join(',');
+      ret[key] = group;
+      ret[key].index = index;
+    });
+    return ret;
   },
 
   /**
    * Remove from blueprint all components expect given components
-   * @param blueprint
-   * @param [string] components
+   * @param {object} blueprint
+   * @param {string[]} components
    */
   filterByComponents: function(blueprint, components) {
     if (!blueprint) {
@@ -178,7 +289,7 @@ module.exports = {
   },
 
   addComponentsToBlueprint: function(blueprint, components) {
-    var res = JSON.parse(JSON.stringify(blueprint))
+    var res = JSON.parse(JSON.stringify(blueprint));
 
     res.blueprint.host_groups.forEach(function(group) {
       components.forEach(function(component) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/6cd51d24/ambari-web/app/views/wizard/step6_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/wizard/step6_view.js b/ambari-web/app/views/wizard/step6_view.js
index 2c590b0..379912e 100644
--- a/ambari-web/app/views/wizard/step6_view.js
+++ b/ambari-web/app/views/wizard/step6_view.js
@@ -23,10 +23,8 @@ App.WizardStep6View = App.TableView.extend({
 
   templateName: require('templates/wizard/step6'),
 
-  title: '',
-
   /**
-   * Numbe rof visible rows
+   * Number of visible rows
    * @type {string}
    */
   displayLength: "25",
@@ -48,16 +46,12 @@ App.WizardStep6View = App.TableView.extend({
   }.property('content'),
 
   /**
-   * Set <code>label</code>, <code>title</code> and do <code>loadStep</code>
+   * Set <code>label</code> and do <code>loadStep</code>
    * @method didInsertElement
    */
   didInsertElement: function () {
-    var controller = this.get('controller');
-    this.set('title', Em.I18n.t('installer.step6.header'));
     this.setLabel();
-
-    App.tooltip($('body'), {selector: '[rel=tooltip]'});
-    controller.loadStep();
+    this.get('controller').loadStep();
   },
 
   /**
@@ -95,18 +89,14 @@ App.WizardStep6View = App.TableView.extend({
 
   columnCount: function() {
     var hosts = this.get('controller.hosts');
-    if  (hosts && hosts.length > 0) {
-      var checkboxes = hosts[0].get('checkboxes');
-      return checkboxes.length + 1;
-    }
-    return 1;
+    return (hosts && hosts.length > 0) ? hosts[0].get('checkboxes').length + 1
: 1;
   }.property('controller.hosts.@each.checkboxes')
 });
 
 App.WizardStep6HostView = Em.View.extend({
 
   /**
-   * Binded <code>host</code> object
+   * Bound <code>host</code> object
    * @type {object}
    */
   host: null,
@@ -118,16 +108,18 @@ App.WizardStep6HostView = Em.View.extend({
    * @method didInsertElement
    */
   didInsertElement: function () {
-    var components = this.get('controller').getMasterComponentsForHost(this.get('host.hostName'));
-    components = components.map(function (_component) {
-      return App.format.role(_component);
-    });
-    components = components.join(" /\n");
     App.popover(this.$(), {
       title: Em.I18n.t('installer.step6.wizardStep6Host.title').format(this.get('host.hostName')),
-      content: components,
+      content: this.get('controller').getMasterComponentsForHost(this.get('host.hostName')).map(function
(_component) {
+        return App.format.role(_component);
+      }).join("<br />"),
       placement: 'right',
       trigger: 'hover'
     });
+  },
+
+  willDestroyElement: function() {
+    this.$().popover('destroy');
   }
+
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/6cd51d24/ambari-web/test/utils/blueprint_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/utils/blueprint_test.js b/ambari-web/test/utils/blueprint_test.js
index cc6b932..29072a3 100644
--- a/ambari-web/test/utils/blueprint_test.js
+++ b/ambari-web/test/utils/blueprint_test.js
@@ -95,43 +95,6 @@ describe('utils/blueprint', function() {
     }
   };
 
-  describe('#getHostsFromBlueprint', function() {
-    it('should extract all hosts from blueprint', function() {
-      expect(blueprintUtils.getHostsFromBlueprint(masterBlueprint)).to.deep.equal(["host1",
"host2", "host3"]);
-    });
-  });
-
-  describe('#getHostsFromBlueprintByGroupName', function() {
-    it('should extract hosts from blueprint by given group name', function() {
-      expect(blueprintUtils.getHostsFromBlueprintByGroupName(masterBlueprint, "host-group-1")).to.deep.equal([
-        { fqdn: "host1" },
-        { fqdn: "host2" }
-      ]);
-    });
-
-    it('should return empty array if group with given name doesn\'t exist', function() {
-      expect(blueprintUtils.getHostsFromBlueprintByGroupName(masterBlueprint, "not an existing
group")).to.deep.equal([]);
-    });
-  });
-
-  describe('#getComponentsFromBlueprintByGroupName', function() {
-    it('should extract all components from blueprint for given host', function() {
-      expect(blueprintUtils.getComponentsFromBlueprintByGroupName(masterBlueprint, "host-group-1")).to.deep.equal([
-        { name: "ZOOKEEPER_SERVER" },
-        { name: "NAMENODE" },
-        { name: "HBASE_MASTER" }
-      ]);
-    });
-
-    it('should return empty array if group doesn\'t exists', function() {
-      expect(blueprintUtils.getComponentsFromBlueprintByGroupName(masterBlueprint, "not an
existing group")).to.deep.equal([]);
-    });
-
-    it('should return empty array if group name isn\'t valid', function() {
-      expect(blueprintUtils.getComponentsFromBlueprintByGroupName(masterBlueprint, undefined)).to.deep.equal([]);
-    });
-  });
-
   describe('#matchGroups', function() {
     it('should compose same host group into pairs', function() {
       expect(blueprintUtils.matchGroups(masterBlueprint, slaveBlueprint)).to.deep.equal([

http://git-wip-us.apache.org/repos/asf/ambari/blob/6cd51d24/ambari-web/test/views/wizard/step6_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/wizard/step6_view_test.js b/ambari-web/test/views/wizard/step6_view_test.js
index 082d153..b905a2d 100644
--- a/ambari-web/test/views/wizard/step6_view_test.js
+++ b/ambari-web/test/views/wizard/step6_view_test.js
@@ -50,29 +50,30 @@ describe('App.WizardStep6View', function() {
   });
 
   describe('#didInsertElement', function() {
+
     beforeEach(function() {
       sinon.stub(view.get('controller'), 'loadStep', Em.K);
       sinon.stub(App, 'tooltip', Em.K);
       sinon.stub(view, 'setLabel', Em.K);
     });
+
     afterEach(function() {
       view.get('controller').loadStep.restore();
       App.tooltip.restore();
       view.setLabel.restore();
     });
+
     it('should call loadStep', function() {
       view.didInsertElement();
       expect(view.get('controller').loadStep.calledOnce).to.equal(true);
     });
-    it('should create tooltip', function() {
-      view.didInsertElement();
-      expect(App.tooltip.calledOnce).to.equal(true);
-    });
+
     it('should call setLabel if not controller.isMasters', function() {
       view.set('controller.isMasters', false);
       view.didInsertElement();
       expect(view.setLabel.calledOnce).to.equal(true);
     });
+
   });
 
   describe('#setLabel', function() {


Mime
View raw message