You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ja...@apache.org on 2016/12/13 01:09:00 UTC
ambari git commit: AMBARI-19165. Ambari-web unit tests cannot be run
in Mac OS Sierra. (jaimin)
Repository: ambari
Updated Branches:
refs/heads/branch-2.5 41838162f -> 3eb3dd340
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/3eb3dd34
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/3eb3dd34
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/3eb3dd34
Branch: refs/heads/branch-2.5
Commit: 3eb3dd34060a5a900136ecdd85ea2a1cc164f4ef
Parents: 4183816
Author: Jaimin Jetly <ja...@hortonworks.com>
Authored: Mon Dec 12 17:08:42 2016 -0800
Committer: Jaimin Jetly <ja...@hortonworks.com>
Committed: Mon Dec 12 17:08:42 2016 -0800
----------------------------------------------------------------------
ambari-web/app/assets/test/test.html | 1 +
ambari-web/package.json | 15 +++++++------
.../hawq/addStandby/step3_controller_test.js | 3 ++-
.../test/controllers/wizard/step9_test.js | 5 +++--
.../utils/configs/config_initializer_test.js | 19 ----------------
ambari-web/test/utils/date/date_test.js | 18 +++++++--------
ambari-web/test/utils/date/timezone_test.js | 2 +-
.../widgets/slider_config_widget_view_test.js | 23 --------------------
8 files changed, 24 insertions(+), 62 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/3eb3dd34/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/3eb3dd34/ambari-web/package.json
----------------------------------------------------------------------
diff --git a/ambari-web/package.json b/ambari-web/package.json
index ad0bce4..ea84abf 100644
--- a/ambari-web/package.json
+++ b/ambari-web/package.json
@@ -19,25 +19,26 @@
"cssstyle": "0.2.3"
},
"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.4.2",
"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-precompile-brunch": "^0.0.1"
},
"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/3eb3dd34/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/3eb3dd34/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/3eb3dd34/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 d348055..ceed065 100644
--- a/ambari-web/test/utils/configs/config_initializer_test.js
+++ b/ambari-web/test/utils/configs/config_initializer_test.js
@@ -950,23 +950,4 @@ describe('App.ConfigInitializer', function () {
});
});
-
- describe('winReplacersMap', function () {
-
- var winReplacersMap = App.ConfigInitializer.get('winReplacersMap');
- var winReplacerNames = Em.keys(winReplacersMap).map(function (key) {
- return winReplacersMap[key];
- });
-
- it('should contains only unique methods', function () {
- expect(winReplacerNames.length).to.equal(winReplacerNames.uniq().length);
- });
-
- winReplacerNames.forEach(function (name) {
- it(name, function () {
- expect(App.ConfigInitializer[name]).to.be.a.function;
- });
- });
- });
-
});
http://git-wip-us.apache.org/repos/asf/ambari/blob/3eb3dd34/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/3eb3dd34/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 () {
http://git-wip-us.apache.org/repos/asf/ambari/blob/3eb3dd34/ambari-web/test/views/common/configs/widgets/slider_config_widget_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/common/configs/widgets/slider_config_widget_view_test.js b/ambari-web/test/views/common/configs/widgets/slider_config_widget_view_test.js
index a6b25ce..5cc055c 100644
--- a/ambari-web/test/views/common/configs/widgets/slider_config_widget_view_test.js
+++ b/ambari-web/test/views/common/configs/widgets/slider_config_widget_view_test.js
@@ -636,29 +636,6 @@ describe('App.SliderConfigWidgetView', function () {
expect(viewInt.get('issueMessage')).to.equal('');
});
- describe('llap_queue_capacity property', function() {
- beforeEach(function() {
- viewInt.set('config.name', 'llap_queue_capacity');
- });
- it('should validate and warn about llap issue when value is 100%', function() {
- viewInt.set('config.stackConfigProperty.valueAttributes.maximum', 100);
- viewInt.set('config.value', '100');
- viewInt.set('config.errorMessage', '');
- viewInt.set('config.warnMessage', '');
- viewInt.set('config.widgetType', 'slider');
- assert.isTrue(viewInt.isValueCompatibleWithWidget(), 'value should be compatible with widget');
- assert.equal(viewInt.get('config.warnMessage'), Em.I18n.t('config.warnMessage.llap_queue_capacity.max'), 'warn message validation');
- });
-
- it('should pass validation because llap < 100', function() {
- viewInt.set('config.stackConfigProperty.valueAttributes.maximum', 100);
- viewInt.set('config.value', '99');
- viewInt.set('config.errorMessage', '');
- viewInt.set('config.warnMessage', '');
- assert.isTrue(viewInt.isValueCompatibleWithWidget(), 'value should be compatible with widget');
- assert.equal(viewInt.get('config.warnMessage'), '', 'warn message validation');
- });
- });
});
describe('#formatTickLabel', function () {