ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yus...@apache.org
Subject git commit: AMBARI-7915. [Test] Fix ambari-web unit tests in branch-windows-dev to succeed on linux. (Jayush Luniya via yusaku)
Date Mon, 27 Oct 2014 17:09:33 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-windows-dev 5ea4f64e3 -> 8a67f749c


AMBARI-7915. [Test] Fix ambari-web unit tests in branch-windows-dev to succeed on linux. (Jayush
Luniya via yusaku)


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

Branch: refs/heads/branch-windows-dev
Commit: 8a67f749c1499e38a2ff2c9ba159e36940696d28
Parents: 5ea4f64
Author: Yusaku Sako <yusaku@hortonworks.com>
Authored: Mon Oct 27 10:08:57 2014 -0700
Committer: Yusaku Sako <yusaku@hortonworks.com>
Committed: Mon Oct 27 10:08:57 2014 -0700

----------------------------------------------------------------------
 ambari-web/app/app.js                           |  4 +-
 .../app/controllers/main/charts/heatmap.js      | 15 ----
 .../app/controllers/wizard/step3_controller.js  | 20 +++---
 ambari-web/app/models/stack_service.js          | 20 +++++-
 ambari-web/app/views/main/dashboard/widgets.js  |  9 ++-
 ambari-web/pom.xml                              | 73 ++++++--------------
 .../test/views/main/dashboard/widgets_test.js   | 23 +++++-
 7 files changed, 81 insertions(+), 83 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/8a67f749/ambari-web/app/app.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/app.js b/ambari-web/app/app.js
index bbaa690..adfd447 100644
--- a/ambari-web/app/app.js
+++ b/ambari-web/app/app.js
@@ -79,14 +79,14 @@ module.exports = Em.Application.create({
   currentStackVersion: '',
   currentStackName: function() {
     return Em.get((this.get('currentStackVersion') || this.get('defaultStackVersion')).match(/(.+)-\d.+/),
'1');
-  }.property('currentStackVersion'),
+  }.property('currentStackVersion', 'defaultStackVersion'),
 
   allHostNames: [],
 
   currentStackVersionNumber: function () {
     var regExp = new RegExp(this.get('currentStackName') + '-');
     return (this.get('currentStackVersion') || this.get('defaultStackVersion')).replace(regExp,
'');
-  }.property('currentStackVersion', 'currentStackName'),
+  }.property('currentStackVersion', 'defaultStackVersion', 'currentStackName'),
 
   isHadoop2Stack: function () {
     var result = true;

http://git-wip-us.apache.org/repos/asf/ambari/blob/8a67f749/ambari-web/app/controllers/main/charts/heatmap.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/charts/heatmap.js b/ambari-web/app/controllers/main/charts/heatmap.js
index f3f805c..324be13 100644
--- a/ambari-web/app/controllers/main/charts/heatmap.js
+++ b/ambari-web/app/controllers/main/charts/heatmap.js
@@ -66,21 +66,6 @@ App.MainChartsHeatmapController = Em.Controller.extend({
       );
     }
 
-    if (App.HDFSService.find().get('length')) {
-      metrics.push(
-        Em.Object.create({
-          label: Em.I18n.t('charts.heatmap.category.hdfs'),
-          category: 'hdfs',
-          items: [
-            App.MainChartHeatmapDFSBytesReadMetric.create(),
-            App.MainChartHeatmapDFSBytesWrittenMetric.create(),
-            App.MainChartHeatmapDFSGCTimeMillisMetric.create(),
-            App.MainChartHeatmapDFSMemHeapUsedMetric.create()
-          ]
-        })
-      );
-    }
-
     if (App.MapReduceService.find().get('length')) {
       metrics.push(
         Em.Object.create({

http://git-wip-us.apache.org/repos/asf/ambari/blob/8a67f749/ambari-web/app/controllers/wizard/step3_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step3_controller.js b/ambari-web/app/controllers/wizard/step3_controller.js
index 6de91c3..783d65c 100644
--- a/ambari-web/app/controllers/wizard/step3_controller.js
+++ b/ambari-web/app/controllers/wizard/step3_controller.js
@@ -990,15 +990,15 @@ App.WizardStep3Controller = Em.Controller.extend({
         }
       }
     });
-//    if (hostsContext.length > 0) { // repository warning exist
-//      repoWarnings.push({
-//        name: Em.I18n.t('installer.step3.hostWarningsPopup.repositories.name'),
-//        hosts: hostsContext,
-//        hostsNames: hostsRepoNames,
-//        category: 'repositories',
-//        onSingleHost: false
-//      });
-//    }
+    if (hostsContext.length > 0) { // repository warning exist
+      repoWarnings.push({
+        name: Em.I18n.t('installer.step3.hostWarningsPopup.repositories.name'),
+        hosts: hostsContext,
+        hostsNames: hostsRepoNames,
+        category: 'repositories',
+        onSingleHost: false
+      });
+    }
     if (hostsDiskContext.length > 0) { // disk space warning exist
       diskWarnings.push({
         name: Em.I18n.t('installer.step3.hostWarningsPopup.disk.name'),
@@ -1018,7 +1018,7 @@ App.WizardStep3Controller = Em.Controller.extend({
       });
     }
 
-//    this.set('repoCategoryWarnings', repoWarnings);
+    this.set('repoCategoryWarnings', repoWarnings);
     this.set('diskCategoryWarnings', diskWarnings);
     this.set('thpCategoryWarnings', thpWarnings);
     this.stopRegistration();

http://git-wip-us.apache.org/repos/asf/ambari/blob/8a67f749/ambari-web/app/models/stack_service.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/stack_service.js b/ambari-web/app/models/stack_service.js
index 2c94a43..0f036e9 100644
--- a/ambari-web/app/models/stack_service.js
+++ b/ambari-web/app/models/stack_service.js
@@ -151,7 +151,7 @@ App.StackService = DS.Model.extend({
   }.property('configTypes'),
 
   customReviewHandler: function () {
-    return App.StackService.reviewPageHandlers[this.get('serviceName')];
+    return App.get('isHadoopWindowsStack')? App.StackService.reviewWindowsPageHandlers[this.get('serviceName')]
: App.StackService.reviewPageHandlers[this.get('serviceName')];
   }.property('serviceName'),
   //TODO after moving validation/recommendation to BE defaultsProviders must be deleted
   defaultsProviders: function () {
@@ -223,6 +223,18 @@ App.StackService.reviewPageHandlers = {
   'HIVE': {
     'Database': 'loadHiveDbValue'
   },
+  'NAGIOS': {
+    'Administrator': 'loadNagiosAdminValue'
+  },
+  'OOZIE': {
+    'Database': 'loadOozieDbValue'
+  }
+};
+
+App.StackService.reviewWindowsPageHandlers = {
+  'HIVE': {
+    'Database': 'loadHiveDbValue'
+  },
   'HDFS': {
     'Database': 'loadSinkDbValue'
   },
@@ -247,8 +259,12 @@ App.StackService.configCategories = function () {
   var serviceConfigCategories = [];
   switch (this.get('serviceName')) {
     case 'HDFS':
+      if (App.get('isHadoopWindowsStack')) {
+        serviceConfigCategories.pushObjects([
+          App.ServiceConfigCategory.create({ name: 'MetricsSink', displayName: 'Metrics Sink'})
+        ]);
+      }
       serviceConfigCategories.pushObjects([
-        App.ServiceConfigCategory.create({ name: 'MetricsSink', displayName: 'Metrics Sink'}),
         App.ServiceConfigCategory.create({ name: 'NAMENODE', displayName: 'NameNode'}),
         App.ServiceConfigCategory.create({ name: 'SECONDARY_NAMENODE', displayName: 'Secondary
NameNode'}),
         App.ServiceConfigCategory.create({ name: 'DATANODE', displayName: 'DataNode'}),

http://git-wip-us.apache.org/repos/asf/ambari/blob/8a67f749/ambari-web/app/views/main/dashboard/widgets.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/dashboard/widgets.js b/ambari-web/app/views/main/dashboard/widgets.js
index c413423..bce957b 100644
--- a/ambari-web/app/views/main/dashboard/widgets.js
+++ b/ambari-web/app/views/main/dashboard/widgets.js
@@ -100,6 +100,9 @@ App.MainDashboardWidgetsView = Em.View.extend(App.UserPref, App.LocalStorage,
{
   setWidgetsDataModel: function () {
     var services = App.Service.find();
     var self = this;
+    if(App.get('services.hostMetrics').length > 0) {
+      self.set('host_metrics_model', App.get('services.hostMetrics'));
+    }
     services.forEach(function (item) {
       switch (item.get('serviceName')) {
         case "HDFS":
@@ -142,7 +145,7 @@ App.MainDashboardWidgetsView = Em.View.extend(App.UserPref, App.LocalStorage,
{
     var hiddenFull = [['22','Region In Transition']];
 
     // Display widgets for host metrics if the stack definition has a host metrics service
to display it.
-    if(App.get('services.hostMetrics').length == 0) {
+    if (this.get('host_metrics_model') == null) {
       var hostMetrics = ['11', '12', '13', '14'];
       hostMetrics.forEach ( function (item) {
         visibleFull = visibleFull.without(item);
@@ -191,6 +194,8 @@ App.MainDashboardWidgetsView = Em.View.extend(App.UserPref, App.LocalStorage,
{
     obj.set('hidden', hiddenFull);
   },
 
+  host_metrics_model: null,
+
   hdfs_model: null,
 
   mapreduce_model: null,
@@ -394,7 +399,7 @@ App.MainDashboardWidgetsView = Em.View.extend(App.UserPref, App.LocalStorage,
{
     }
 
     // Display widgets for host metrics if the stack definition has a host metrics service
to display it.
-    if(App.get('services.hostMetrics').length) {
+    if (this.get('host_metrics_model') != null) {
       var hostMetrics = ['11', '12', '13', '14'];
       var flag = self.containsWidget(toDelete, hostMetrics[0]);
       if (flag) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/8a67f749/ambari-web/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-web/pom.xml b/ambari-web/pom.xml
index 39fcbba..294e60f 100644
--- a/ambari-web/pom.xml
+++ b/ambari-web/pom.xml
@@ -98,17 +98,12 @@
             <configuration>
               <target name="ambari-web-clean">
                 <exec dir="${basedir}" executable="${executable.rmdir}">
-                  <arg value="${args.rm.1}"/>
-                  <arg value="${args.rm.2}"/>
-                  <arg value="${args.rm.3}"/>
-                  <arg value="${args.rm.4}"/>
+                  <arg value="${args.rm.clean}"/>
                   <arg value="public"/>
                   <arg value="node_modules"/>
                 </exec>
                 <exec dir="${basedir}" executable="${executable.mkdir}">
-                  <arg value="${args.mkdir.1}"/>
-                  <arg value="${args.mkdir.2}"/>
-                  <arg value="public"/>
+                  <arg value="${args.mkdir.clean}"/>
                 </exec>
               </target>
             </configuration>
@@ -121,40 +116,27 @@
             </goals>
             <configuration>
               <target name="ambari-web-compile">
-                <exec dir="${basedir}" executable="${executable.npm}">
-                  <env key="PYTHON" value="python2.6" />
-                  <arg value="${args.npm.1}"/>
-                  <arg value="${args.npm.2}"/>
-                  <arg value="install"/>
+                <exec dir="${basedir}" executable="${executable.npm}" failonerror="true">
+                  <arg value="${args.npm.install}"/>
                 </exec>
-                <exec dir="${basedir}" executable="${executable.brunch}">
-                  <arg value="${args.brunch.1}"/>
-                  <arg value="${args.brunch.2}"/>
-                  <arg value="build"/>
+                <exec dir="${basedir}" executable="${executable.brunch}" failonerror="true">
+                  <arg value="${args.brunch.build}"/>
                 </exec>
                 <!-- sets Ambari version to make it accessible from code -->
-                <exec dir="${basedir}" executable="${executable.shell}">
+                <exec dir="${basedir}" executable="${executable.shell}" failonerror="true">
                   <arg value="${basedir}${dirsep}set-ambari-version.${fileextension.shell}"/>
                   <arg value="${ambariVersion}"/>
                 </exec>
                 <!-- sets default stack and version to use for install -->
-                <exec dir="${basedir}" executable="${executable.shell}">
+                <exec dir="${basedir}" executable="${executable.shell}" failonerror="true">
                   <arg value="${basedir}${dirsep}set-default-stack-version.${fileextension.shell}"/>
                   <arg value="${defaultStackVersion}"/>
                 </exec>
                 <!-- enables experimental features if enableExperimental is set to true
-->
-                <exec dir="${basedir}" executable="${executable.shell}">
+                <exec dir="${basedir}" executable="${executable.shell}" failonerror="true">
                   <arg value="${basedir}${dirsep}toggle-experimental.${fileextension.shell}"/>
                   <arg value="${enableExperimental}"/>
                 </exec>
-                  <!--
-                <exec dir="${basedir}" executable="${executable.gzip}">
-                  <arg value="-f"/>
-                  <arg value="public/javascripts/app.js"/>
-                  <arg value="public/javascripts/vendor.js"/>
-                  <arg value="public/stylesheets/app.css"/>
-                </exec>
-                -->
               </target>
             </configuration>
           </execution>
@@ -166,15 +148,14 @@
             </goals>
             <configuration>
               <target name="ambari-web unit tests" unless="${skipTests}">
-                <exec dir="${basedir}" executable="npm" failonerror="true">
-                  <env key="PYTHON" value="${basedir}/../ambari-common/src/main/unix/ambari-python-wrap"
/>
-                  <arg value="test"/>
+                <exec dir="${basedir}" executable="${executable.npm}" failonerror="true">
+                  <arg value="${args.npm.test}"/>
                 </exec>
               </target>
             </configuration>
           </execution>
           <execution>
-            <id>gzip amabri-web content</id>
+            <id>gzip ambari-web content</id>
             <phase>prepare-package</phase>
             <goals>
               <goal>run</goal>
@@ -247,20 +228,15 @@
       <envClassifier>win</envClassifier>
       <dirsep>\</dirsep>
       <executable.brunch>cmd</executable.brunch>
-      <args.brunch.1>/C</args.brunch.1>
-      <args.brunch.2>brunch</args.brunch.2>
+      <args.brunch.build>/C brunch build</args.brunch.build>
       <executable.gzip>gzip</executable.gzip>
       <executable.mkdir>cmd</executable.mkdir>
-      <args.mkdir.1>/C</args.mkdir.1>
-      <args.mkdir.2>mkdir</args.mkdir.2>
+      <args.mkdir.clean>/C mkdir public</args.mkdir.clean>
       <executable.npm>cmd</executable.npm>
-      <args.npm.1>/C</args.npm.1>
-      <args.npm.2>npm</args.npm.2>
+      <args.npm.install>/C npm install</args.npm.install>
+      <args.npm.test>/C npm install</args.npm.test>
       <executable.rmdir>cmd</executable.rmdir>
-      <args.rm.1>/C</args.rm.1>
-      <args.rm.2>rmdir</args.rm.2>
-      <args.rm.3>/Q</args.rm.3>
-      <args.rm.4>/S</args.rm.4>
+      <args.rm.clean>/C rmdir /S /Q</args.rm.clean>
       <executable.shell>cmd</executable.shell>
       <fileextension.shell>cmd</fileextension.shell>
      </properties>
@@ -276,20 +252,15 @@
       <envClassifier>linux</envClassifier>
       <dirsep>/</dirsep>
       <executable.brunch>brunch</executable.brunch>
-      <args.brunch.1></args.brunch.1>
-      <args.brunch.2></args.brunch.2>
+      <args.brunch.build>build</args.brunch.build>
       <executable.gzip>gzip</executable.gzip>
       <executable.mkdir>mkdir</executable.mkdir>
-      <args.mkdir.1></args.mkdir.1>
-      <args.mkdir.2></args.mkdir.2>
+      <args.mkdir.clean>public</args.mkdir.clean>
       <executable.npm>npm</executable.npm>
-      <args.npm.1></args.npm.1>
-      <args.npm.2></args.npm.2>
+      <args.npm.install>install</args.npm.install>
+      <args.npm.test>test</args.npm.test>
       <executable.rmdir>rm</executable.rmdir>
-      <args.rm.1>-rf</args.rm.1>
-      <args.rm.2></args.rm.2>
-      <args.rm.3></args.rm.3>
-      <args.rm.4></args.rm.4>
+      <args.rm.clean>-rf</args.rm.clean>
       <executable.shell>sh</executable.shell>
       <fileextension.shell>sh</fileextension.shell>
      </properties>

http://git-wip-us.apache.org/repos/asf/ambari/blob/8a67f749/ambari-web/test/views/main/dashboard/widgets_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/dashboard/widgets_test.js b/ambari-web/test/views/main/dashboard/widgets_test.js
index fdd2b34..4fdd6cd 100644
--- a/ambari-web/test/views/main/dashboard/widgets_test.js
+++ b/ambari-web/test/views/main/dashboard/widgets_test.js
@@ -32,6 +32,7 @@ describe('App.MainDashboardWidgetsView', function() {
   });
 
   describe('#setInitPrefObject', function() {
+    var host_metrics_widgets_count = 4;
     var hdfs_widgets_count = 7;
     var mapreduce_widgets_count = 7;
     var hbase_widgets_count = 4;
@@ -40,19 +41,35 @@ describe('App.MainDashboardWidgetsView', function() {
     var tests = Em.A([
       {
         models: {
+          host_metrics_model: null,
           hdfs_model: null,
           mapreduce_model: null,
           hbase_model: null,
           yarn_model: null
         },
         e: {
-          visibleL: total_widgets_count - hdfs_widgets_count - mapreduce_widgets_count -
hbase_widgets_count - yarn_widgets_count - 1,
+          visibleL: total_widgets_count - host_metrics_widgets_count- hdfs_widgets_count
- mapreduce_widgets_count - hbase_widgets_count - yarn_widgets_count - 1,
           hiddenL: 0
         },
         m: 'All models are null'
       },
       {
         models: {
+          host_metrics_model: {},
+          hdfs_model: null,
+          mapreduce_model: null,
+          hbase_model: null,
+          yarn_model: null
+        },
+        e: {
+          visibleL: total_widgets_count - hdfs_widgets_count - mapreduce_widgets_count -
hbase_widgets_count - yarn_widgets_count - 1,
+          hiddenL: 0
+        },
+        m: 'hdfs_model, mapreduce_model, hbase_model, yarn_model are null'
+      },
+      {
+        models: {
+          host_metrics_model: {},
           hdfs_model: {},
           mapreduce_model: null,
           hbase_model: null,
@@ -66,6 +83,7 @@ describe('App.MainDashboardWidgetsView', function() {
       },
       {
         models: {
+          host_metrics_model: {},
           hdfs_model: {},
           mapreduce_model: {},
           hbase_model: null,
@@ -79,6 +97,7 @@ describe('App.MainDashboardWidgetsView', function() {
       },
       {
         models: {
+          host_metrics_model: {},
           hdfs_model: {},
           mapreduce_model: {},
           hbase_model: {},
@@ -92,6 +111,7 @@ describe('App.MainDashboardWidgetsView', function() {
       },
       {
         models: {
+          host_metrics_model: {},
           hdfs_model: {},
           mapreduce_model: {},
           hbase_model: {},
@@ -106,6 +126,7 @@ describe('App.MainDashboardWidgetsView', function() {
     ]);
     tests.forEach(function(test) {
       it(test.m, function() {
+        mainDashboardWidgetsView.set('host_metrics_model', test.models.host_metrics_model);
         mainDashboardWidgetsView.set('hdfs_model', test.models.hdfs_model);
         mainDashboardWidgetsView.set('mapreduce_model', test.models.mapreduce_model);
         mainDashboardWidgetsView.set('hbase_model', test.models.hbase_model);


Mime
View raw message