LakshSingla commented on code in PR #13374:
URL: https://github.com/apache/druid/pull/13374#discussion_r1026277283
##########
integration-tests-ex/cases/pom.xml:
##########
@@ -346,7 +351,7 @@
</goals>
<configuration>
<!-- our tests are very verbose, let's keep
the volume down -->
-
<redirectTestOutputToFile>true</redirectTestOutputToFile>
+
<redirectTestOutputToFile>False</redirectTestOutputToFile>
Review Comment:
Why is this change required? Also, if we go ahead with the change, then the
comment above this should be updated to explain why it is set to false
```suggestion
<redirectTestOutputToFile>false</redirectTestOutputToFile>
```
##########
integration-tests-ex/cases/src/test/java/org/apache/druid/testsEx/msq/AbstractITSQLBasedBatchIngestion.java:
##########
@@ -0,0 +1,125 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.testsEx.msq;
+
+import com.google.inject.Inject;
+import org.apache.commons.io.IOUtils;
+import org.apache.druid.java.util.common.ISE;
+import org.apache.druid.java.util.common.StringUtils;
+import org.apache.druid.java.util.common.logger.Logger;
+import org.apache.druid.testing.utils.DataLoaderHelper;
+import org.apache.druid.testing.utils.MsqTestQueryHelper;
+import org.apache.druid.testing.utils.TestQueryHelper;
+import org.apache.druid.testsEx.indexer.AbstractITBatchIndexTest;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URISyntaxException;
+import java.nio.charset.StandardCharsets;
+import java.util.Map;
+
+public class AbstractITSQLBasedBatchIngestion
+{
+ public static final Logger LOG = new Logger(TestQueryHelper.class);
+ @Inject
+ private MsqTestQueryHelper msqHelper;
+
+ @Inject
+ protected TestQueryHelper queryHelper;
+
+ @Inject
+ private DataLoaderHelper dataLoaderHelper;
+
+ protected String getFileWithFormatFromDir(String dir, String format) throws
URISyntaxException
Review Comment:
What's the advantage of the method if it is returning just the first file
ending with `format`. Should the user pass the filename himself?
##########
distribution/pom.xml:
##########
@@ -225,6 +225,8 @@
<argument>-c</argument>
<argument>org.apache.druid.extensions:druid-multi-stage-query</argument>
<argument>-c</argument>
+
<argument>org.apache.druid.extensions:druid-catalog</argument>
Review Comment:
Is this change related to this PR? If not, then should this be raised as a
separate PR?
##########
integration-tests-ex/cases/src/test/java/org/apache/druid/testsEx/msq/ITSQLBasedBatchIngestion.java:
##########
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.testsEx.msq;
+
+import org.apache.curator.shaded.com.google.common.collect.ImmutableMap;
+import org.apache.druid.testsEx.categories.MultiStageQuery;
+import org.apache.druid.testsEx.config.DruidTestRunner;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
+
+import java.io.File;
+import java.util.Arrays;
+
+@RunWith(DruidTestRunner.class)
+@Category(MultiStageQuery.class)
+public class ITSQLBasedBatchIngestion extends AbstractITSQLBasedBatchIngestion
+{
+ private static final String BATCH_INDEX_TASKS_DIR =
"/multi-stage-query/batch-index/";
+
+ @Test
+ public void testSQLBasedBatchIngestion() throws Exception
+ {
+ // Get list of all directories in batch-index folder. Each folder is
considered a test case.
+ File[] directories = (new
File(getClass().getResource(BATCH_INDEX_TASKS_DIR).toURI())).listFiles(File::isDirectory);
+ int fail_count = 0;
+ LOG.info("Test will be run for sql in the following directories - \n %s",
Arrays.toString(directories));
+ for (File dir : directories) {
+ try {
+ runMSQTaskandTestQueries(BATCH_INDEX_TASKS_DIR + dir.getName(),
"msqBatchIndex_" + dir.getName(),
Review Comment:
I agree with @cryptoe. Either we should pass the filename individually in
each test to a standard helper method or create parameterized tests. Extracting
filenames from the dir in a test makes it harder to debug failing tests, and
also are difficult to pinpoint why the tests are failing clearly.
--
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]