Skip to content

Commit 83bec7f

Browse files
author
Marcelo Vanzin
committed
Revert "Tag a random sample of tests in HiveCompatibilitySuite with ExtendedHiveTest."
This reverts commit b7d0507.
1 parent 85fed20 commit 83bec7f

File tree

6 files changed

+9
-66
lines changed

6 files changed

+9
-66
lines changed

sql/hive/compatibility/src/test/scala/org/apache/spark/sql/hive/execution/HashJoinCompatibilitySuite.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,11 @@ package org.apache.spark.sql.hive.execution
2020
import java.io.File
2121

2222
import org.apache.spark.sql.SQLConf
23-
import org.apache.spark.sql.hive.ExtendedHiveTest
2423
import org.apache.spark.sql.hive.test.TestHive
2524

2625
/**
2726
* Runs the test cases that are included in the hive distribution with hash joins.
2827
*/
29-
@ExtendedHiveTest
3028
class HashJoinCompatibilitySuite extends HiveCompatibilitySuite {
3129
override def beforeAll() {
3230
super.beforeAll()

sql/hive/compatibility/src/test/scala/org/apache/spark/sql/hive/execution/HiveCompatibilitySuite.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@ import org.apache.spark.sql.catalyst.rules.RuleExecutor
2424
import org.scalatest.BeforeAndAfter
2525

2626
import org.apache.spark.sql.SQLConf
27+
import org.apache.spark.sql.hive.ExtendedHiveTest
2728
import org.apache.spark.sql.hive.test.TestHive
2829

2930
/**
3031
* Runs the test cases that are included in the hive distribution.
3132
*/
33+
@ExtendedHiveTest
3234
class HiveCompatibilitySuite extends HiveQueryFileTest with BeforeAndAfter {
3335
// TODO: bundle in jar files... get from classpath
3436
private lazy val hiveQueryDir = TestHive.getHiveFile(

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

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

sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveComparisonTest.scala

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import java.io._
2121

2222
import scala.util.control.NonFatal
2323

24-
import org.scalatest.{BeforeAndAfterAll, GivenWhenThen, Tag}
24+
import org.scalatest.{BeforeAndAfterAll, GivenWhenThen}
2525

2626
import org.apache.spark.{Logging, SparkFunSuite}
2727
import org.apache.spark.sql.catalyst.planning.PhysicalOperation
@@ -209,11 +209,7 @@ abstract class HiveComparisonTest
209209
}
210210

211211
val installHooksCommand = "(?i)SET.*hooks".r
212-
def createQueryTest(
213-
testCaseName: String,
214-
sql: String,
215-
tag: Option[Tag] = None,
216-
reset: Boolean = true) {
212+
def createQueryTest(testCaseName: String, sql: String, reset: Boolean = true) {
217213
// testCaseName must not contain ':', which is not allowed to appear in a filename of Windows
218214
assert(!testCaseName.contains(":"))
219215

@@ -241,16 +237,7 @@ abstract class HiveComparisonTest
241237
return
242238
}
243239

244-
def createTest(name: String)(fn: => Unit): Unit = {
245-
tag match {
246-
case Some(tagValue) =>
247-
test(name, tagValue)(fn)
248-
case None =>
249-
test(name)(fn)
250-
}
251-
}
252-
253-
createTest(testCaseName) {
240+
test(testCaseName) {
254241
logDebug(s"=== HIVE TEST: $testCaseName ===")
255242

256243
// Clear old output for this testcase.

sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQueryFileTest.scala

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ package org.apache.spark.sql.hive.execution
1919

2020
import java.io.File
2121

22-
import scala.util.Random
23-
2422
import org.apache.spark.sql.catalyst.util._
25-
import org.apache.spark.sql.hive.TestTags.ExtendedHiveTest
2623

2724
/**
2825
* A framework for running the query tests that are listed as a set of text files.
@@ -54,36 +51,21 @@ abstract class HiveQueryFileTest extends HiveComparisonTest {
5451
Option(System.getProperty(whiteListProperty)).map(_.split(",").toSeq).getOrElse(whiteList)
5552

5653
// Go through all the test cases and add them to scala test.
57-
val testsToRun = testCases.sorted.flatMap {
54+
testCases.sorted.foreach {
5855
case (testCaseName, testCaseFile) =>
5956
if (blackList.map(_.r.pattern.matcher(testCaseName).matches()).reduceLeft(_||_)) {
6057
logDebug(s"Blacklisted test skipped $testCaseName")
61-
None
6258
} else if (realWhiteList.map(_.r.pattern.matcher(testCaseName).matches()).reduceLeft(_||_) ||
6359
runAll) {
6460
// Build a test case and submit it to scala test framework...
65-
Some(testCaseName -> testCaseFile)
61+
val queriesString = fileToString(testCaseFile)
62+
createQueryTest(testCaseName, queriesString)
6663
} else {
6764
// Only output warnings for the built in whitelist as this clutters the output when the user
6865
// trying to execute a single test from the commandline.
6966
if (System.getProperty(whiteListProperty) == null && !runAll) {
7067
ignore(testCaseName) {}
7168
}
72-
None
7369
}
7470
}
75-
76-
// Pick a random sample of tests to serve as a "smoke" test. This is used by automated tests when
77-
// the sql/ code hasn't been changed, to avoid running the whole test suite for every PR that
78-
// touches core code.
79-
private val smokeCount = sys.props.getOrElse("spark.hive.smoke.count", "20").toInt
80-
private val smokeSet = Random.shuffle(testsToRun).take(smokeCount)
81-
.map { case (name, _) => name }.toSet
82-
83-
testsToRun.foreach { case (testCaseName, testCaseFile) =>
84-
val queriesString = fileToString(testCaseFile)
85-
val tag = if (!smokeSet.contains(testCaseName)) Some(ExtendedHiveTest) else None
86-
createQueryTest(testCaseName, queriesString, tag = tag)
87-
}
88-
8971
}

sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveSerDeSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class HiveSerDeSuite extends HiveComparisonTest with BeforeAndAfterAll {
3838
}
3939

4040
// table sales is not a cache table, and will be clear after reset
41-
createQueryTest("Read with RegexSerDe", "SELECT * FROM sales", reset = false)
41+
createQueryTest("Read with RegexSerDe", "SELECT * FROM sales", false)
4242

4343
createQueryTest(
4444
"Read and write with LazySimpleSerDe (tab separated)",

0 commit comments

Comments
 (0)