Repository: incubator-zeppelin
Updated Branches:
refs/heads/master 7a58d4610 -> 72b8fde06
testSparkInterpreterDependencyLoading does not check for endToEndTestEnabled
### What is this PR for?
This is a fix for selenium test case `testSparkInterpreterDependencyLoading`
that does not check for `endToEndTestEnabled` causing build to fail on local.
(`mvn $TEST_FLAG $PROFILE -B`)
Used to get this error in file
`./zeppelin-server/target/failsafe-reports/org.apache.zeppelin.ZeppelinIT.txt`
-------------------------------------------------------------------------------
Test set: org.apache.zeppelin.ZeppelinIT
-------------------------------------------------------------------------------
Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.008 sec
<<< FAILURE! - in org.apache.zeppelin.ZeppelinIT
testSparkInterpreterDependencyLoading(org.apache.zeppelin.ZeppelinIT) Time
elapsed: 0.008 sec <<< ERROR!
java.lang.NullPointerException: null
at
org.apache.zeppelin.ZeppelinIT.testSparkInterpreterDependencyLoading(ZeppelinIT.java:210)
### What type of PR is it?
Hot Fix
### Todos
* [x] - Fix for testSparkInterpreterDependencyLoading
* [x] - delete created notebook for cleanup.
### Is there a relevant Jira issue?
N/A
### How should this be tested?
`mvn $TEST_FLAG $PROFILE -B` should not fail on local when env variable "CI" is
not set.
Author: Prabhjyot Singh <[email protected]>
Closes #709 from prabhjyotsingh/ZEPPELIN-630-SeleniumFix and squashes the
following commits:
e31a3d0 [Prabhjyot Singh] throw e;
2d9aa98 [Prabhjyot Singh] "throw e"
277521e [Prabhjyot Singh] Merge remote-tracking branch 'origin/master' into
ZEPPELIN-630-SeleniumFix
98e8d0b [Prabhjyot Singh] throw e on exception, marking test as a failure.
271445a [Prabhjyot Singh] instead of "ElementNotVisibleException" it should
catch all "Exception" and log it.
2642975 [Prabhjyot Singh] testSparkInterpreterDependencyLoading does not check
for endToEndTestEnabled
Project: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/repo
Commit:
http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/commit/72b8fde0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/tree/72b8fde0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/diff/72b8fde0
Branch: refs/heads/master
Commit: 72b8fde066690676886824aeb6986d7605882438
Parents: 7a58d46
Author: Prabhjyot Singh <[email protected]>
Authored: Fri Feb 12 19:42:25 2016 +0530
Committer: Felix Cheung <[email protected]>
Committed: Sat Feb 13 16:42:23 2016 -0800
----------------------------------------------------------------------
.../java/org/apache/zeppelin/ZeppelinIT.java | 104 +++++++++++--------
.../integration/ParagraphActionsIT.java | 12 ++-
2 files changed, 67 insertions(+), 49 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/72b8fde0/zeppelin-server/src/test/java/org/apache/zeppelin/ZeppelinIT.java
----------------------------------------------------------------------
diff --git a/zeppelin-server/src/test/java/org/apache/zeppelin/ZeppelinIT.java
b/zeppelin-server/src/test/java/org/apache/zeppelin/ZeppelinIT.java
index e9a56cc..d876b17 100644
--- a/zeppelin-server/src/test/java/org/apache/zeppelin/ZeppelinIT.java
+++ b/zeppelin-server/src/test/java/org/apache/zeppelin/ZeppelinIT.java
@@ -23,6 +23,7 @@ import org.junit.Test;
import org.openqa.selenium.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import scala.reflect.internal.Trees;
import java.io.File;
@@ -62,7 +63,7 @@ public class ZeppelinIT extends AbstractZeppelinIT {
}
@Test
- public void testAngularDisplay() throws InterruptedException{
+ public void testAngularDisplay() throws Exception {
if (!endToEndTestEnabled()) {
return;
}
@@ -193,55 +194,68 @@ public class ZeppelinIT extends AbstractZeppelinIT {
sleep(100, true);
System.out.println("testCreateNotebook Test executed");
- } catch (ElementNotVisibleException e) {
+ } catch (Exception e) {
LOG.error("Exception in ZeppelinIT while testAngularDisplay ", e);
File scrFile =
((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
-
+ throw e;
}
}
@Test
- public void testSparkInterpreterDependencyLoading() {
- // navigate to interpreter page
- WebElement interpreterLink =
driver.findElement(By.linkText("Interpreter"));
- interpreterLink.click();
-
- // add new dependency to spark interpreter
- WebElement sparkEditBtn =
pollingWait(By.xpath("//div[h3[text()[contains(.,'spark')]]]//button[contains(.,'edit')]"),
- MAX_BROWSER_TIMEOUT_SEC);
- sparkEditBtn.click();
- WebElement depArtifact =
driver.findElement(By.xpath("//input[@ng-model='setting.depArtifact']"));
- String artifact = "org.apache.commons:commons-csv:1.1";
- depArtifact.sendKeys(artifact);
- driver.findElement(By.xpath("//button[contains(.,'Save')]")).submit();
- driver.switchTo().alert().accept();
-
- driver.navigate().back();
- createNewNote();
-
- // wait for first paragraph's " READY " status text
- waitForParagraph(1, "READY");
-
- WebElement paragraph1Editor =
driver.findElement(By.xpath(getParagraphXPath(1) + "//textarea"));
-
- paragraph1Editor.sendKeys("import org.apache.commons.csv.CSVFormat");
- paragraph1Editor.sendKeys(Keys.chord(Keys.SHIFT, Keys.ENTER));
- waitForParagraph(1, "FINISHED");
-
- // check expected text
- assertTrue(waitForText("import org.apache.commons.csv.CSVFormat",
- By.xpath(getParagraphXPath(1) + "//div[starts-with(@id, 'p') and
contains(@id, 'text')]/div")));
-
- // reset dependency
- interpreterLink.click();
- sparkEditBtn =
pollingWait(By.xpath("//div[h3[text()[contains(.,'spark')]]]//button[contains(.,'edit')]"),
- MAX_BROWSER_TIMEOUT_SEC);
- sparkEditBtn.click();
- WebElement testDepRemoveBtn =
driver.findElement(By.xpath("//tr[descendant::text()[contains(.,'" +
- artifact + "')]]/td[3]/div"));
- sleep(5000, true);
- testDepRemoveBtn.click();
- driver.findElement(By.xpath("//button[contains(.,'Save')]")).submit();
- driver.switchTo().alert().accept();
+ public void testSparkInterpreterDependencyLoading() throws Exception {
+ if (!endToEndTestEnabled()) {
+ return;
+ }
+ try {
+ // navigate to interpreter page
+ WebElement interpreterLink =
driver.findElement(By.linkText("Interpreter"));
+ interpreterLink.click();
+
+ // add new dependency to spark interpreter
+ WebElement sparkEditBtn =
pollingWait(By.xpath("//div[h3[text()[contains(.,'spark')]]]//button[contains(.,'edit')]"),
+ MAX_BROWSER_TIMEOUT_SEC);
+ sparkEditBtn.click();
+ WebElement depArtifact =
driver.findElement(By.xpath("//input[@ng-model='setting.depArtifact']"));
+ String artifact = "org.apache.commons:commons-csv:1.1";
+ depArtifact.sendKeys(artifact);
+ driver.findElement(By.xpath("//button[contains(.,'Save')]")).submit();
+ driver.switchTo().alert().accept();
+
+ driver.navigate().back();
+ createNewNote();
+
+ // wait for first paragraph's " READY " status text
+ waitForParagraph(1, "READY");
+
+ WebElement paragraph1Editor =
driver.findElement(By.xpath(getParagraphXPath(1) + "//textarea"));
+
+ paragraph1Editor.sendKeys("import org.apache.commons.csv.CSVFormat");
+ paragraph1Editor.sendKeys(Keys.chord(Keys.SHIFT, Keys.ENTER));
+ waitForParagraph(1, "FINISHED");
+
+ // check expected text
+ assertTrue(waitForText("import org.apache.commons.csv.CSVFormat",
+ By.xpath(getParagraphXPath(1) + "//div[starts-with(@id, 'p') and
contains(@id, 'text')]/div")));
+
+ //delete created notebook for cleanup.
+ deleteTestNotebook(driver);
+ sleep(1000, true);
+
+ // reset dependency
+ interpreterLink.click();
+ sparkEditBtn =
pollingWait(By.xpath("//div[h3[text()[contains(.,'spark')]]]//button[contains(.,'edit')]"),
+ MAX_BROWSER_TIMEOUT_SEC);
+ sparkEditBtn.click();
+ WebElement testDepRemoveBtn =
driver.findElement(By.xpath("//tr[descendant::text()[contains(.,'" +
+ artifact + "')]]/td[3]/div"));
+ sleep(5000, true);
+ testDepRemoveBtn.click();
+ driver.findElement(By.xpath("//button[contains(.,'Save')]")).submit();
+ driver.switchTo().alert().accept();
+ } catch (Exception e) {
+ LOG.error("Exception in ZeppelinIT while
testSparkInterpreterDependencyLoading ", e);
+ File scrFile = ((TakesScreenshot)
driver).getScreenshotAs(OutputType.FILE);
+ throw e;
+ }
}
}
http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/72b8fde0/zeppelin-server/src/test/java/org/apache/zeppelin/integration/ParagraphActionsIT.java
----------------------------------------------------------------------
diff --git
a/zeppelin-server/src/test/java/org/apache/zeppelin/integration/ParagraphActionsIT.java
b/zeppelin-server/src/test/java/org/apache/zeppelin/integration/ParagraphActionsIT.java
index 23aaf6f..ddc7a4d 100644
---
a/zeppelin-server/src/test/java/org/apache/zeppelin/integration/ParagraphActionsIT.java
+++
b/zeppelin-server/src/test/java/org/apache/zeppelin/integration/ParagraphActionsIT.java
@@ -58,7 +58,7 @@ public class ParagraphActionsIT extends AbstractZeppelinIT {
}
@Test
- public void testMoveUpAndDown() throws InterruptedException {
+ public void testMoveUpAndDown() throws Exception {
if (!endToEndTestEnabled()) {
return;
}
@@ -111,14 +111,16 @@ public class ParagraphActionsIT extends
AbstractZeppelinIT {
ZeppelinITUtils.sleep(1000,false);
deleteTestNotebook(driver);
- } catch (ElementNotVisibleException e) {
+ } catch (Exception e) {
+ LOG.error("Exception in ParagraphActionsIT while testMoveUpAndDown ", e);
File scrFile = ((TakesScreenshot)
driver).getScreenshotAs(OutputType.FILE);
+ throw e;
}
}
@Test
- public void testDisableParagraphRunButton() throws InterruptedException {
+ public void testDisableParagraphRunButton() throws Exception {
if (!endToEndTestEnabled()) {
return;
}
@@ -149,8 +151,10 @@ public class ParagraphActionsIT extends AbstractZeppelinIT
{
deleteTestNotebook(driver);
- } catch (ElementNotVisibleException e) {
+ } catch (Exception e) {
+ LOG.error("Exception in ParagraphActionsIT while
testDisableParagraphRunButton ", e);
File scrFile = ((TakesScreenshot)
driver).getScreenshotAs(OutputType.FILE);
+ throw e;
}
}