Skip to content

Commit

Permalink
fix up
Browse files Browse the repository at this point in the history
  • Loading branch information
marin-ma committed Nov 20, 2023
1 parent fc33106 commit e453be9
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,4 @@ class CHTestApi extends TestApi {
override def getSupportedSQLQueryTests: Set[String] = Set[String]()

override def getOverwriteSQLQueryTests: Set[String] = Set[String]()

override def getOverwriteSQLQueryResourcePath: String =
getClass.getResource("/") + "../../test/resources/resources/sql-tests"
}
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,4 @@ class TestApiImpl extends TestApi {
// Remove corr in udf/udf-group-by.sql
"udf/udf-group-by.sql"
)

override def getOverwriteSQLQueryResourcePath: String =
getClass.getResource("/") + "../../test/resources/resources/sql-tests"
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,4 @@ trait TestApi {
def getSupportedSQLQueryTests: Set[String]

def getOverwriteSQLQueryTests: Set[String]

def getOverwriteSQLQueryResourcePath: String
}
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class GlutenSQLQueryTestSuite
protected val testDataPath = new File(resourcesPath, "test-data").getAbsolutePath

protected val overwriteResourcePath =
BackendsApiManager.getTestApiInstance.getOverwriteSQLQueryResourcePath
getClass.getResource("/").getPath + "../../../src/test/resources/sql-tests"

protected val overwriteInputFilePath = new File(overwriteResourcePath, "inputs").getAbsolutePath
protected val overwriteGoldenFilePath = new File(overwriteResourcePath, "results").getAbsolutePath
Expand Down Expand Up @@ -611,10 +611,12 @@ class GlutenSQLQueryTestSuite
}
}

listFilesRecursively(new File(inputFilePath))
.flatMap(createTestCase(_, inputFilePath, goldenFilePath)) ++ listFilesRecursively(
new File(overwriteInputFilePath))
val overwriteTestCases = listFilesRecursively(new File(overwriteInputFilePath))
.flatMap(createTestCase(_, overwriteInputFilePath, overwriteGoldenFilePath))
val overwriteTestCaseNames = overwriteTestCases.map(_.name)
listFilesRecursively(new File(inputFilePath))
.flatMap(createTestCase(_, inputFilePath, goldenFilePath))
.filterNot(testCase => overwriteTestCaseNames.contains(testCase.name)) ++ overwriteTestCases
}

/** Returns all the files (not directories) in a directory, recursively. */
Expand Down

0 comments on commit e453be9

Please sign in to comment.