You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2021/07/22 04:53:22 UTC

[GitHub] [druid] maytasm commented on a change in pull request #11472: Add integration tests for S3 Assume Role ingestion feature

maytasm commented on a change in pull request #11472:
URL: https://github.com/apache/druid/pull/11472#discussion_r674499444



##########
File path: integration-tests/src/test/java/org/apache/druid/tests/indexer/AbstractS3AssumeRoleIndexTest.java
##########
@@ -0,0 +1,273 @@
+/*
+ * 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.tests.indexer;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import org.apache.druid.indexer.TaskState;
+import org.apache.druid.indexer.TaskStatusPlus;
+import org.apache.druid.java.util.common.Pair;
+import org.apache.druid.java.util.common.StringUtils;
+import org.testng.Assert;
+
+import java.io.Closeable;
+import java.util.UUID;
+import java.util.function.Function;
+
+public abstract class AbstractS3AssumeRoleIndexTest extends AbstractITBatchIndexTest
+{
+  private static final String INDEX_TASK_WITH_OVERRIDE = "/indexer/wikipedia_override_credentials_index_task.json";
+  private static final String INDEX_QUERIES_RESOURCE = "/indexer/wikipedia_index_queries.json";
+  private static final String INPUT_SOURCE_OBJECTS_KEY = "objects";
+  private static final String WIKIPEDIA_DATA_1 = "wikipedia_index_data1.json";
+  private static final String WIKIPEDIA_DATA_2 = "wikipedia_index_data2.json";
+  private static final String WIKIPEDIA_DATA_3 = "wikipedia_index_data3.json";
+  private static final ImmutableList INPUT_SOURCE_OBJECTS_VALUE = ImmutableList.of
+      (
+          ImmutableMap.of("bucket", "%%BUCKET%%", "path", "%%PATH%%" + WIKIPEDIA_DATA_1),
+          ImmutableMap.of("bucket", "%%BUCKET%%", "path", "%%PATH%%" + WIKIPEDIA_DATA_2),
+          ImmutableMap.of("bucket", "%%BUCKET%%", "path", "%%PATH%%" + WIKIPEDIA_DATA_3)
+      );
+
+  abstract boolean isSetS3OverrideCredentials();
+
+  void doTestS3WithValidAssumeRoleAndExternalIdShouldSucceed() throws Exception
+  {
+    if (config.getS3AssumeRoleExternalId() == null || config.getS3AssumeRoleWithExternalId() == null) {
+      return;
+    }

Review comment:
       I have spent a few hours but was not able to achieve this. I have tried using Assume.assumeTrue which should throw an AssumptionViolatedException which the test runner should then handle gracefully and mark the test as skipped. However, the test runner doesn't and the AssumptionViolatedException caused the test to failed. I have tried looking at the version of junit, surefire, etc and was not able to figure out what's wrong. I also could not find any other way of programmatically skipping the test within the test code. Let me know if you have any idea of achieving this. (things like @Ignore does not work in this case as the skip have to be done programmatically within the test method).




-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org