Skip to content

Commit cecda32

Browse files
Andrew Orjeanlyn
authored andcommitted
[SPARK-7558] Demarcate tests in unit-tests.log
Right now `unit-tests.log` are not of much value because we can't tell where the test boundaries are easily. This patch adds log statements before and after each test to outline the test boundaries, e.g.: ``` ===== TEST OUTPUT FOR o.a.s.serializer.KryoSerializerSuite: 'kryo with parallelize for primitive arrays' ===== 15/05/27 12:36:39.596 pool-1-thread-1-ScalaTest-running-KryoSerializerSuite INFO SparkContext: Starting job: count at KryoSerializerSuite.scala:230 15/05/27 12:36:39.596 dag-scheduler-event-loop INFO DAGScheduler: Got job 3 (count at KryoSerializerSuite.scala:230) with 4 output partitions (allowLocal=false) 15/05/27 12:36:39.596 dag-scheduler-event-loop INFO DAGScheduler: Final stage: ResultStage 3(count at KryoSerializerSuite.scala:230) 15/05/27 12:36:39.596 dag-scheduler-event-loop INFO DAGScheduler: Parents of final stage: List() 15/05/27 12:36:39.597 dag-scheduler-event-loop INFO DAGScheduler: Missing parents: List() 15/05/27 12:36:39.597 dag-scheduler-event-loop INFO DAGScheduler: Submitting ResultStage 3 (ParallelCollectionRDD[5] at parallelize at KryoSerializerSuite.scala:230), which has no missing parents ... 15/05/27 12:36:39.624 pool-1-thread-1-ScalaTest-running-KryoSerializerSuite INFO DAGScheduler: Job 3 finished: count at KryoSerializerSuite.scala:230, took 0.028563 s 15/05/27 12:36:39.625 pool-1-thread-1-ScalaTest-running-KryoSerializerSuite INFO KryoSerializerSuite: ***** FINISHED o.a.s.serializer.KryoSerializerSuite: 'kryo with parallelize for primitive arrays' ***** ... ``` Author: Andrew Or <[email protected]> Closes apache#6441 from andrewor14/demarcate-tests and squashes the following commits: 879b060 [Andrew Or] Fix compile after rebase d622af7 [Andrew Or] Merge branch 'master' of github.com:apache/spark into demarcate-tests 017c8ba [Andrew Or] Merge branch 'master' of github.com:apache/spark into demarcate-tests 7790b6c [Andrew Or] Fix tests after logical merge conflict c7460c0 [Andrew Or] Merge branch 'master' of github.com:apache/spark into demarcate-tests c43ffc4 [Andrew Or] Fix tests? 8882581 [Andrew Or] Fix tests ee22cda [Andrew Or] Fix log message fa9450e [Andrew Or] Merge branch 'master' of github.com:apache/spark into demarcate-tests 12d1e1b [Andrew Or] Various whitespace changes (minor) 69cbb24 [Andrew Or] Make all test suites extend SparkFunSuite instead of FunSuite bbce12e [Andrew Or] Fix manual things that cannot be covered through automation da0b12f [Andrew Or] Add core tests as dependencies in all modules f7d29ce [Andrew Or] Introduce base abstract class for all test suites
1 parent 4bd93eb commit cecda32

File tree

364 files changed

+955
-967
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

364 files changed

+955
-967
lines changed

bagel/pom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@
4040
<artifactId>spark-core_${scala.binary.version}</artifactId>
4141
<version>${project.version}</version>
4242
</dependency>
43+
<dependency>
44+
<groupId>org.apache.spark</groupId>
45+
<artifactId>spark-core_${scala.binary.version}</artifactId>
46+
<version>${project.version}</version>
47+
<type>test-jar</type>
48+
<scope>test</scope>
49+
</dependency>
4350
<dependency>
4451
<groupId>org.scalacheck</groupId>
4552
<artifactId>scalacheck_${scala.binary.version}</artifactId>

bagel/src/test/scala/org/apache/spark/bagel/BagelSuite.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
package org.apache.spark.bagel
1919

20-
import org.scalatest.{BeforeAndAfter, FunSuite, Assertions}
20+
import org.scalatest.{BeforeAndAfter, Assertions}
2121
import org.scalatest.concurrent.Timeouts
2222
import org.scalatest.time.SpanSugar._
2323

@@ -27,7 +27,7 @@ import org.apache.spark.storage.StorageLevel
2727
class TestVertex(val active: Boolean, val age: Int) extends Vertex with Serializable
2828
class TestMessage(val targetId: String) extends Message[String] with Serializable
2929

30-
class BagelSuite extends FunSuite with Assertions with BeforeAndAfter with Timeouts {
30+
class BagelSuite extends SparkFunSuite with Assertions with BeforeAndAfter with Timeouts {
3131

3232
var sc: SparkContext = _
3333

core/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,12 @@
338338
<dependency>
339339
<groupId>org.seleniumhq.selenium</groupId>
340340
<artifactId>selenium-java</artifactId>
341+
<exclusions>
342+
<exclusion>
343+
<groupId>com.google.guava</groupId>
344+
<artifactId>guava</artifactId>
345+
</exclusion>
346+
</exclusions>
341347
<scope>test</scope>
342348
</dependency>
343349
<!-- Added for selenium: -->

core/src/test/scala/org/apache/spark/AccumulatorSuite.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,10 @@ package org.apache.spark
2020
import scala.collection.mutable
2121
import scala.ref.WeakReference
2222

23-
import org.scalatest.FunSuite
2423
import org.scalatest.Matchers
2524

2625

27-
class AccumulatorSuite extends FunSuite with Matchers with LocalSparkContext {
26+
class AccumulatorSuite extends SparkFunSuite with Matchers with LocalSparkContext {
2827

2928

3029
implicit def setAccum[A]: AccumulableParam[mutable.Set[A], A] =

core/src/test/scala/org/apache/spark/CacheManagerSuite.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@
1818
package org.apache.spark
1919

2020
import org.mockito.Mockito._
21-
import org.scalatest.{BeforeAndAfter, FunSuite}
21+
import org.scalatest.BeforeAndAfter
2222
import org.scalatest.mock.MockitoSugar
2323

2424
import org.apache.spark.executor.DataReadMethod
2525
import org.apache.spark.rdd.RDD
2626
import org.apache.spark.storage._
2727

2828
// TODO: Test the CacheManager's thread-safety aspects
29-
class CacheManagerSuite extends FunSuite with LocalSparkContext with BeforeAndAfter
29+
class CacheManagerSuite extends SparkFunSuite with LocalSparkContext with BeforeAndAfter
3030
with MockitoSugar {
3131

3232
var blockManager: BlockManager = _

core/src/test/scala/org/apache/spark/CheckpointSuite.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,11 @@ import java.io.File
2121

2222
import scala.reflect.ClassTag
2323

24-
import org.scalatest.FunSuite
25-
2624
import org.apache.spark.rdd._
2725
import org.apache.spark.storage.{BlockId, StorageLevel, TestBlockId}
2826
import org.apache.spark.util.Utils
2927

30-
class CheckpointSuite extends FunSuite with LocalSparkContext with Logging {
28+
class CheckpointSuite extends SparkFunSuite with LocalSparkContext with Logging {
3129
var checkpointDir: File = _
3230
val partitioner = new HashPartitioner(2)
3331

core/src/test/scala/org/apache/spark/ContextCleanerSuite.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import scala.collection.mutable.{HashSet, SynchronizedSet}
2323
import scala.language.existentials
2424
import scala.util.Random
2525

26-
import org.scalatest.{BeforeAndAfter, FunSuite}
26+
import org.scalatest.BeforeAndAfter
2727
import org.scalatest.concurrent.{PatienceConfiguration, Eventually}
2828
import org.scalatest.concurrent.Eventually._
2929
import org.scalatest.time.SpanSugar._
@@ -44,7 +44,7 @@ import org.apache.spark.storage.ShuffleIndexBlockId
4444
* config options, in particular, a different shuffle manager class
4545
*/
4646
abstract class ContextCleanerSuiteBase(val shuffleManager: Class[_] = classOf[HashShuffleManager])
47-
extends FunSuite with BeforeAndAfter with LocalSparkContext
47+
extends SparkFunSuite with BeforeAndAfter with LocalSparkContext
4848
{
4949
implicit val defaultTimeout = timeout(10000 millis)
5050
val conf = new SparkConf()

core/src/test/scala/org/apache/spark/DistributedSuite.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
package org.apache.spark
1919

20-
import org.scalatest.FunSuite
2120
import org.scalatest.concurrent.Timeouts._
2221
import org.scalatest.Matchers
2322
import org.scalatest.time.{Millis, Span}
@@ -28,7 +27,7 @@ class NotSerializableClass
2827
class NotSerializableExn(val notSer: NotSerializableClass) extends Throwable() {}
2928

3029

31-
class DistributedSuite extends FunSuite with Matchers with LocalSparkContext {
30+
class DistributedSuite extends SparkFunSuite with Matchers with LocalSparkContext {
3231

3332
val clusterUrl = "local-cluster[2,1,512]"
3433

core/src/test/scala/org/apache/spark/DriverSuite.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,13 @@ package org.apache.spark
1919

2020
import java.io.File
2121

22-
import org.scalatest.FunSuite
2322
import org.scalatest.concurrent.Timeouts
2423
import org.scalatest.prop.TableDrivenPropertyChecks._
2524
import org.scalatest.time.SpanSugar._
2625

2726
import org.apache.spark.util.Utils
2827

29-
class DriverSuite extends FunSuite with Timeouts {
28+
class DriverSuite extends SparkFunSuite with Timeouts {
3029

3130
ignore("driver should exit after finishing without cleanup (SPARK-530)") {
3231
val sparkHome = sys.props.getOrElse("spark.test.home", fail("spark.test.home is not set!"))

core/src/test/scala/org/apache/spark/ExecutorAllocationManagerSuite.scala

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ package org.apache.spark
1919

2020
import scala.collection.mutable
2121

22-
import org.scalatest.{BeforeAndAfter, FunSuite, PrivateMethodTester}
22+
import org.scalatest.{BeforeAndAfter, PrivateMethodTester}
2323
import org.apache.spark.executor.TaskMetrics
2424
import org.apache.spark.scheduler._
2525
import org.apache.spark.scheduler.cluster.ExecutorInfo
@@ -28,7 +28,11 @@ import org.apache.spark.util.ManualClock
2828
/**
2929
* Test add and remove behavior of ExecutorAllocationManager.
3030
*/
31-
class ExecutorAllocationManagerSuite extends FunSuite with LocalSparkContext with BeforeAndAfter {
31+
class ExecutorAllocationManagerSuite
32+
extends SparkFunSuite
33+
with LocalSparkContext
34+
with BeforeAndAfter {
35+
3236
import ExecutorAllocationManager._
3337
import ExecutorAllocationManagerSuite._
3438

0 commit comments

Comments
 (0)