Skip to content
Closed
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 @@ -98,7 +98,9 @@ class SQLQueryTestSuite extends QueryTest with SharedSQLContext {

/** List of test cases to ignore, in lower cases. */
private val blackList = Set(
"blacklist.sql" // Do NOT remove this one. It is here to test the blacklist functionality.
"blacklist.sql", // Do NOT remove this one. It is here to test the blacklist functionality.
".DS_Store" // A meta-file that may be created on Mac by Finder App.
// We should ignore this file from processing.
)

// Create all the test cases.
Expand All @@ -121,7 +123,7 @@ class SQLQueryTestSuite extends QueryTest with SharedSQLContext {
}

private def createScalaTestCase(testCase: TestCase): Unit = {
if (blackList.contains(testCase.name.toLowerCase)) {
if (blackList.exists(t => testCase.name.toLowerCase.contains(t.toLowerCase))) {
// Create a test case to ignore this case.
ignore(testCase.name) { /* Do nothing */ }
} else {
Expand Down Expand Up @@ -241,7 +243,9 @@ class SQLQueryTestSuite extends QueryTest with SharedSQLContext {
private def listTestCases(): Seq[TestCase] = {
listFilesRecursively(new File(inputFilePath)).map { file =>
val resultFile = file.getAbsolutePath.replace(inputFilePath, goldenFilePath) + ".out"
TestCase(file.getName, file.getAbsolutePath, resultFile)
val absPath = file.getAbsolutePath
val testCaseName = absPath.stripPrefix(inputFilePath).stripPrefix(File.separator)
TestCase(testCaseName, absPath, resultFile)
}
}

Expand Down