aboutsummaryrefslogtreecommitdiff
path: root/pom.xml
diff options
context:
space:
mode:
authorSean Owen <sowen@cloudera.com>2015-01-06 12:02:08 -0800
committerJosh Rosen <joshrosen@databricks.com>2015-01-06 12:02:08 -0800
commit4cba6eb42031b1a4cc3308833116ca5d9ccb1a89 (patch)
tree0d0a6e192ce742543f6c1ef05c61360930653a01 /pom.xml
parent5e3ec1110495899a298313c4aa9c6c151c1f54da (diff)
downloadspark-4cba6eb42031b1a4cc3308833116ca5d9ccb1a89.tar.gz
spark-4cba6eb42031b1a4cc3308833116ca5d9ccb1a89.tar.bz2
spark-4cba6eb42031b1a4cc3308833116ca5d9ccb1a89.zip
SPARK-4159 [CORE] Maven build doesn't run JUnit test suites
This PR: - Reenables `surefire`, and copies config from `scalatest` (which is itself an old fork of `surefire`, so similar) - Tells `surefire` to test only Java tests - Enables `surefire` and `scalatest` for all children, and in turn eliminates some duplication. For me this causes the Scala and Java tests to be run once each, it seems, as desired. It doesn't affect the SBT build but works for Maven. I still need to verify that all of the Scala tests and Java tests are being run. Author: Sean Owen <sowen@cloudera.com> Closes #3651 from srowen/SPARK-4159 and squashes the following commits: 2e8a0af [Sean Owen] Remove specialized SPARK_HOME setting for REPL, YARN tests as it appears to be obsolete 12e4558 [Sean Owen] Append to unit-test.log instead of overwriting, so that both surefire and scalatest output is preserved. Also standardize/correct comments a bit. e6f8601 [Sean Owen] Reenable Java tests by reenabling surefire with config cloned from scalatest; centralize test config in the parent
Diffstat (limited to 'pom.xml')
-rw-r--r--pom.xml45
1 files changed, 41 insertions, 4 deletions
diff --git a/pom.xml b/pom.xml
index 05f59a9b41..46ff211f91 100644
--- a/pom.xml
+++ b/pom.xml
@@ -256,7 +256,7 @@
<version>1.0.0</version>
</dependency>
<!--
- This depndency has been added to provided scope as it is needed for executing build
+ This dependency has been added to provided scope as it is needed for executing build
specific groovy scripts using gmaven+ and not required for downstream project building
with spark.
-->
@@ -266,6 +266,15 @@
<version>2.3.7</version>
<scope>provided</scope>
</dependency>
+ <!--
+ This is needed by the scalatest plugin, and so is declared here to be available in
+ all child modules, just as scalatest is run in all children
+ -->
+ <dependency>
+ <groupId>org.scalatest</groupId>
+ <artifactId>scalatest_${scala.binary.version}</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<dependencyManagement>
<dependencies>
@@ -935,19 +944,38 @@
<fork>true</fork>
</configuration>
</plugin>
+ <!-- Surefire runs all Java tests -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <version>2.17</version>
+ <version>2.18</version>
+ <!-- Note config is repeated in scalatest config -->
<configuration>
- <!-- Uses scalatest instead -->
- <skipTests>true</skipTests>
+ <includes>
+ <include>**/Test*.java</include>
+ <include>**/*Test.java</include>
+ <include>**/*TestCase.java</include>
+ <include>**/*Suite.java</include>
+ </includes>
+ <reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
+ <argLine>-Xmx3g -XX:MaxPermSize=${MaxPermGen} -XX:ReservedCodeCacheSize=512m</argLine>
+ <systemProperties>
+ <java.awt.headless>true</java.awt.headless>
+ <spark.test.home>${session.executionRootDirectory}</spark.test.home>
+ <spark.testing>1</spark.testing>
+ <spark.ui.enabled>false</spark.ui.enabled>
+ <spark.ui.showConsoleProgress>false</spark.ui.showConsoleProgress>
+ <spark.executor.extraClassPath>${test_classpath}</spark.executor.extraClassPath>
+ <spark.driver.allowMultipleContexts>true</spark.driver.allowMultipleContexts>
+ </systemProperties>
</configuration>
</plugin>
+ <!-- Scalatest runs all Scala tests -->
<plugin>
<groupId>org.scalatest</groupId>
<artifactId>scalatest-maven-plugin</artifactId>
<version>1.0</version>
+ <!-- Note config is repeated in surefire config -->
<configuration>
<reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
<junitxml>.</junitxml>
@@ -1159,6 +1187,15 @@
</execution>
</executions>
</plugin>
+ <!-- Enable surefire and scalatest in all children, in one place: -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.scalatest</groupId>
+ <artifactId>scalatest-maven-plugin</artifactId>
+ </plugin>
</plugins>
</build>