This is an automated email from the ASF dual-hosted git repository.

rongr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new 15988f6016 add ignored test capability (#11703)
15988f6016 is described below

commit 15988f6016d36df5ab5f9eebd0bb05bb91a4e7a3
Author: Rong Rong <[email protected]>
AuthorDate: Thu Sep 28 16:07:30 2023 -0700

    add ignored test capability (#11703)
    
    Co-authored-by: Rong Rong <[email protected]>
---
 .../runtime/queries/ResourceBasedQueriesTest.java  | 37 ++++++++++++++--------
 .../src/test/resources/queries/Aggregates.json     |  8 -----
 .../src/test/resources/queries/Comparisons.json    | 14 ++------
 .../src/test/resources/queries/MathFuncs.json      |  8 -----
 4 files changed, 26 insertions(+), 41 deletions(-)

diff --git 
a/pinot-query-runtime/src/test/java/org/apache/pinot/query/runtime/queries/ResourceBasedQueriesTest.java
 
b/pinot-query-runtime/src/test/java/org/apache/pinot/query/runtime/queries/ResourceBasedQueriesTest.java
index 8c5a41a96c..16599c2bd4 100644
--- 
a/pinot-query-runtime/src/test/java/org/apache/pinot/query/runtime/queries/ResourceBasedQueriesTest.java
+++ 
b/pinot-query-runtime/src/test/java/org/apache/pinot/query/runtime/queries/ResourceBasedQueriesTest.java
@@ -71,9 +71,11 @@ public class ResourceBasedQueriesTest extends 
QueryRunnerTestBase {
   private static final String QUERY_TEST_RESOURCE_FOLDER = "queries";
   private static final Random RANDOM = new Random(42);
   private static final String FILE_FILTER_PROPERTY = "pinot.fileFilter";
+  private static final String IGNORE_FILTER_PROPERTY = "pinot.runIgnored";
   private static final int NUM_PARTITIONS = 4;
 
   private final Map<String, Set<String>> _tableToSegmentMap = new HashMap<>();
+  private boolean _isRunIgnored;
   private TimeZone _currentSystemTimeZone;
 
   @BeforeClass
@@ -82,6 +84,9 @@ public class ResourceBasedQueriesTest extends 
QueryRunnerTestBase {
     // Save the original default timezone
     _currentSystemTimeZone = TimeZone.getDefault();
 
+    String runIgnoredProp = System.getProperty(IGNORE_FILTER_PROPERTY);
+    _isRunIgnored = runIgnoredProp != null;
+
     // Change the default timezone
     TimeZone.setDefault(TimeZone.getTimeZone("America/Los_Angeles"));
 
@@ -245,7 +250,7 @@ public class ResourceBasedQueriesTest extends 
QueryRunnerTestBase {
 
   // TODO: name the test using testCaseName for testng reports
   @Test(dataProvider = "testResourceQueryTestCaseProviderInputOnly")
-  public void testQueryTestCasesWithH2(String testCaseName, String sql, String 
h2Sql, String expect,
+  public void testQueryTestCasesWithH2(String testCaseName, boolean isIgnored, 
String sql, String h2Sql, String expect,
       boolean keepOutputRowOrder)
       throws Exception {
     // query pinot
@@ -259,15 +264,15 @@ public class ResourceBasedQueriesTest extends 
QueryRunnerTestBase {
   }
 
   @Test(dataProvider = "testResourceQueryTestCaseProviderBoth")
-  public void testQueryTestCasesWithOutput(String testCaseName, String sql, 
String h2Sql, List<Object[]> expectedRows,
-      String expect, boolean keepOutputRowOrder)
+  public void testQueryTestCasesWithOutput(String testCaseName, boolean 
isIgnored, String sql, String h2Sql,
+      List<Object[]> expectedRows, String expect, boolean keepOutputRowOrder)
       throws Exception {
     runQuery(sql, expect, null).ifPresent(rows -> compareRowEquals(rows, 
expectedRows, keepOutputRowOrder));
   }
 
   @Test(dataProvider = "testResourceQueryTestCaseProviderWithMetadata")
-  public void testQueryTestCasesWithMetadata(String testCaseName, String sql, 
String h2Sql, String expect,
-      int numSegments)
+  public void testQueryTestCasesWithMetadata(String testCaseName, boolean 
isIgnored, String sql, String h2Sql,
+      String expect, int numSegments)
       throws Exception {
     Map<Integer, ExecutionStatsAggregator> executionStatsAggregatorMap = new 
HashMap<>();
     runQuery(sql, expect, executionStatsAggregatorMap).ifPresent(rows -> {
@@ -358,7 +363,7 @@ public class ResourceBasedQueriesTest extends 
QueryRunnerTestBase {
 
       List<QueryTestCase.Query> queryCases = testCaseEntry.getValue()._queries;
       for (QueryTestCase.Query queryCase : queryCases) {
-        if (queryCase._ignored) {
+        if (queryCase._ignored && !_isRunIgnored) {
           continue;
         }
 
@@ -372,7 +377,8 @@ public class ResourceBasedQueriesTest extends 
QueryRunnerTestBase {
             expectedRows.add(objs.toArray());
           }
           Object[] testEntry = new Object[]{
-              testCaseName, sql, h2Sql, expectedRows, 
queryCase._expectedException, queryCase._keepOutputRowOrder
+              testCaseName, queryCase._ignored, sql, h2Sql, expectedRows, 
queryCase._expectedException,
+              queryCase._keepOutputRowOrder
           };
           providerContent.add(testEntry);
         }
@@ -402,7 +408,7 @@ public class ResourceBasedQueriesTest extends 
QueryRunnerTestBase {
       List<QueryTestCase.Query> queryCases = testCaseEntry.getValue()._queries;
       for (QueryTestCase.Query queryCase : queryCases) {
 
-        if (queryCase._ignored) {
+        if (queryCase._ignored && !_isRunIgnored) {
           continue;
         }
 
@@ -418,7 +424,9 @@ public class ResourceBasedQueriesTest extends 
QueryRunnerTestBase {
             throw new RuntimeException("Unable to test metadata without 
expected num segments configuration!");
           }
 
-          Object[] testEntry = new Object[]{testCaseName, sql, h2Sql, 
queryCase._expectedException, segmentCount};
+          Object[] testEntry = new Object[]{
+              testCaseName, queryCase._ignored, sql, h2Sql, 
queryCase._expectedException, segmentCount
+          };
           providerContent.add(testEntry);
         }
       }
@@ -439,15 +447,16 @@ public class ResourceBasedQueriesTest extends 
QueryRunnerTestBase {
       String testCaseName = testCaseEntry.getKey();
       List<QueryTestCase.Query> queryCases = testCaseEntry.getValue()._queries;
       for (QueryTestCase.Query queryCase : queryCases) {
-        if (queryCase._ignored) {
+        if (queryCase._ignored && !_isRunIgnored) {
           continue;
         }
         if (queryCase._outputs == null) {
           String sql = replaceTableName(testCaseName, queryCase._sql);
           String h2Sql = queryCase._h2Sql != null ? 
replaceTableName(testCaseName, queryCase._h2Sql)
               : replaceTableName(testCaseName, queryCase._sql);
-          Object[] testEntry =
-              new Object[]{testCaseName, sql, h2Sql, 
queryCase._expectedException, queryCase._keepOutputRowOrder};
+          Object[] testEntry = new Object[]{
+              testCaseName, queryCase._ignored, sql, h2Sql, 
queryCase._expectedException, queryCase._keepOutputRowOrder
+          };
           providerContent.add(testEntry);
         }
       }
@@ -476,11 +485,11 @@ public class ResourceBasedQueriesTest extends 
QueryRunnerTestBase {
     }
 
     // get filter if set
-    String property = System.getProperty(FILE_FILTER_PROPERTY);
+    String fileFilterProp = System.getProperty(FILE_FILTER_PROPERTY);
 
     // Load each test file.
     for (String testCaseName : testFilenames) {
-      if (property != null && 
!testCaseName.toLowerCase().contains(property.toLowerCase())) {
+      if (fileFilterProp != null && 
!testCaseName.toLowerCase().contains(fileFilterProp.toLowerCase())) {
         continue;
       }
 
diff --git a/pinot-query-runtime/src/test/resources/queries/Aggregates.json 
b/pinot-query-runtime/src/test/resources/queries/Aggregates.json
index a6111fbe0e..1e4d6166b0 100644
--- a/pinot-query-runtime/src/test/resources/queries/Aggregates.json
+++ b/pinot-query-runtime/src/test/resources/queries/Aggregates.json
@@ -729,8 +729,6 @@
         "sql": "SELECT sum(int_col) FROM {tbl} WHERE string_col IN ( SELECT 
string_col FROM {tbl} WHERE int_col BETWEEN 1 AND 0 GROUP BY string_col )"
       },
       {
-        "ignored": true,
-        "comment": "min empty returns [infinity] instead of [null] at the 
moment when leaf aggregation is performed by v1 engine.",
         "description": "Return empty for min",
         "sql": "SELECT min(int_col) FROM {tbl} WHERE string_col IN ('foo', 
'bar')"
       },
@@ -739,8 +737,6 @@
         "sql": "SELECT min(int_col) FROM {tbl} WHERE string_col IN ( SELECT 
string_col FROM {tbl} WHERE int_col BETWEEN 1 AND 0 GROUP BY string_col )"
       },
       {
-        "ignored": true,
-        "comment": "max empty returns [-infinity] instead of [null] at the 
moment when leaf aggregation is performed by v1 engine.",
         "description": "Return empty for max",
         "sql": "SELECT max(int_col) FROM {tbl} WHERE string_col IN ('foo', 
'bar')"
       },
@@ -774,8 +770,6 @@
         "sql": "SELECT count(*) FROM {tbl} WHERE string_col IN ( SELECT 
string_col FROM {tbl} WHERE int_col BETWEEN 1 AND 0 GROUP BY string_col )"
       },
       {
-        "ignored": true,
-        "comment": "bool_and empty returns [true] instead of [null] at the 
moment when leaf aggregation is performed by v1 engine.",
         "description": "Return empty for bool_and",
         "sql": "SELECT bool_and(bool_col) FROM {tbl} WHERE string_col IN 
('foo', 'bar')"
       },
@@ -784,8 +778,6 @@
         "sql": "SELECT bool_and(bool_col) FROM {tbl} WHERE string_col IN ( 
SELECT string_col FROM {tbl} WHERE int_col BETWEEN 1 AND 0 GROUP BY string_col 
)"
       },
       {
-        "ignored": true,
-        "comment": "bool_or empty returns [false] instead of [null] at the 
moment when leaf aggregation is performed by v1 engine.",
         "description": "Return empty for bool_or",
         "sql": "SELECT bool_or(bool_col) FROM {tbl} WHERE string_col IN 
('foo', 'bar')"
       },
diff --git a/pinot-query-runtime/src/test/resources/queries/Comparisons.json 
b/pinot-query-runtime/src/test/resources/queries/Comparisons.json
index b15397f17f..38cbe0a435 100644
--- a/pinot-query-runtime/src/test/resources/queries/Comparisons.json
+++ b/pinot-query-runtime/src/test/resources/queries/Comparisons.json
@@ -400,19 +400,11 @@
       { "sql": "SELECT 3 BETWEEN small AND big FROM {tbl}" },
       { "sql": "SELECT val NOT BETWEEN small AND big FROM {tbl}" },
       { "sql": "SELECT val NOT BETWEEN big AND small FROM {tbl}" },
-      {
-        "ignored": true,
-        "sql": "SELECT val NOT BETWEEN 2 AND 3 FROM {tbl}",
-        "comment": "Somehow it failed with Range is not implemented yet"
-      },
+      { "sql": "SELECT val NOT BETWEEN 2 AND 3 FROM {tbl}" },
       { "sql": "SELECT val NOT BETWEEN 3 AND 2 FROM {tbl}" },
       { "sql": "SELECT 3 NOT BETWEEN small AND big FROM {tbl}" },
-      {
-        "sql": "SELECT val BETWEEN SYMMETRIC small AND big FROM {tbl}"
-      },
-      {
-        "sql": "SELECT val BETWEEN SYMMETRIC big AND small FROM {tbl}"
-      }
+      { "sql": "SELECT val BETWEEN SYMMETRIC small AND big FROM {tbl}" },
+      { "sql": "SELECT val BETWEEN SYMMETRIC big AND small FROM {tbl}" }
     ]
   },
   "between_bigints": {
diff --git a/pinot-query-runtime/src/test/resources/queries/MathFuncs.json 
b/pinot-query-runtime/src/test/resources/queries/MathFuncs.json
index 6e586f2dc2..76dcc727ec 100644
--- a/pinot-query-runtime/src/test/resources/queries/MathFuncs.json
+++ b/pinot-query-runtime/src/test/resources/queries/MathFuncs.json
@@ -270,8 +270,6 @@
         "sql": "SELECT intCol %  10 FROM {numTbl}"
       },
       {
-        "ignored": true,
-        "comment": "should return 0 for 0 value but we are not",
         "description": "test mod on floating point literal with columns",
         "sql": "SELECT intCol %  1.2 FROM {numTbl}"
       },
@@ -345,8 +343,6 @@
         "sql": "SELECT exp(floatCol) FROM {numTbl}"
       },
       {
-        "ignored": true,
-        "comment": "Argument cannot be literal for transform function: exp:",
         "description": "test exp on literal",
         "sql": "SELECT exp(2.0) FROM {numTbl}"
       }
@@ -387,8 +383,6 @@
         "sql": "SELECT floor(floatCol) FROM {numTbl}"
       },
       {
-        "ignored": true,
-        "comment": "Caught exception while initializing transform function: 
floor",
         "description": "test exp on literal",
         "sql": "SELECT floor(2.0) FROM {numTbl}"
       }
@@ -429,8 +423,6 @@
         "sql": "SELECT ceil(floatCol) FROM {numTbl}"
       },
       {
-        "ignored": true,
-        "comment": "Caught exception while initializing transform function: 
ceil",
         "description": "test exp on literal",
         "sql": "SELECT ceil(2.0) FROM {numTbl}"
       }


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

Reply via email to