You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by da...@apache.org on 2016/02/03 01:21:19 UTC

incubator-kudu git commit: Use surefire to run Scala tests

Repository: incubator-kudu
Updated Branches:
  refs/heads/master fd6d805fa -> c613d89ba


Use surefire to run Scala tests

The scalatest maven plugin has a longstanding issue that -DskipTests is not
honored.

Change-Id: Ic750e5334f51eef614a5d7ee08685e7b692724a5
Reviewed-on: http://gerrit.cloudera.org:8080/1999
Tested-by: Kudu Jenkins
Reviewed-by: Jean-Daniel Cryans


Project: http://git-wip-us.apache.org/repos/asf/incubator-kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kudu/commit/c613d89b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kudu/tree/c613d89b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kudu/diff/c613d89b

Branch: refs/heads/master
Commit: c613d89bab646fd5df6add7ede047b7b6533a102
Parents: fd6d805
Author: Dan Burkert <da...@cloudera.com>
Authored: Tue Feb 2 16:02:35 2016 -0800
Committer: Dan Burkert <da...@cloudera.com>
Committed: Wed Feb 3 00:20:44 2016 +0000

----------------------------------------------------------------------
 java/kudu-spark/pom.xml                         | 43 +-------------------
 .../org/kududb/spark/DefaultSourceSuite.scala   | 37 -----------------
 .../org/kududb/spark/DefaultSourceTest.scala    | 40 ++++++++++++++++++
 .../org/kududb/spark/KuduContextSuite.scala     | 32 ---------------
 .../org/kududb/spark/KuduContextTest.scala      | 35 ++++++++++++++++
 5 files changed, 77 insertions(+), 110 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/c613d89b/java/kudu-spark/pom.xml
----------------------------------------------------------------------
diff --git a/java/kudu-spark/pom.xml b/java/kudu-spark/pom.xml
index 51a1f0c..9986c0f 100644
--- a/java/kudu-spark/pom.xml
+++ b/java/kudu-spark/pom.xml
@@ -161,47 +161,8 @@
             </plugin>
 
             <plugin>
-                <!-- disable surefire -->
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-surefire-plugin</artifactId>
-                <configuration>
-                    <skipTests>true</skipTests>
-                </configuration>
-            </plugin>
-
-            <plugin>
-                <groupId>org.scalatest</groupId>
-                <artifactId>scalatest-maven-plugin</artifactId>
-                <version>1.0</version>
-                <configuration>
-                    <reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
-                    <junitxml>.</junitxml>
-                    <filereports>WDF TestSuite.txt</filereports>
-                    <parallel>false</parallel>
-                </configuration>
-                <executions>
-                    <execution>
-                        <id>test</id>
-                        <phase>test</phase>
-                        <goals>
-                            <goal>test</goal>
-                        </goals>
-                        <configuration>
-                            <skipTests>false</skipTests>
-                        </configuration>
-                    </execution>
-                    <execution>
-                        <id>integration-test</id>
-                        <phase>integration-test</phase>
-                        <goals>
-                            <goal>test</goal>
-                        </goals>
-                        <configuration>
-                            <tagsToExclude>Integration-Test</tagsToExclude>
-                            <parallel>false</parallel>
-                        </configuration>
-                    </execution>
-                </executions>
+              <groupId>org.apache.maven.plugins</groupId>
+              <artifactId>maven-surefire-plugin</artifactId>
             </plugin>
         </plugins>
     </build>

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/c613d89b/java/kudu-spark/src/test/scala/org/kududb/spark/DefaultSourceSuite.scala
----------------------------------------------------------------------
diff --git a/java/kudu-spark/src/test/scala/org/kududb/spark/DefaultSourceSuite.scala b/java/kudu-spark/src/test/scala/org/kududb/spark/DefaultSourceSuite.scala
deleted file mode 100644
index 820caec..0000000
--- a/java/kudu-spark/src/test/scala/org/kududb/spark/DefaultSourceSuite.scala
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.kududb.spark
-
-import org.apache.spark.sql.SQLContext
-import org.scalatest.FunSuite
-
-class DefaultSourceSuite extends FunSuite with TestContext {
-
-  test("Test basic SparkSQL") {
-    val rowCount = 10
-
-    insertRows(rowCount)
-
-    val sqlContext = new SQLContext(sc)
-
-    sqlContext.load("org.kududb.spark",
-      Map("kudu.table" -> tableName, "kudu.master" -> miniCluster.getMasterAddresses))
-      .registerTempTable(tableName)
-
-    assert(sqlContext.sql("SELECT * FROM " + tableName).collectAsList().size() == rowCount)
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/c613d89b/java/kudu-spark/src/test/scala/org/kududb/spark/DefaultSourceTest.scala
----------------------------------------------------------------------
diff --git a/java/kudu-spark/src/test/scala/org/kududb/spark/DefaultSourceTest.scala b/java/kudu-spark/src/test/scala/org/kududb/spark/DefaultSourceTest.scala
new file mode 100644
index 0000000..17cea07
--- /dev/null
+++ b/java/kudu-spark/src/test/scala/org/kududb/spark/DefaultSourceTest.scala
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.kududb.spark
+
+import org.apache.spark.sql.SQLContext
+import org.junit.runner.RunWith
+import org.scalatest.FunSuite
+import org.scalatest.junit.JUnitRunner
+
+@RunWith(classOf[JUnitRunner])
+class DefaultSourceTest extends FunSuite with TestContext {
+
+  test("Test basic SparkSQL") {
+    val rowCount = 10
+
+    insertRows(rowCount)
+
+    val sqlContext = new SQLContext(sc)
+
+    sqlContext.load("org.kududb.spark",
+      Map("kudu.table" -> tableName, "kudu.master" -> miniCluster.getMasterAddresses))
+      .registerTempTable(tableName)
+
+    assert(sqlContext.sql("SELECT * FROM " + tableName).collectAsList().size() == rowCount)
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/c613d89b/java/kudu-spark/src/test/scala/org/kududb/spark/KuduContextSuite.scala
----------------------------------------------------------------------
diff --git a/java/kudu-spark/src/test/scala/org/kududb/spark/KuduContextSuite.scala b/java/kudu-spark/src/test/scala/org/kududb/spark/KuduContextSuite.scala
deleted file mode 100644
index 67f8c89..0000000
--- a/java/kudu-spark/src/test/scala/org/kududb/spark/KuduContextSuite.scala
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.kududb.spark
-
-import org.scalatest.FunSuite
-
-class KuduContextSuite extends FunSuite with TestContext {
-  test("Test basic kuduRDD") {
-    val rowCount = 10
-
-    insertRows(rowCount)
-
-    val scanRdd = kuduContext.kuduRDD(sc, "test")
-
-    val scanList = scanRdd.map(r => r.getInt(0)).collect()
-    assert(scanList.length == rowCount)
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/c613d89b/java/kudu-spark/src/test/scala/org/kududb/spark/KuduContextTest.scala
----------------------------------------------------------------------
diff --git a/java/kudu-spark/src/test/scala/org/kududb/spark/KuduContextTest.scala b/java/kudu-spark/src/test/scala/org/kududb/spark/KuduContextTest.scala
new file mode 100644
index 0000000..67aad7b
--- /dev/null
+++ b/java/kudu-spark/src/test/scala/org/kududb/spark/KuduContextTest.scala
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.kududb.spark
+
+import org.junit.runner.RunWith
+import org.scalatest.FunSuite
+import org.scalatest.junit.JUnitRunner
+
+@RunWith(classOf[JUnitRunner])
+class KuduContextTest extends FunSuite with TestContext {
+  test("Test basic kuduRDD") {
+    val rowCount = 10
+
+    insertRows(rowCount)
+
+    val scanRdd = kuduContext.kuduRDD(sc, "test")
+
+    val scanList = scanRdd.map(r => r.getInt(0)).collect()
+    assert(scanList.length == rowCount)
+  }
+}
\ No newline at end of file