Skip to content

Commit

Permalink
Setting test jars on executor classpath during tests from sbt.
Browse files Browse the repository at this point in the history
  • Loading branch information
ScrapCodes committed Nov 10, 2014
1 parent d4874cb commit 034b369
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
6 changes: 0 additions & 6 deletions bin/compute-classpath.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,6 @@ if [ -n "$datanucleus_jars" ]; then
fi
fi

test_jars=$(find "$FWDIR"/lib_managed/test \( -name '*jar' -a -type f \) 2>/dev/null | \
tr "\n" : | sed s/:$//g)

# Add test classes if we're running from SBT or Maven with SPARK_TESTING set to 1
if [[ $SPARK_TESTING == 1 ]]; then
CLASSPATH="$CLASSPATH:$FWDIR/core/target/scala-$SPARK_SCALA_VERSION/test-classes"
Expand All @@ -151,9 +148,6 @@ if [[ $SPARK_TESTING == 1 ]]; then
CLASSPATH="$CLASSPATH:$FWDIR/sql/catalyst/target/scala-$SPARK_SCALA_VERSION/test-classes"
CLASSPATH="$CLASSPATH:$FWDIR/sql/core/target/scala-$SPARK_SCALA_VERSION/test-classes"
CLASSPATH="$CLASSPATH:$FWDIR/sql/hive/target/scala-$SPARK_SCALA_VERSION/test-classes"
if [[ $SPARK_SCALA_VERSION == "2.11" ]]; then
CLASSPATH="$CLASSPATH:$test_jars"
fi
fi

# Add hadoop conf dir if given -- otherwise FileSystem.*, etc fail !
Expand Down
8 changes: 5 additions & 3 deletions project/SparkBuild.scala
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ object BuildCommons {
private val buildLocation = file(".").getAbsoluteFile.getParentFile

val allProjects@Seq(bagel, catalyst, core, graphx, hive, hiveThriftServer, mllib, repl,
sql, networkCommon, networkShuffle, streaming, streamingFlumeSink, streamingFlume, streamingKafka,
streamingMqtt, streamingTwitter, streamingZeromq) =
sql, networkCommon, networkShuffle, streaming, streamingFlumeSink, streamingFlume, streamingKafka,
streamingMqtt, streamingTwitter, streamingZeromq) =
Seq("bagel", "catalyst", "core", "graphx", "hive", "hive-thriftserver", "mllib", "repl",
"sql", "network-common", "network-shuffle", "streaming", "streaming-flume-sink",
"streaming-flume", "streaming-kafka", "streaming-mqtt", "streaming-twitter",
Expand Down Expand Up @@ -361,8 +361,10 @@ object TestSettings {
.map { case (k,v) => s"-D$k=$v" }.toSeq,
javaOptions in Test ++= "-Xmx3g -XX:PermSize=128M -XX:MaxNewSize=256m -XX:MaxPermSize=1g"
.split(" ").toSeq,
javaOptions in Test +=
"-Dspark.executor.extraClassPath=" + (fullClasspath in Test).value.files.
map(_.getAbsolutePath).mkString(":").stripSuffix(":"),
javaOptions += "-Xmx3g",
retrievePattern := "[conf]/[artifact](-[revision]).[ext]",
// Show full stack trace and duration in test cases.
testOptions in Test += Tests.Argument("-oDF"),
testOptions += Tests.Argument(TestFrameworks.JUnit, "-v", "-a"),
Expand Down

0 comments on commit 034b369

Please sign in to comment.