gatorsmile commented on a change in pull request #24752: 
[SPARK-27893][SQL][PYTHON] Create an integrated test base for Python, Scalar 
Pandas, Scala UDF by sql files
URL: https://github.com/apache/spark/pull/24752#discussion_r289269605
 
 

 ##########
 File path: sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestSuite.scala
 ##########
 @@ -126,19 +149,47 @@ class SQLQueryTestSuite extends QueryTest with 
SharedSQLContext {
         sql + "\n" +
         s"-- !query $queryIndex schema\n" +
         schema + "\n" +
-         s"-- !query $queryIndex output\n" +
+        s"-- !query $queryIndex output\n" +
         output
     }
   }
 
+  /** A test case. */
+  sealed trait TestCase {
+    val name: String
+    val inputFile: String
+    val resultFile: String
+  }
+
+  /** A regular test case. */
+  private case class RegularTestCase(
+      name: String, inputFile: String, resultFile: String) extends TestCase
+
+  /** A UDF test case. */
+  private case class UDFTestCase(
+      name: String, inputFile: String, resultFile: String, udf: TestUDF) 
extends TestCase
+
   private def createScalaTestCase(testCase: TestCase): Unit = {
     if (blackList.exists(t =>
         
testCase.name.toLowerCase(Locale.ROOT).contains(t.toLowerCase(Locale.ROOT)))) {
       // Create a test case to ignore this case.
       ignore(testCase.name) { /* Do nothing */ }
-    } else {
-      // Create a test case to run this case.
-      test(testCase.name) { runTest(testCase) }
+    } else testCase match {
+      case UDFTestCase(_, _, _, udf: TestPythonUDF) if !shouldTestPythonUDFs =>
+        ignore(s"${testCase.name} is skipped because " +
 
 Review comment:
   I am afraid these tests might not be triggered in our test environments. To 
ensure it works as expected, we should throw an error instead of logging a 
message.
   
   I think we can provide a new environment variable, IGNORE_SKIPPED_TESTS. If 
the env is not set, we should throw an exception. In the exception message, we 
can clearly explain the workaround `setting an environment variable 
IGNORE_SKIPPED_TESTS`. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to