Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 7 additions & 27 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,52 +28,32 @@ addons:
- r-packages-precise
packages:
- r-base-dev
- r-cran-evaluate
- r-cran-base64enc

matrix:
include:
# Test all modules with spark 2.0.0 and scala 2.11
- jdk: "oraclejdk7"
env: SCALA_VER="2.11" SPARK_VER="2.0.0" HADOOP_VER="2.3" PROFILE="-Pspark-2.0 -Phadoop-2.3 -Ppyspark -Psparkr -Pscalding -Pscala-2.11" BUILD_FLAG="package -Pbuild-distr" TEST_FLAG="verify -Pusing-packaged-distr" TEST_PROJECTS=""
env: SCALA_VER="2.11" SPARK_VER="2.0.2" HADOOP_VER="2.6" PROFILE="-Pspark-2.0 -Phadoop-2.6 -Ppyspark -Psparkr -Pscalding -Pscala-2.11" BUILD_FLAG="package -Pbuild-distr" TEST_FLAG="verify -Pusing-packaged-distr" TEST_PROJECTS=""

# Test all modules with scala 2.10
- jdk: "oraclejdk7"
env: SCALA_VER="2.10" SPARK_VER="1.6.1" HADOOP_VER="2.3" PROFILE="-Pspark-1.6 -Pr -Phadoop-2.3 -Ppyspark -Psparkr -Pscalding -Pscala-2.10" BUILD_FLAG="package -Pbuild-distr" TEST_FLAG="verify -Pusing-packaged-distr" TEST_PROJECTS=""
env: SCALA_VER="2.10" SPARK_VER="1.6.3" HADOOP_VER="2.6" PROFILE="-Pspark-1.6 -Pr -Phadoop-2.6 -Ppyspark -Psparkr -Pscalding -Pscala-2.10" BUILD_FLAG="package -Pbuild-distr" TEST_FLAG="verify -Pusing-packaged-distr" TEST_PROJECTS=""

# Test all modules with scala 2.11
- jdk: "oraclejdk7"
env: SCALA_VER="2.11" SPARK_VER="1.6.1" HADOOP_VER="2.3" PROFILE="-Pspark-1.6 -Pr -Phadoop-2.3 -Ppyspark -Psparkr -Pscalding -Pscala-2.11" BUILD_FLAG="package -Pbuild-distr" TEST_FLAG="verify -Pusing-packaged-distr" TEST_PROJECTS=""
env: SCALA_VER="2.11" SPARK_VER="1.6.3" HADOOP_VER="2.6" PROFILE="-Pspark-1.6 -Pr -Phadoop-2.6 -Ppyspark -Psparkr -Pscalding -Pscala-2.11" BUILD_FLAG="package -Pbuild-distr" TEST_FLAG="verify -Pusing-packaged-distr" TEST_PROJECTS=""

# Test spark module for 1.5.2
# Test selenium with spark module for 1.6.3
- jdk: "oraclejdk7"
env: SCALA_VER="2.10" SPARK_VER="1.5.2" HADOOP_VER="2.3" PROFILE="-Pspark-1.5 -Pr -Phadoop-2.3 -Ppyspark -Psparkr" BUILD_FLAG="package -DskipTests" TEST_FLAG="verify" TEST_PROJECTS="-pl zeppelin-interpreter,zeppelin-zengine,zeppelin-server,zeppelin-display,spark-dependencies,spark,r -Dtest=org.apache.zeppelin.rest.*Test,org.apache.zeppelin.spark* -DfailIfNoTests=false"

# Test spark module for 1.4.1
- jdk: "oraclejdk7"
env: SCALA_VER="2.10" SPARK_VER="1.4.1" HADOOP_VER="2.3" PROFILE="-Pspark-1.4 -Pr -Phadoop-2.3 -Ppyspark -Psparkr" BUILD_FLAG="package -DskipTests" TEST_FLAG="verify" TEST_PROJECTS="-pl zeppelin-interpreter,zeppelin-zengine,zeppelin-server,zeppelin-display,spark-dependencies,spark,r -Dtest=org.apache.zeppelin.rest.*Test,org.apache.zeppelin.spark* -DfailIfNoTests=false"

# Test spark module for 1.3.1
- jdk: "oraclejdk7"
env: SCALA_VER="2.10" SPARK_VER="1.3.1" HADOOP_VER="2.3" PROFILE="-Pspark-1.3 -Phadoop-2.3 -Ppyspark" BUILD_FLAG="package -DskipTests" TEST_FLAG="verify" TEST_PROJECTS="-pl zeppelin-interpreter,zeppelin-zengine,zeppelin-server,zeppelin-display,spark-dependencies,spark -Dtest=org.apache.zeppelin.rest.*Test,org.apache.zeppelin.spark* -DfailIfNoTests=false"

# Test spark module for 1.2.2
- jdk: "oraclejdk7"
env: SCALA_VER="2.10" SPARK_VER="1.2.2" HADOOP_VER="2.3" PROFILE="-Pspark-1.2 -Phadoop-2.3 -Ppyspark" BUILD_FLAG="package -DskipTests" TEST_FLAG="verify" TEST_PROJECTS="-pl zeppelin-interpreter,zeppelin-zengine,zeppelin-server,zeppelin-display,spark-dependencies,spark -Dtest=org.apache.zeppelin.rest.*Test,org.apache.zeppelin.spark* -DfailIfNoTests=false"

# Test spark module for 1.1.1
- jdk: "oraclejdk7"
env: SCALA_VER="2.10" SPARK_VER="1.1.1" HADOOP_VER="2.3" PROFILE="-Pspark-1.1 -Phadoop-2.3 -Ppyspark" BUILD_FLAG="package -DskipTests" TEST_FLAG="verify" TEST_PROJECTS="-pl zeppelin-interpreter,zeppelin-zengine,zeppelin-server,zeppelin-display,spark-dependencies,spark -Dtest=org.apache.zeppelin.rest.*Test,org.apache.zeppelin.spark* -DfailIfNoTests=false"

# Test selenium with spark module for 1.6.1
- jdk: "oraclejdk7"
env: TEST_SELENIUM="true" SCALA_VER="2.10" SPARK_VER="1.6.1" HADOOP_VER="2.3" PROFILE="-Pspark-1.6 -Phadoop-2.3 -Ppyspark" BUILD_FLAG="package -DskipTests" TEST_FLAG="verify" TEST_PROJECTS="-pl zeppelin-interpreter,zeppelin-zengine,zeppelin-server,zeppelin-display,spark-dependencies,spark -Dtest=org.apache.zeppelin.AbstractFunctionalSuite -DfailIfNoTests=false"
env: TEST_SELENIUM="true" SCALA_VER="2.10" SPARK_VER="1.6.3" HADOOP_VER="2.6" PROFILE="-Pspark-1.6 -Phadoop-2.6 -Ppyspark" BUILD_FLAG="package -DskipTests" TEST_FLAG="verify" TEST_PROJECTS="-pl zeppelin-interpreter,zeppelin-zengine,zeppelin-server,zeppelin-display,spark-dependencies,spark -Dtest=org.apache.zeppelin.AbstractFunctionalSuite -DfailIfNoTests=false"

before_install:
- "ls -la .spark-dist ${HOME}/.m2/repository/.cache/maven-download-plugin"
- mkdir -p ~/R
- echo 'R_LIBS=~/R' > ~/.Renviron
- R -e "install.packages('knitr', repos = 'http://cran.us.r-project.org', lib='~/R')"
- R -e "install.packages('evaluate', repos = 'http://cran.us.r-project.org', lib='~/R')"
- R -e "install.packages('base64enc', repos = 'http://cran.us.r-project.org', lib='~/R')"
- export R_LIBS='~/R'
- "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1600x1024x16"
- ./dev/change_scala_version.sh $SCALA_VER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,15 +216,20 @@ private Ignite getIgnite() {
}

private void initIgnite() {
imain.interpret("@transient var _binder = new java.util.HashMap[String, Object]()");
Map<String, Object> binder = (Map<String, Object>) getLastObject();
ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
try {
imain.interpret("@transient var _binder = new java.util.HashMap[String, Object]()");
Map<String, Object> binder = (Map<String, Object>) getLastObject();

if (getIgnite() != null) {
binder.put("ignite", ignite);
if (getIgnite() != null) {
binder.put("ignite", ignite);

imain.interpret("@transient val ignite = "
+ "_binder.get(\"ignite\")"
+ ".asInstanceOf[org.apache.ignite.Ignite]");
imain.interpret("@transient val ignite = "
+ "_binder.get(\"ignite\")"
+ ".asInstanceOf[org.apache.ignite.Ignite]");
}
} finally {
Thread.currentThread().setContextClassLoader(contextClassLoader);
}
}

Expand Down Expand Up @@ -295,11 +300,14 @@ private InterpreterResult interpret(String[] lines) {
}
}

ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
try {
code = getResultCode(imain.interpret(incomplete + s));
} catch (Exception e) {
logger.info("Interpreter exception", e);
return new InterpreterResult(Code.ERROR, InterpreterUtils.getMostRelevantMessage(e));
} finally {
Thread.currentThread().setContextClassLoader(contextClassLoader);
}

if (code == Code.ERROR) {
Expand Down
125 changes: 125 additions & 0 deletions travis_check.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

#
# This script checks build status of given pullrequest identified by author and commit hash.
#
# usage)
# python travis_check.py [author] [commit hash] [check interval (optional)]
#
# example)
# # full hash
# python travis_check.py Leemoonsoo 1f2549a38f440ebfbfe2d32a041684e3e39b496c
#
# # with short hash
# python travis_check.py Leemoonsoo 1f2549a
#
# # with custom check interval
# python travis_check.py Leemoonsoo 1f2549a 5,60,60

import os, sys, getopt, traceback, json, requests, time

author = sys.argv[1]
commit = sys.argv[2]

# check interval in sec
check = [5, 60, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 600, 600, 600, 600, 600, 600]

if len(sys.argv) > 3:
check = map(lambda x: int(x), sys.argv[3].split(","))

def info(msg):
print("[" + time.strftime("%Y-%m-%d %H:%M:%S") + "] " + msg)
sys.stdout.flush()

info("Author: " + author + ", commit: " + commit)


def getBuildStatus(author, commit):
travisApi = "https://api.travis-ci.org/"

# get latest 25 builds
resp = requests.get(url=travisApi + "/repos/" + author + "/zeppelin/builds")
data = json.loads(resp.text)
build = None

if len(data) == 0:
return build;

for b in data:
if b["commit"][:len(commit)] == commit:
resp = requests.get(url=travisApi + "/repos/" + author + "/zeppelin/builds/" + str(b["id"]))
build = json.loads(resp.text)
break

return build

def status(index, msg, jobId):
return '{:20}'.format("[" + str(index+1) + "] " + msg) + "https://travis-ci.org/" + author + "/zeppelin/jobs/" + str(jobId)

def printBuildStatus(build):
failure = 0
running = 0

for index, job in enumerate(build["matrix"]):
result = job["result"]
jobId = job["id"]

if job["started_at"] == None and result == None:
print(status(index, "Not started", jobId))
running = running + 1
elif job["started_at"] != None and job["finished_at"] == None:
print(status(index, "Running ...", jobId))
running = running + 1
elif job["started_at"] != None and job["finished_at"] != None:
if result == None:
print(status(index, "Not completed", jobId))
failure = failure + 1
elif result == 0:
print(status(index, "OK", jobId))
else:
print(status(index, "Error " + str(result), jobId))
failure = failure + 1
else:
print(status(index, "Unknown state", jobId))
failure = failure + 1

return failure, running


for sleep in check:
info("--------------------------------")
time.sleep(sleep);
info("Get build status ...")
build = getBuildStatus(author, commit)
if build == None:
info("Can't find build for commit " + commit + " from " + author)
sys.exit(2)

print("Build https://travis-ci.org/" + author + "/zeppelin/builds/" + str(build["id"]))
failure, running = printBuildStatus(build)

print(str(failure) + " job(s) failed, " + str(running) + " job(s) running/pending")

if failure != 0:
sys.exit(1)

if failure == 0 and running == 0:
info("CI Green!")
sys.exit(0)

info("Timeout")
sys.exit(1)
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import org.apache.zeppelin.display.{AngularObject, AngularObjectRegistry, GUI}
import org.apache.zeppelin.interpreter._
import org.apache.zeppelin.user.AuthenticationInfo
import org.scalatest.concurrent.Eventually
import org.scalatest.time.{Seconds, Span}
import org.scalatest.{BeforeAndAfter, BeforeAndAfterEach, FlatSpec, Matchers}

/**
Expand Down Expand Up @@ -69,12 +70,12 @@ trait AbstractAngularElemTest
// click create thread for callback function to run. So it'll may not immediately invoked
// after click. therefore eventually should be
click(elem)
eventually {
eventually (timeout(Span(5, Seconds))) {
a should be(1)
}

click(elem)
eventually {
eventually (timeout(Span(5, Seconds))) {
a should be(2)
}

Expand Down Expand Up @@ -128,7 +129,7 @@ trait AbstractAngularElemTest

click(elem)

eventually { modelValue should be("value")}
eventually (timeout(Span(5, Seconds))) { modelValue should be("value")}
}


Expand Down