Repository: ambari
Updated Branches:
  refs/heads/trunk b69bcc1f2 -> 79d743b9d


AMBARI-19165. Ambari-web unit tests cannot be run in Mac OS Sierra. (jaimin)


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

Branch: refs/heads/trunk
Commit: 79d743b9d14530106ef107611f58345fb7f2e93b
Parents: b69bcc1
Author: Jaimin Jetly <[email protected]>
Authored: Mon Dec 12 18:11:17 2016 -0800
Committer: Jaimin Jetly <[email protected]>
Committed: Mon Dec 12 18:11:17 2016 -0800

----------------------------------------------------------------------
 ambari-web/app/assets/test/test.html              |  1 +
 ambari-web/app/controllers/wizard.js              | 12 +++++++-----
 ambari-web/package.json                           | 15 ++++++++-------
 .../hawq/addStandby/step3_controller_test.js      |  3 ++-
 ambari-web/test/controllers/wizard/step9_test.js  |  5 +++--
 .../test/utils/configs/config_initializer_test.js |  1 -
 ambari-web/test/utils/date/date_test.js           | 18 +++++++++---------
 ambari-web/test/utils/date/timezone_test.js       |  2 +-
 8 files changed, 31 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/79d743b9/ambari-web/app/assets/test/test.html
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/test/test.html 
b/ambari-web/app/assets/test/test.html
index d8ee080..7b01f57 100644
--- a/ambari-web/app/assets/test/test.html
+++ b/ambari-web/app/assets/test/test.html
@@ -41,6 +41,7 @@
 <script>
     $.mocho = true;
     $.hostName = 'localhost:3333';
+    window.initMochaPhantomJS && window.initMochaPhantomJS();
     mocha.ui('bdd');
     mocha.reporter('html');
     expect = chai.expect;

http://git-wip-us.apache.org/repos/asf/ambari/blob/79d743b9/ambari-web/app/controllers/wizard.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard.js 
b/ambari-web/app/controllers/wizard.js
index 765f0cd..8742546 100644
--- a/ambari-web/app/controllers/wizard.js
+++ b/ambari-web/app/controllers/wizard.js
@@ -333,11 +333,13 @@ App.WizardController = 
Em.Controller.extend(App.LocalStorage, App.ThemesMappingM
 
     var hostInfo = this.getDBProperty('hosts');
     for (var index in hostInfo) {
-      hostInfo[index].status = "pending";
-      hostInfo[index].message = 'Waiting';
-      hostInfo[index].logTasks = [];
-      hostInfo[index].tasks = [];
-      hostInfo[index].progress = '0';
+      if (hostInfo.hasOwnProperty(index)) {
+        hostInfo[index].status = "pending";
+        hostInfo[index].message = 'Waiting';
+        hostInfo[index].logTasks = [];
+        hostInfo[index].tasks = [];
+        hostInfo[index].progress = '0';
+      }
     }
     this.setDBProperty('hosts', hostInfo);
   },

http://git-wip-us.apache.org/repos/asf/ambari/blob/79d743b9/ambari-web/package.json
----------------------------------------------------------------------
diff --git a/ambari-web/package.json b/ambari-web/package.json
index 5f2909e..ad3a9fa 100644
--- a/ambari-web/package.json
+++ b/ambari-web/package.json
@@ -21,25 +21,26 @@
     "assetsmanager-brunch": "~1.8.1"
   },
   "devDependencies": {
-    "phantomjs": "^1.9.2",
-    "mocha":"1.9.0",
-    "mocha-phantomjs": "~3.1.6",
-    "chai":"~1.9.0",
+    "phantomjs": "~2.1.0",
+    "mocha":"2.5.3",
+    "mocha-phantomjs": "~4.1.0",
+    "mocha-phantomjs-core": "~2.1.0",
+    "chai":"~3.5.0",
     "sinon":"=1.7.3",
-    "sinon-chai":"~2.5.0",
+    "sinon-chai":"~2.8.0",
     "express":"2.5.8",
     "karma": ">=0.11.14",
     "karma-mocha": "0.1.1",
     "karma-chai": "~0.1.0",
     "karma-sinon": "~1.0.2",
-    "karma-phantomjs-launcher": "0.1.3",
+    "karma-phantomjs-launcher": "1.0.2",
     "karma-coverage": "~0.2.0",
     "karma-commonjs-require": "~0.0.1",
     "karma-ember-precompiler-brunch": "^1.0.0"
   },
   "scripts": {
     "start": "brunch watch --server",
-    "test": "mocha-phantomjs -R min public/test/test.html"
+    "test": "mocha-phantomjs -R min -p ./node_modules/.bin/phantomjs 
public/test/test.html"
   },
   "engines": {
     "node": "^4.0.0"

http://git-wip-us.apache.org/repos/asf/ambari/blob/79d743b9/ambari-web/test/controllers/main/admin/highAvailability/hawq/addStandby/step3_controller_test.js
----------------------------------------------------------------------
diff --git 
a/ambari-web/test/controllers/main/admin/highAvailability/hawq/addStandby/step3_controller_test.js
 
b/ambari-web/test/controllers/main/admin/highAvailability/hawq/addStandby/step3_controller_test.js
index bd6a67a..2180248 100644
--- 
a/ambari-web/test/controllers/main/admin/highAvailability/hawq/addStandby/step3_controller_test.js
+++ 
b/ambari-web/test/controllers/main/admin/highAvailability/hawq/addStandby/step3_controller_test.js
@@ -82,6 +82,7 @@ describe('App.AddHawqStandbyWizardStep3Controller', function 
() {
 
     var cases = [
         {
+          'title': 'should set properties from load config success callback',
           'items': [
             {
               'type': 'hawq-site',
@@ -170,7 +171,7 @@ describe('App.AddHawqStandbyWizardStep3Controller', 
function () {
             newHawqStandby: 'h1'
           }
         })
-      })
+      });
       controller.setDynamicConfigValues(configs, data);
     });
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/79d743b9/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 b0c4c20..71b4915 100644
--- a/ambari-web/test/controllers/wizard/step9_test.js
+++ b/ambari-web/test/controllers/wizard/step9_test.js
@@ -629,7 +629,7 @@ describe('App.InstallerStep9Controller', function () {
       },
       {
         expected: [],
-        text: 'should return server info',
+        message: 'should return server info',
         controllerName: 'addServiceController',
         services: Em.A([
           Em.Object.create({
@@ -646,7 +646,7 @@ describe('App.InstallerStep9Controller', function () {
       },
       {
         expected: [],
-        text: 'should return default data',
+        message: 'should return default data',
         controllerName: 'addHostContro',
         hosts: Em.A([
           Em.Object.create({
@@ -1687,6 +1687,7 @@ describe('App.InstallerStep9Controller', function () {
     });
     Em.A([
         {
+          m: 'Launch start service after install services completed',
           jsonData: {Requests: {id: 2}},
           e: {
             hostHasClientsOnly: false,

http://git-wip-us.apache.org/repos/asf/ambari/blob/79d743b9/ambari-web/test/utils/configs/config_initializer_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/utils/configs/config_initializer_test.js 
b/ambari-web/test/utils/configs/config_initializer_test.js
index 544ab1d..ceed065 100644
--- a/ambari-web/test/utils/configs/config_initializer_test.js
+++ b/ambari-web/test/utils/configs/config_initializer_test.js
@@ -950,5 +950,4 @@ describe('App.ConfigInitializer', function () {
     });
 
   });
-
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/79d743b9/ambari-web/test/utils/date/date_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/utils/date/date_test.js 
b/ambari-web/test/utils/date/date_test.js
index 3d61c90..c82a02e 100644
--- a/ambari-web/test/utils/date/date_test.js
+++ b/ambari-web/test/utils/date/date_test.js
@@ -22,13 +22,13 @@ var date = require('utils/date/date');
 describe('date', function () {
 
   var incorrectTests = Em.A([
-    {t: null},
-    {t: ''},
-    {t: false},
-    {t: []},
-    {t: {}},
-    {t: undefined},
-    {t: function(){}}
+    {m: 'null', t: null},
+    {m: 'empty', t: ''},
+    {m: 'false', t: false},
+    {m:'[]' , t: []},
+    {m: '{}', t: {}},
+    {m: 'undefined', t: undefined},
+    {m: 'empty function', t: function(){}}
   ]);
 
   describe('#dateFormatZeroFirst()', function() {
@@ -88,7 +88,7 @@ describe('date', function () {
 
     describe('Correct data', function(){
       tests.forEach(function(test) {
-        it(test.t, function() {
+        it(test.i, function() {
           expect(date.timingFormat(test.i)).to.equal(test.e);
         });
       });
@@ -96,7 +96,7 @@ describe('date', function () {
 
     describe('Incorrect data', function(){
       incorrectTests.forEach(function(test) {
-        it(test.t, function() {
+        it(test.m, function() {
           expect(date.timingFormat(test.t)).to.equal(null);
         });
       });

http://git-wip-us.apache.org/repos/asf/ambari/blob/79d743b9/ambari-web/test/utils/date/timezone_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/utils/date/timezone_test.js 
b/ambari-web/test/utils/date/timezone_test.js
index da89586..37a8c8c 100644
--- a/ambari-web/test/utils/date/timezone_test.js
+++ b/ambari-web/test/utils/date/timezone_test.js
@@ -97,7 +97,7 @@ describe('timezoneUtils', function () {
     var result = timezoneUtils.getAllTimezoneNames();
 
     it('timezone names are parsed', function () {
-      expect(this.result).to.have.length.above(0);
+      expect(result).to.have.length.above(0);
     });
 
     describe('Etc/* are excluded', function () {

Reply via email to