From commits-return-5586-archive-asf-public=cust-asf.ponee.io@zeppelin.apache.org Tue Oct 1 19:55:53 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id DED7A180608 for ; Tue, 1 Oct 2019 21:55:52 +0200 (CEST) Received: (qmail 84965 invoked by uid 500); 1 Oct 2019 19:55:52 -0000 Mailing-List: contact commits-help@zeppelin.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@zeppelin.apache.org Delivered-To: mailing list commits@zeppelin.apache.org Received: (qmail 84956 invoked by uid 99); 1 Oct 2019 19:55:52 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Oct 2019 19:55:52 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id E1529890A3; Tue, 1 Oct 2019 19:55:51 +0000 (UTC) Date: Tue, 01 Oct 2019 19:55:51 +0000 To: "commits@zeppelin.apache.org" Subject: [zeppelin] branch master updated: [ZEPPELIN-4355][ZEPPELIN-4361] Fix broken tests in master branch MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <156995975157.21875.8681001733994608747@gitbox.apache.org> From: moon@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: zeppelin X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 4fe2e20caa6e37e353d51d46aea41320e07be76e X-Git-Newrev: 238e03242b5ed108f99b5624d93fa5606b008d1f X-Git-Rev: 238e03242b5ed108f99b5624d93fa5606b008d1f X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated 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 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 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