Skip to content

Commit

Permalink
fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
prabhjyotsingh committed Aug 18, 2016
1 parent 590032e commit 787a108
Show file tree
Hide file tree
Showing 14 changed files with 205 additions and 139 deletions.
2 changes: 1 addition & 1 deletion bin/interpreter.sh
Expand Up @@ -160,7 +160,7 @@ CLASSPATH+=":${ZEPPELIN_INTP_CLASSPATH}"


if [[ -n "${SPARK_SUBMIT}" ]]; then
${ZEPPELIN_SSH_COMMAND} ${SPARK_SUBMIT} --class ${ZEPPELIN_SERVER} --driver-class-path "${ZEPPELIN_INTP_CLASSPATH_OVERRIDES}:${CLASSPATH}" --driver-java-options "${JAVA_INTP_OPTS}" ${SPARK_SUBMIT_OPTIONS} ${SPARK_APP_JAR} ${PORT} &
${ZEPPELIN_SSH_COMMAND} `${SPARK_SUBMIT} --class ${ZEPPELIN_SERVER} --driver-class-path "${ZEPPELIN_INTP_CLASSPATH_OVERRIDES}:${CLASSPATH}" --driver-java-options "${JAVA_INTP_OPTS}" ${SPARK_SUBMIT_OPTIONS} ${SPARK_APP_JAR} ${PORT} &`
else
${ZEPPELIN_SSH_COMMAND} ${ZEPPELIN_RUNNER} ${JAVA_INTP_OPTS} ${ZEPPELIN_INTP_MEM} -cp ${ZEPPELIN_INTP_CLASSPATH_OVERRIDES}:${CLASSPATH} ${ZEPPELIN_SERVER} ${PORT} &
fi
Expand Down
Expand Up @@ -17,10 +17,8 @@

package org.apache.zeppelin.rest;

import java.io.IOException;
import java.util.List;
import java.util.Map;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import org.apache.commons.httpclient.methods.DeleteMethod;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.methods.PostMethod;
Expand All @@ -30,14 +28,16 @@
import org.apache.zeppelin.notebook.Paragraph;
import org.apache.zeppelin.scheduler.Job.Status;
import org.apache.zeppelin.server.ZeppelinServer;
import org.apache.zeppelin.user.AuthenticationInfo;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runners.MethodSorters;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import java.util.List;
import java.util.Map;

import static org.junit.Assert.*;

Expand All @@ -47,10 +47,13 @@
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class InterpreterRestApiTest extends AbstractTestRestApi {
Gson gson = new Gson();
static AuthenticationInfo subject;

@BeforeClass
public static void init() throws Exception {
AbstractTestRestApi.startUp();
subject = new AuthenticationInfo();
subject.setUser("anonymous");
}

@AfterClass
Expand Down Expand Up @@ -122,7 +125,7 @@ public void testSettingsCRUD() throws IOException {
@Test
public void testInterpreterAutoBinding() throws IOException {
// create note
Note note = ZeppelinServer.notebook.createNote(null);
Note note = ZeppelinServer.notebook.createNote(subject);

// check interpreter is binded
GetMethod get = httpGet("/notebook/interpreter/bind/" + note.id());
Expand All @@ -135,13 +138,13 @@ public void testInterpreterAutoBinding() throws IOException {

get.releaseConnection();
//cleanup
ZeppelinServer.notebook.removeNote(note.getId(), null);
ZeppelinServer.notebook.removeNote(note.getId(), subject);
}

@Test
public void testInterpreterRestart() throws IOException, InterruptedException {
// create new note
Note note = ZeppelinServer.notebook.createNote(null);
Note note = ZeppelinServer.notebook.createNote(subject);
note.addParagraph();
Paragraph p = note.getLastParagraph();
Map config = p.getConfig();
Expand Down Expand Up @@ -178,7 +181,7 @@ public void testInterpreterRestart() throws IOException, InterruptedException {
}
assertEquals("<p>markdown restarted</p>\n", p.getResult().message());
//cleanup
ZeppelinServer.notebook.removeNote(note.getId(), null);
ZeppelinServer.notebook.removeNote(note.getId(), subject);
}

@Test
Expand Down
Expand Up @@ -27,6 +27,7 @@
import org.apache.zeppelin.notebook.NotebookAuthorization;
import org.apache.zeppelin.notebook.NotebookAuthorizationInfoSaving;
import org.apache.zeppelin.server.ZeppelinServer;
import org.apache.zeppelin.user.AuthenticationInfo;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.FixMethodOrder;
Expand Down Expand Up @@ -61,7 +62,9 @@ public static void destroy() throws Exception {

@Test
public void testPermissions() throws IOException {
Note note1 = ZeppelinServer.notebook.createNote(null);
AuthenticationInfo subject = new AuthenticationInfo();
subject.setUser("anonymous");
Note note1 = ZeppelinServer.notebook.createNote(subject);
// Set only readers
String jsonRequest = "{\"readers\":[\"admin-team\"],\"owners\":[]," +
"\"writers\":[]}";
Expand All @@ -84,7 +87,7 @@ public void testPermissions() throws IOException {
get.releaseConnection();


Note note2 = ZeppelinServer.notebook.createNote(null);
Note note2 = ZeppelinServer.notebook.createNote(subject);
// Set only writers
jsonRequest = "{\"readers\":[],\"owners\":[]," +
"\"writers\":[\"admin-team\"]}";
Expand Down Expand Up @@ -118,8 +121,8 @@ public void testPermissions() throws IOException {
assertEquals(authInfo.get("owners"), Lists.newArrayList());
get.releaseConnection();
//cleanup
ZeppelinServer.notebook.removeNote(note1.getId(), null);
ZeppelinServer.notebook.removeNote(note2.getId(), null);
ZeppelinServer.notebook.removeNote(note1.getId(), subject);
ZeppelinServer.notebook.removeNote(note2.getId(), subject);

}
}
Expand Down

0 comments on commit 787a108

Please sign in to comment.