Skip to content

Commit 0734d09

Browse files
pwendellaarondav
authored andcommitted
HOTFIX: Clean up build in network module.
This is currently breaking the package build for some people (including me). This patch does some general clean-up which also fixes the current issue. - Uses consistent artifact naming - Adds sbt support for this module - Changes tests to use scalatest (fixes the original issue[1]) One thing to note, it turns out that scalatest when invoked in the Maven build doesn't succesfully detect JUnit Java tests. This is a long standing issue, I noticed it applies to all of our current test suites as well. I've created SPARK-4159 to fix this. [1] The original issue is that we need to allocate extra memory for the tests, happens by default in our scalatest configuration. Author: Patrick Wendell <[email protected]> Closes #3025 from pwendell/hotfix and squashes the following commits: faa9053 [Patrick Wendell] HOTFIX: Clean up build in network module.
1 parent 26d31d1 commit 0734d09

File tree

3 files changed

+23
-21
lines changed

3 files changed

+23
-21
lines changed

core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
</dependency>
4747
<dependency>
4848
<groupId>org.apache.spark</groupId>
49-
<artifactId>network</artifactId>
49+
<artifactId>spark-network-common_2.10</artifactId>
5050
<version>${project.version}</version>
5151
</dependency>
5252
<dependency>

network/common/pom.xml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@
2727
</parent>
2828

2929
<groupId>org.apache.spark</groupId>
30-
<artifactId>network</artifactId>
30+
<artifactId>spark-network-common_2.10</artifactId>
3131
<packaging>jar</packaging>
32-
<name>Shuffle Streaming Service</name>
32+
<name>Spark Project Common Network Code</name>
3333
<url>http://spark.apache.org/</url>
3434
<properties>
35-
<sbt.project.name>network</sbt.project.name>
35+
<sbt.project.name>network-common</sbt.project.name>
3636
</properties>
3737

3838
<dependencies>
@@ -59,6 +59,11 @@
5959
<artifactId>junit</artifactId>
6060
<scope>test</scope>
6161
</dependency>
62+
<dependency>
63+
<groupId>com.novocode</groupId>
64+
<artifactId>junit-interface</artifactId>
65+
<scope>test</scope>
66+
</dependency>
6267
<dependency>
6368
<groupId>log4j</groupId>
6469
<artifactId>log4j</artifactId>
@@ -69,25 +74,20 @@
6974
<artifactId>mockito-all</artifactId>
7075
<scope>test</scope>
7176
</dependency>
77+
<dependency>
78+
<groupId>org.scalatest</groupId>
79+
<artifactId>scalatest_${scala.binary.version}</artifactId>
80+
<scope>test</scope>
81+
</dependency>
7282
</dependencies>
7383

74-
7584
<build>
76-
<outputDirectory>target/java/classes</outputDirectory>
77-
<testOutputDirectory>target/java/test-classes</testOutputDirectory>
85+
<outputDirectory>target/scala-${scala.binary.version}/classes</outputDirectory>
86+
<testOutputDirectory>target/scala-${scala.binary.version}/test-classes</testOutputDirectory>
7887
<plugins>
7988
<plugin>
80-
<groupId>org.apache.maven.plugins</groupId>
81-
<artifactId>maven-surefire-plugin</artifactId>
82-
<version>2.17</version>
83-
<configuration>
84-
<skipTests>false</skipTests>
85-
<includes>
86-
<include>**/Test*.java</include>
87-
<include>**/*Test.java</include>
88-
<include>**/*Suite.java</include>
89-
</includes>
90-
</configuration>
89+
<groupId>org.scalatest</groupId>
90+
<artifactId>scalatest-maven-plugin</artifactId>
9191
</plugin>
9292
</plugins>
9393
</build>

project/SparkBuild.scala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ object BuildCommons {
3131
private val buildLocation = file(".").getAbsoluteFile.getParentFile
3232

3333
val allProjects@Seq(bagel, catalyst, core, graphx, hive, hiveThriftServer, mllib, repl,
34-
sql, streaming, streamingFlumeSink, streamingFlume, streamingKafka, streamingMqtt,
34+
sql, networkCommon, streaming, streamingFlumeSink, streamingFlume, streamingKafka, streamingMqtt,
3535
streamingTwitter, streamingZeromq) =
3636
Seq("bagel", "catalyst", "core", "graphx", "hive", "hive-thriftserver", "mllib", "repl",
37-
"sql", "streaming", "streaming-flume-sink", "streaming-flume", "streaming-kafka",
37+
"sql", "network-common", "streaming", "streaming-flume-sink", "streaming-flume", "streaming-kafka",
3838
"streaming-mqtt", "streaming-twitter", "streaming-zeromq").map(ProjectRef(buildLocation, _))
3939

4040
val optionallyEnabledProjects@Seq(yarn, yarnStable, yarnAlpha, java8Tests, sparkGangliaLgpl, sparkKinesisAsl) =
@@ -142,7 +142,9 @@ object SparkBuild extends PomBuild {
142142

143143
// TODO: Add Sql to mima checks
144144
allProjects.filterNot(x => Seq(spark, sql, hive, hiveThriftServer, catalyst, repl,
145-
streamingFlumeSink).contains(x)).foreach(x => enable(MimaBuild.mimaSettings(sparkHome, x))(x))
145+
streamingFlumeSink, networkCommon).contains(x)).foreach {
146+
x => enable(MimaBuild.mimaSettings(sparkHome, x))(x)
147+
}
146148

147149
/* Enable Assembly for all assembly projects */
148150
assemblyProjects.foreach(enable(Assembly.settings))

0 commit comments

Comments
 (0)