You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zeppelin.apache.org by GitBox <gi...@apache.org> on 2018/12/25 19:35:47 UTC

[GitHub] felixcheung closed pull request #3235: [ZEPPELIN-3864] Fix Travis tests

felixcheung closed pull request #3235: [ZEPPELIN-3864] Fix Travis tests
URL: https://github.com/apache/zeppelin/pull/3235
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/pom.xml b/pom.xml
index 65844c10a0..b8758389ee 100644
--- a/pom.xml
+++ b/pom.xml
@@ -102,7 +102,7 @@
     <!-- frontend maven plugin related versions-->
     <node.version>v8.9.3</node.version>
     <npm.version>5.5.1</npm.version>
-    <plugin.frontend.version>1.4</plugin.frontend.version>
+    <plugin.frontend.version>1.6</plugin.frontend.version>
 
     <!-- common library versions -->
     <slf4j.version>1.7.10</slf4j.version>
diff --git a/zeppelin-web/e2e/searchBlock.spec.js b/zeppelin-web/e2e/searchBlock.spec.js
index 570673b838..a146e470bd 100644
--- a/zeppelin-web/e2e/searchBlock.spec.js
+++ b/zeppelin-web/e2e/searchBlock.spec.js
@@ -20,6 +20,8 @@ describe('Search block e2e Test', function() {
 
   beforeEach(function() {
     browser.get('http://localhost:8080')
+    browser.sleep(500);
+    waitVisibility(element(by.linkText('Create new note')))
     clickOn(element(by.linkText('Create new note')))
     waitVisibility(element(by.id('noteCreateModal')))
     clickAndWait(element(by.id('createNoteButton')))
diff --git a/zeppelin-web/package.json b/zeppelin-web/package.json
index 69248c6cb1..de83a629d0 100644
--- a/zeppelin-web/package.json
+++ b/zeppelin-web/package.json
@@ -22,7 +22,7 @@
     "pree2e": "webdriver-manager update --gecko false --versions.chrome=2.35",
     "e2e": "protractor protractor.conf.js",
     "pretest": "npm rebuild phantomjs-prebuilt",
-    "test": "karma start karma.conf.js"
+    "karma-test": "karma start karma.conf.js"
   },
   "dependencies": {
     "angular-ui-grid": "4.4.6",
@@ -78,15 +78,15 @@
     "html-webpack-plugin": "^3.2.0",
     "imports-loader": "^0.7.1",
     "istanbul-instrumenter-loader": "^0.2.0",
-    "jasmine-core": "^2.5.2",
-    "jasmine-spec-reporter": "^4.1.1",
-    "karma": "~1.3.0",
+    "jasmine-core": "^3.3.0",
+    "jasmine-spec-reporter": "^4.2.1",
+    "karma": "~3.1.3",
     "karma-coverage": "^1.1.2",
-    "karma-jasmine": "~1.0.2",
+    "karma-jasmine": "~2.0.1",
     "karma-phantomjs-launcher": "^1.0.4",
     "karma-sourcemap-loader": "^0.3.7",
     "karma-spec-reporter": "0.0.31",
-    "karma-webpack": "^1.8.1",
+    "karma-webpack": "^3.0.5",
     "load-grunt-tasks": "^0.4.0",
     "mini-css-extract-plugin": "^0.4.4",
     "ng-annotate-loader": "^0.2.0",
diff --git a/zeppelin-web/pom.xml b/zeppelin-web/pom.xml
index 498803bf7c..7de15dc43c 100644
--- a/zeppelin-web/pom.xml
+++ b/zeppelin-web/pom.xml
@@ -111,7 +111,7 @@
             <phase>test</phase>
             <configuration>
               <skip>${web.e2e.disabled}</skip>
-              <arguments>run test</arguments>
+              <arguments>run karma-test</arguments>
             </configuration>
           </execution>
 
diff --git a/zeppelin-web/src/app/notebook/notebook.controller.js b/zeppelin-web/src/app/notebook/notebook.controller.js
index 2f1437d5ea..426667d6c9 100644
--- a/zeppelin-web/src/app/notebook/notebook.controller.js
+++ b/zeppelin-web/src/app/notebook/notebook.controller.js
@@ -1579,14 +1579,16 @@ function NotebookCtrl($scope, $route, $routeParams, $location, $rootScope,
   });
 
   let content = document.getElementById('content');
-  $scope.addEvent({
-    eventID: content.id,
-    eventType: 'resize',
-    element: window,
-    onDestroyElement: content,
-    handler: () => {
-      const actionbarHeight = document.getElementById('actionbar').lastElementChild.clientHeight;
-      angular.element(document.getElementById('content')).css('padding-top', actionbarHeight - 20);
-    },
-  });
+  if (content && content.id) {
+    $scope.addEvent({
+      eventID: content.id,
+      eventType: 'resize',
+      element: window,
+      onDestroyElement: content,
+      handler: () => {
+        const actionbarHeight = document.getElementById('actionbar').lastElementChild.clientHeight;
+        angular.element(document.getElementById('content')).css('padding-top', actionbarHeight - 20);
+      },
+    });
+  }
 }
diff --git a/zeppelin-web/src/app/notebook/notebook.controller.test.js b/zeppelin-web/src/app/notebook/notebook.controller.test.js
index be9f9568e4..8aa8524feb 100644
--- a/zeppelin-web/src/app/notebook/notebook.controller.test.js
+++ b/zeppelin-web/src/app/notebook/notebook.controller.test.js
@@ -9,6 +9,7 @@ describe('Controller: NotebookCtrl', function() {
     getInterpreterBindings: function() {},
     updateNote: function() {},
     renameNote: function() {},
+    listConfigurations: function() {},
   };
 
   let baseUrlSrvMock = {
diff --git a/zeppelin-web/src/components/note-create/note-create.controller.test.js b/zeppelin-web/src/components/note-create/note-create.controller.test.js
index 59f01d23b3..38a0544f8e 100644
--- a/zeppelin-web/src/components/note-create/note-create.controller.test.js
+++ b/zeppelin-web/src/components/note-create/note-create.controller.test.js
@@ -16,11 +16,11 @@ describe('Controller: NoteCreateCtrl', function() {
 
   it('should create a new name from current name when cloneNoteName is called', function() {
     let notesList = [
-      {name: 'dsds 1', id: '1'},
-      {name: 'dsds 2', id: '2'},
-      {name: 'test name', id: '3'},
-      {name: 'aa bb cc', id: '4'},
-      {name: 'Untitled Note 6', id: '4'},
+      {path: 'dsds 1', id: '1'},
+      {path: 'dsds 2', id: '2'},
+      {path: 'test name', id: '3'},
+      {path: 'aa bb cc', id: '4'},
+      {path: 'Untitled Note 6', id: '4'},
     ];
 
     noteList.setNotes(notesList);
diff --git a/zeppelin-web/src/components/note-list/note-list.factory.test.js b/zeppelin-web/src/components/note-list/note-list.factory.test.js
index 2a962d8447..c1ba9eb743 100644
--- a/zeppelin-web/src/components/note-list/note-list.factory.test.js
+++ b/zeppelin-web/src/components/note-list/note-list.factory.test.js
@@ -11,30 +11,30 @@ describe('Factory: NoteList', function() {
 
   it('should generate both flat list and folder-based list properly', function() {
     let notesList = [
-      {name: 'A', id: '000001'},
-      {name: 'B', id: '000002'},
-      {id: '000003'},                     // note without name
-      {name: '/C/CA', id: '000004'},
-      {name: '/C/CB', id: '000005'},
-      {name: '/C/CB/CBA', id: '000006'},  // same name with a dir
-      {name: '/C/CB/CBA', id: '000007'},  // same name with another note
-      {name: 'C///CB//CBB', id: '000008'},
-      {name: 'D/D[A/DA]B', id: '000009'},   // check if '[' and ']' considered as folder seperator
+      {path: 'A', id: '000001'},
+      {path: 'B', id: '000002'},
+      {id: '000003'},                     // note without path
+      {path: '/C/CA', id: '000004'},
+      {path: '/C/CB', id: '000005'},
+      {path: '/C/CB/CBA', id: '000006'},  // same path with a dir
+      {path: '/C/CB/CBA', id: '000007'},  // same path with another note
+      {path: 'C///CB//CBB', id: '000008'},
+      {path: 'D/D[A/DA]B', id: '000009'},   // check if '[' and ']' considered as folder seperator
     ];
     noteList.setNotes(notesList);
 
     let flatList = noteList.flatList;
     expect(flatList.length).toBe(9);
-    expect(flatList[0].name).toBe('A');
+    expect(flatList[0].path).toBe('A');
     expect(flatList[0].id).toBe('000001');
-    expect(flatList[1].name).toBe('B');
-    expect(flatList[2].name).toBeUndefined();
-    expect(flatList[3].name).toBe('/C/CA');
-    expect(flatList[4].name).toBe('/C/CB');
-    expect(flatList[5].name).toBe('/C/CB/CBA');
-    expect(flatList[6].name).toBe('/C/CB/CBA');
-    expect(flatList[7].name).toBe('C///CB//CBB');
-    expect(flatList[8].name).toBe('D/D[A/DA]B');
+    expect(flatList[1].path).toBe('B');
+    expect(flatList[2].path).toBeUndefined();
+    expect(flatList[3].path).toBe('/C/CA');
+    expect(flatList[4].path).toBe('/C/CB');
+    expect(flatList[5].path).toBe('/C/CB/CBA');
+    expect(flatList[6].path).toBe('/C/CB/CBA');
+    expect(flatList[7].path).toBe('C///CB//CBB');
+    expect(flatList[8].path).toBe('D/D[A/DA]B');
 
     let folderList = noteList.root.children;
     expect(folderList.length).toBe(5);
diff --git a/zeppelin-web/webpack.config.js b/zeppelin-web/webpack.config.js
index ccb33df2f4..1112756c98 100644
--- a/zeppelin-web/webpack.config.js
+++ b/zeppelin-web/webpack.config.js
@@ -242,12 +242,13 @@ module.exports = function makeWebpackConfig () {
   }
 
   if (isTest) {
-    config.module.postLoaders = [
+    config.module.rules = [
       {
         // COVERAGE
         test: /\.js$/,
         exclude: /(node_modules|bower_components|\.test\.js)/,
-        loader: 'istanbul-instrumenter'
+        loader: 'istanbul-instrumenter',
+        enforce: 'post'
       }
     ]
   }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services