This is an automated email from the ASF dual-hosted git repository. moon pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/zeppelin.git
The following commit(s) were added to refs/heads/master by this push: new 238e032 [ZEPPELIN-4355][ZEPPELIN-4361] Fix broken tests in master branch 238e032 is described below commit 238e03242b5ed108f99b5624d93fa5606b008d1f Author: Lee moon soo <m...@apache.org> AuthorDate: Tue Oct 1 10:07:56 2019 -0700 [ZEPPELIN-4355][ZEPPELIN-4361] Fix broken tests in master branch ### What is this PR for? Fix broken test in master branch [ZEPPELIN-4355](https://issues.apache.org/jira/projects/ZEPPELIN/issues/ZEPPELIN-4355), [ZEPPELIN-4361](https://issues.apache.org/jira/projects/ZEPPELIN/issues/ZEPPELIN-4361). ### What type of PR is it? Hot Fix ### What is the Jira issue? https://issues.apache.org/jira/projects/ZEPPELIN/issues/ZEPPELIN-4355 https://issues.apache.org/jira/projects/ZEPPELIN/issues/ZEPPELIN-4361 ### How should this be tested? * All CI test should pass ### Questions: * Does the licenses files need update? no * Is there breaking changes for older versions? no * Does this needs documentation? no Author: Lee moon soo <m...@apache.org> Closes #3469 from Leemoonsoo/ZEPPELIN-4361 and squashes the following commits: 0eb8a9666 [Lee moon soo] ZEPPELIN-4361 da5755b55 [Lee moon soo] ZEPPELIN-4355 --- .../cassandra/CassandraInterpreterTest.java | 1 + .../zeppelin/integration/PersonalizeActionsIT.java | 38 ++++++++++++++++------ .../src/app/notebook/notebook.controller.js | 2 +- 3 files changed, 30 insertions(+), 11 deletions(-) diff --git a/cassandra/src/test/java/org/apache/zeppelin/cassandra/CassandraInterpreterTest.java b/cassandra/src/test/java/org/apache/zeppelin/cassandra/CassandraInterpreterTest.java index df5e4ac..0417dc9 100644 --- a/cassandra/src/test/java/org/apache/zeppelin/cassandra/CassandraInterpreterTest.java +++ b/cassandra/src/test/java/org/apache/zeppelin/cassandra/CassandraInterpreterTest.java @@ -773,6 +773,7 @@ public class CassandraInterpreterTest { .replaceAll(">\\s+<", "><") .replaceAll("(?s)data-target=\"#[a-f0-9-]+(?:_asCQL|_indices_asCQL)?\"", "") .replaceAll("(?s)id=\"[a-f0-9-]+(?:_asCQL|_indices_asCQL)?\"", "") + .replaceAll("AND memtable_flush_period_in_ms = 0", "") .trim(); } diff --git a/zeppelin-integration/src/test/java/org/apache/zeppelin/integration/PersonalizeActionsIT.java b/zeppelin-integration/src/test/java/org/apache/zeppelin/integration/PersonalizeActionsIT.java index fce9466..1fc8890 100644 --- a/zeppelin-integration/src/test/java/org/apache/zeppelin/integration/PersonalizeActionsIT.java +++ b/zeppelin-integration/src/test/java/org/apache/zeppelin/integration/PersonalizeActionsIT.java @@ -201,10 +201,10 @@ public class PersonalizeActionsIT extends AbstractZeppelinIT { createNewNote(); } String noteId = driver.getCurrentUrl().substring(driver.getCurrentUrl().lastIndexOf("/") + 1); - setTextOfParagraph(1, "print(s\"\"\"%table\\n" + - "name\\tsize\\n" + - "sun\\t100\\n" + - "moon\\t10\"\"\")"); + setTextOfParagraph(1, "%python print(\"%table " + + "name\\\\tsize\\\\n" + + "sun\\\\t100\\\\n" + + "moon\\\\t10\")"); runParagraph(1); try { @@ -215,6 +215,11 @@ public class PersonalizeActionsIT extends AbstractZeppelinIT { "ERROR", CoreMatchers.equalTo("FINISHED")); } + pollingWait(By.xpath("//*[@id='actionbar']" + + "//button[contains(@uib-tooltip, 'Switch to personal mode')]"), MAX_BROWSER_TIMEOUT_SEC).click(); + clickAndWait(By.xpath("//div[@class='modal-dialog'][contains(.,'Do you want to personalize your analysis?')" + + "]//div[@class='modal-footer']//button[contains(.,'OK')]")); + pollingWait(By.xpath(getParagraphXPath(1) + "//button[contains(@uib-tooltip, 'Bar Chart')]"), MAX_BROWSER_TIMEOUT_SEC).click(); collector.checkThat("The output of graph mode is changed", @@ -222,11 +227,8 @@ public class PersonalizeActionsIT extends AbstractZeppelinIT { "'btn btn-default btn-sm ng-binding ng-scope active')]//i")).getAttribute("class"), CoreMatchers.equalTo("fa fa-bar-chart")); - pollingWait(By.xpath("//*[@id='actionbar']" + - "//button[contains(@uib-tooltip, 'Switch to personal mode')]"), MAX_BROWSER_TIMEOUT_SEC).click(); - clickAndWait(By.xpath("//div[@class='modal-dialog'][contains(.,'Do you want to personalize your analysis?')" + - "]//div[@class='modal-footer']//button[contains(.,'OK')]")); authenticationIT.logoutUser("admin"); + driver.navigate().refresh(); // step 2 : (user1) make sure it is on personalized mode and active graph is 'Bar chart', // try to change active graph to 'Table' and then check result @@ -249,12 +251,28 @@ public class PersonalizeActionsIT extends AbstractZeppelinIT { pollingWait(By.xpath(getParagraphXPath(1) + "//button[contains(@uib-tooltip, 'Table')]"), MAX_BROWSER_TIMEOUT_SEC).click(); - collector.checkThat("The output of graph mode is not changed", + collector.checkThat("Change to table", driver.findElement(By.xpath(getParagraphXPath(1) + "//button[contains(@class," + "'btn btn-default btn-sm ng-binding ng-scope active')]//i")).getAttribute("class"), - CoreMatchers.equalTo("fa fa-bar-chart")); + CoreMatchers.equalTo("fa fa-table")); authenticationIT.logoutUser("user1"); + driver.navigate().refresh(); + + // step 3: (admin) Admin view is still table because of it's personalized! + authenticationIT.authenticationUser("admin", "password1"); + locator = By.xpath("//*[@id='notebook-names']//a[contains(@href, '" + noteId + "')]"); + element = wait.until(ExpectedConditions.visibilityOfElementLocated(locator)); + if (element.isDisplayed()) { + pollingWait(By.xpath("//*[@id='notebook-names']//a[contains(@href, '" + noteId + "')]"), + MAX_BROWSER_TIMEOUT_SEC).click(); + } + + collector.checkThat("Make sure the output of graph mode is", + driver.findElement(By.xpath(getParagraphXPath(1) + "//button[contains(@class," + + "'btn btn-default btn-sm ng-binding ng-scope active')]//i")).getAttribute("class"), + CoreMatchers.equalTo("fa fa-bar-chart")); + authenticationIT.logoutUser("admin"); } catch (Exception e) { handleException("Exception in PersonalizeActionsIT while testGraphAction ", e); } diff --git a/zeppelin-web/src/app/notebook/notebook.controller.js b/zeppelin-web/src/app/notebook/notebook.controller.js index 0515a85..9bd3333 100644 --- a/zeppelin-web/src/app/notebook/notebook.controller.js +++ b/zeppelin-web/src/app/notebook/notebook.controller.js @@ -237,7 +237,7 @@ function NotebookCtrl($scope, $route, $routeParams, $location, $rootScope, }; $scope.isTrash = function(note) { - return note ? note.path.split('/')[1] === TRASH_FOLDER_ID : false; + return note && note.path ? note.path.split('/')[1] === TRASH_FOLDER_ID : false; }; // Export notebook