Skip to content

Commit 650f442

Browse files
committed
SPARK-6433 patch 001: test JARs are built; sql/hive pulls in spark-sql & spark-catalyst for its test runs
1 parent 0745a30 commit 650f442

File tree

6 files changed

+56
-240
lines changed

6 files changed

+56
-240
lines changed

pom.xml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@
158158
<fasterxml.jackson.version>2.4.4</fasterxml.jackson.version>
159159
<snappy.version>1.1.1.6</snappy.version>
160160
<netlib.java.version>1.1.2</netlib.java.version>
161+
<maven-jar-plugin.version>2.6</maven-jar-plugin.version>
161162

162163
<!--
163164
Dependency scopes that can be overridden by enabling certain profiles. These profiles are
@@ -1265,6 +1266,7 @@
12651266
<id>create-source-jar</id>
12661267
<goals>
12671268
<goal>jar-no-fork</goal>
1269+
<goal>test-jar-no-fork</goal>
12681270
</goals>
12691271
</execution>
12701272
</executions>
@@ -1472,6 +1474,46 @@
14721474
<groupId>org.scalatest</groupId>
14731475
<artifactId>scalatest-maven-plugin</artifactId>
14741476
</plugin>
1477+
<!-- Build the JARs-->
1478+
<plugin>
1479+
<groupId>org.apache.maven.plugins</groupId>
1480+
<artifactId>maven-jar-plugin</artifactId>
1481+
<version>${maven-jar-plugin.version}</version>
1482+
<configuration>
1483+
<!-- Configuration of the archiver -->
1484+
<archive>
1485+
<manifestEntries>
1486+
<mode>development</mode>
1487+
<url>${project.url}</url>
1488+
</manifestEntries>
1489+
<manifest>
1490+
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
1491+
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
1492+
</manifest>
1493+
</archive>
1494+
</configuration>
1495+
<executions>
1496+
<execution>
1497+
<id>prepare-jar</id>
1498+
<phase>prepare-package</phase>
1499+
<goals>
1500+
<goal>jar</goal>
1501+
</goals>
1502+
</execution>
1503+
<execution>
1504+
<id>prepare-test-jar</id>
1505+
<phase>prepare-package</phase>
1506+
<goals>
1507+
<goal>test-jar</goal>
1508+
</goals>
1509+
<configuration>
1510+
<excludes>
1511+
<exclude>log4j.properties</exclude>
1512+
</excludes>
1513+
</configuration>
1514+
</execution>
1515+
</executions>
1516+
</plugin>
14751517
</plugins>
14761518
</build>
14771519

sql/hive/pom.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,20 @@
8989
<artifactId>junit</artifactId>
9090
<scope>test</scope>
9191
</dependency>
92+
<dependency>
93+
<groupId>org.apache.spark</groupId>
94+
<artifactId>spark-sql_${scala.binary.version}</artifactId>
95+
<type>test-jar</type>
96+
<version>${project.version}</version>
97+
<scope>test</scope>
98+
</dependency>
99+
<dependency>
100+
<groupId>org.apache.spark</groupId>
101+
<artifactId>spark-catalyst_${scala.binary.version}</artifactId>
102+
<type>test-jar</type>
103+
<version>${project.version}</version>
104+
<scope>test</scope>
105+
</dependency>
92106
</dependencies>
93107
<profiles>
94108
<profile>

sql/hive/src/test/scala/org/apache/spark/sql/QueryTest.scala

Lines changed: 0 additions & 140 deletions
This file was deleted.

sql/hive/src/test/scala/org/apache/spark/sql/catalyst/plans/PlanTest.scala

Lines changed: 0 additions & 57 deletions
This file was deleted.

sql/hive/src/test/scala/org/apache/spark/sql/hive/CachedTableSuite.scala

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,6 @@ import org.apache.spark.sql.{AnalysisException, DataFrame, QueryTest}
2424
import org.apache.spark.storage.RDDBlockId
2525

2626
class CachedTableSuite extends QueryTest {
27-
/**
28-
* Throws a test failed exception when the number of cached tables differs from the expected
29-
* number.
30-
*/
31-
def assertCached(query: DataFrame, numCachedTables: Int = 1): Unit = {
32-
val planWithCaching = query.queryExecution.withCachedData
33-
val cachedData = planWithCaching collect {
34-
case cached: InMemoryRelation => cached
35-
}
36-
37-
assert(
38-
cachedData.size == numCachedTables,
39-
s"Expected query to contain $numCachedTables, but it actually had ${cachedData.size}\n" +
40-
planWithCaching)
41-
}
4227

4328
def rddIdOf(tableName: String): Int = {
4429
val executedPlan = table(tableName).queryExecution.executedPlan

streaming/pom.xml

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -97,34 +97,6 @@
9797
<outputDirectory>target/scala-${scala.binary.version}/classes</outputDirectory>
9898
<testOutputDirectory>target/scala-${scala.binary.version}/test-classes</testOutputDirectory>
9999
<plugins>
100-
<!--
101-
This plugin forces the generation of jar containing streaming test classes,
102-
so that the tests classes of external modules can use them. The two execution profiles
103-
are necessary - first one for 'mvn package', second one for 'mvn test-compile'. Ideally,
104-
'mvn compile' should not compile test classes and therefore should not need this.
105-
However, an open Maven bug (http://jira.codehaus.org/browse/MNG-3559)
106-
causes the compilation to fail if streaming test-jar is not generated. Hence, the
107-
second execution profile for 'mvn test-compile'.
108-
-->
109-
<plugin>
110-
<groupId>org.apache.maven.plugins</groupId>
111-
<artifactId>maven-jar-plugin</artifactId>
112-
<executions>
113-
<execution>
114-
<goals>
115-
<goal>test-jar</goal>
116-
</goals>
117-
</execution>
118-
<execution>
119-
<id>test-jar-on-test-compile</id>
120-
<phase>test-compile</phase>
121-
<goals>
122-
<goal>test-jar</goal>
123-
</goals>
124-
</execution>
125-
</executions>
126-
</plugin>
127-
128100
<plugin>
129101
<groupId>org.apache.maven.plugins</groupId>
130102
<artifactId>maven-shade-plugin</artifactId>

0 commit comments

Comments
 (0)