Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GLUTEN-6251][CH] Disable GlutenSortShuffleSuite in clickhouse backend #6252

Merged
merged 1 commit into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,36 +20,13 @@ import org.apache.gluten.GlutenConfig
import org.apache.gluten.utils.{BackendTestUtils, SystemParameters}

import org.apache.spark.SparkConf
import org.apache.spark.sql.GlutenTestConstants.GLUTEN_TEST
import org.apache.spark.sql.execution.SparkPlan
import org.apache.spark.sql.execution.adaptive.{AdaptiveSparkPlanExec, ShuffleQueryStageExec}
import org.apache.spark.sql.test.SharedSparkSession

import org.scalactic.source.Position
import org.scalatest.Tag

/** Basic trait for Gluten SQL test cases. */
trait GlutenSQLTestsBaseTrait extends SharedSparkSession with GlutenTestsBaseTrait {

protected def testGluten(testName: String, testTag: Tag*)(testFun: => Any)(implicit
pos: Position): Unit = {
test(GLUTEN_TEST + testName, testTag: _*)(testFun)
}

protected def ignoreGluten(testName: String, testTag: Tag*)(testFun: => Any)(implicit
pos: Position): Unit = {
super.ignore(GLUTEN_TEST + testName, testTag: _*)(testFun)
}

override protected def test(testName: String, testTags: Tag*)(testFun: => Any)(implicit
pos: Position): Unit = {
if (shouldRun(testName)) {
super.test(testName, testTags: _*)(testFun)
} else {
super.ignore(testName, testTags: _*)(testFun)
}
}

override def sparkConf: SparkConf = {
GlutenSQLTestsBaseTrait.nativeSparkConf(super.sparkConf, warehouse)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ package org.apache.spark.sql

import org.apache.gluten.utils.BackendTestSettings

trait GlutenTestsBaseTrait {
import org.apache.spark.sql.GlutenTestConstants.GLUTEN_TEST

import org.scalactic.source.Position
import org.scalatest.Tag
import org.scalatest.funsuite.AnyFunSuiteLike

trait GlutenTestsBaseTrait extends AnyFunSuiteLike {

protected val rootPath: String = getClass.getResource("/").getPath
protected val basePath: String = rootPath + "unit-tests-working-home"
Expand All @@ -30,7 +36,7 @@ trait GlutenTestsBaseTrait {
// list will never be run with no regard to backend test settings.
def testNameBlackList: Seq[String] = Seq()

def shouldRun(testName: String): Boolean = {
protected def shouldRun(testName: String): Boolean = {
if (testNameBlackList.exists(_.equalsIgnoreCase(GlutenTestConstants.IGNORE_ALL))) {
return false
}
Expand All @@ -39,4 +45,24 @@ trait GlutenTestsBaseTrait {
}
BackendTestSettings.shouldRun(getClass.getCanonicalName, testName)
}

protected def testGluten(testName: String, testTag: Tag*)(testFun: => Any)(implicit
pos: Position): Unit = {
test(GLUTEN_TEST + testName, testTag: _*)(testFun)
}

protected def ignoreGluten(testName: String, testTag: Tag*)(testFun: => Any)(implicit
pos: Position): Unit = {
super.ignore(GLUTEN_TEST + testName, testTag: _*)(testFun)
}

override protected def test(testName: String, testTags: Tag*)(testFun: => Any)(implicit
pos: Position): Unit = {
if (shouldRun(testName)) {
super.test(testName, testTags: _*)(testFun)
} else {
super.ignore(testName, testTags: _*)(testFun)
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@ package org.apache.spark.sql
import org.apache.gluten.test.TestStats

import org.apache.spark.SparkFunSuite
import org.apache.spark.sql.GlutenTestConstants.GLUTEN_TEST
import org.apache.spark.sql.catalyst.expressions._

import org.scalactic.source.Position
import org.scalatest.{Args, Status, Tag}
import org.scalatest.{Args, Status}

trait GlutenTestsCommonTrait
extends SparkFunSuite
Expand All @@ -48,23 +46,4 @@ trait GlutenTestsCommonTrait
TestStats.endCase(status.succeeds());
status
}

protected def testGluten(testName: String, testTag: Tag*)(testFun: => Any)(implicit
pos: Position): Unit = {
test(GLUTEN_TEST + testName, testTag: _*)(testFun)
}

protected def ignoreGluten(testName: String, testTag: Tag*)(testFun: => Any)(implicit
pos: Position): Unit = {
super.ignore(GLUTEN_TEST + testName, testTag: _*)(testFun)
}

override protected def test(testName: String, testTags: Tag*)(testFun: => Any)(implicit
pos: Position): Unit = {
if (shouldRun(testName)) {
super.test(testName, testTags: _*)(testFun)
} else {
super.ignore(testName, testTags: _*)(testFun)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
*/
package org.apache.spark

class GlutenSortShuffleSuite extends SortShuffleSuite {
import org.apache.spark.sql.GlutenTestsBaseTrait

class GlutenSortShuffleSuite extends SortShuffleSuite with GlutenTestsBaseTrait {
override def beforeAll(): Unit = {
super.beforeAll()
conf.set("spark.shuffle.manager", "org.apache.spark.shuffle.sort.ColumnarShuffleManager")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
*/
package org.apache.spark

class GlutenSortShuffleSuite extends SortShuffleSuite {
import org.apache.spark.sql.GlutenTestsBaseTrait

class GlutenSortShuffleSuite extends SortShuffleSuite with GlutenTestsBaseTrait {
override def beforeAll(): Unit = {
super.beforeAll()
conf.set("spark.shuffle.manager", "org.apache.spark.shuffle.sort.ColumnarShuffleManager")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
*/
package org.apache.spark

class GlutenSortShuffleSuite extends SortShuffleSuite {
import org.apache.spark.sql.GlutenTestsBaseTrait

class GlutenSortShuffleSuite extends SortShuffleSuite with GlutenTestsBaseTrait {
override def beforeAll(): Unit = {
super.beforeAll()
conf.set("spark.shuffle.manager", "org.apache.spark.shuffle.sort.ColumnarShuffleManager")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
*/
package org.apache.spark

class GlutenSortShuffleSuite extends SortShuffleSuite {
import org.apache.spark.sql.GlutenTestsBaseTrait

class GlutenSortShuffleSuite extends SortShuffleSuite with GlutenTestsBaseTrait {
override def beforeAll(): Unit = {
super.beforeAll()
conf.set("spark.shuffle.manager", "org.apache.spark.shuffle.sort.ColumnarShuffleManager")
Expand Down
Loading