walterddr commented on code in PR #9806:
URL: https://github.com/apache/pinot/pull/9806#discussion_r1024312968
##########
pinot-query-runtime/src/test/java/org/apache/pinot/query/runtime/queries/ResourceBasedQueriesTest.java:
##########
@@ -153,20 +158,56 @@ public void tearDown() {
// TODO: name the test using testCaseName for testng reports
@Test(dataProvider = "testResourceQueryTestCaseProviderInputOnly")
- public void testQueryTestCasesWithH2(String testCaseName, String sql)
+ public void testQueryTestCasesWithH2(String testCaseName, String sql, String
expect)
throws Exception {
// query pinot
- List<Object[]> resultRows = queryRunner(sql);
+ Optional<List<Object[]>> resultRows = runQuery(sql, expect);
+ if (!resultRows.isPresent()) {
+ // successfully caught error
+ return;
+ }
+
// query H2 for data
List<Object[]> expectedRows = queryH2(sql);
- compareRowEquals(resultRows, expectedRows);
+ compareRowEquals(resultRows.get(), expectedRows);
}
@Test(dataProvider = "testResourceQueryTestCaseProviderBoth")
- public void testQueryTestCasesWithOutput(String testCaseName, String sql,
List<Object[]> expectedRows)
+ public void testQueryTestCasesWithOutput(String testCaseName, String sql,
List<Object[]> expectedRows, String expect)
throws Exception {
- List<Object[]> resultRows = queryRunner(sql);
- compareRowEquals(resultRows, expectedRows);
+ Optional<List<Object[]>> resultRows = runQuery(sql, expect);
Review Comment:
why would you need to do this for H2? if you are asserting failure. you
don't need H2 right?
(IIUC this is probably b/c the output can't be some of the queries list).
for now we can do both but we will refactor that out later if needed.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]