Skip to content

Commit

Permalink
Revert "[SPARK-22308] Support alternative unit testing styles in exte…
Browse files Browse the repository at this point in the history
…rnal applications"

This reverts commit 592cfea.
  • Loading branch information
gatorsmile committed Oct 29, 2017
1 parent bc7ca97 commit 659acf1
Show file tree
Hide file tree
Showing 8 changed files with 165 additions and 381 deletions.
17 changes: 2 additions & 15 deletions core/src/test/scala/org/apache/spark/SharedSparkContext.scala
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,10 @@ trait SharedSparkContext extends BeforeAndAfterAll with BeforeAndAfterEach { sel

var conf = new SparkConf(false)

/**
* Initialize the [[SparkContext]]. Generally, this is just called from beforeAll; however, in
* test using styles other than FunSuite, there is often code that relies on the session between
* test group constructs and the actual tests, which may need this session. It is purely a
* semantic difference, but semantically, it makes more sense to call 'initializeContext' between
* a 'describe' and an 'it' call than it does to call 'beforeAll'.
*/
protected def initializeContext(): Unit = {
if (null == _sc) {
_sc = new SparkContext(
"local[4]", "test", conf.set("spark.hadoop.fs.file.impl", classOf[DebugFilesystem].getName))
}
}

override def beforeAll() {
super.beforeAll()
initializeContext()
_sc = new SparkContext(
"local[4]", "test", conf.set("spark.hadoop.fs.file.impl", classOf[DebugFilesystem].getName))
}

override def afterAll() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

package org.apache.spark.sql.catalyst.plans

import org.scalatest.Suite

import org.apache.spark.SparkFunSuite
import org.apache.spark.sql.AnalysisException
import org.apache.spark.sql.catalyst.analysis.SimpleAnalyzer
Expand All @@ -31,13 +29,7 @@ import org.apache.spark.sql.internal.SQLConf
/**
* Provides helper methods for comparing plans.
*/
trait PlanTest extends SparkFunSuite with PlanTestBase

/**
* Provides helper methods for comparing plans, but without the overhead of
* mandating a FunSuite.
*/
trait PlanTestBase extends PredicateHelper { self: Suite =>
trait PlanTest extends SparkFunSuite with PredicateHelper {

// TODO(gatorsmile): remove this from PlanTest and all the analyzer rules
protected def conf = SQLConf.get
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 659acf1

Please sign in to comment.