DomGarguilo commented on code in PR #3228:
URL: https://github.com/apache/accumulo/pull/3228#discussion_r1276654413


##########
test/src/main/java/org/apache/accumulo/test/ExportTableCommandWithMultipleVolumesIT.java:
##########
@@ -0,0 +1,156 @@
+/*
+ * 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
+ *
+ *   https://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.accumulo.test;
+
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import java.io.File;
+import java.time.Duration;
+import java.util.Map;
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+import org.apache.accumulo.core.client.Accumulo;
+import org.apache.accumulo.core.client.AccumuloClient;
+import org.apache.accumulo.core.client.BatchWriter;
+import org.apache.accumulo.core.client.Scanner;
+import org.apache.accumulo.core.conf.Property;
+import org.apache.accumulo.core.data.Key;
+import org.apache.accumulo.core.data.Mutation;
+import org.apache.accumulo.core.data.Range;
+import org.apache.accumulo.core.data.Value;
+import org.apache.accumulo.core.metadata.MetadataTable;
+import org.apache.accumulo.core.metadata.schema.MetadataSchema;
+import org.apache.accumulo.core.security.Authorizations;
+import org.apache.accumulo.harness.AccumuloClusterHarness;
+import org.apache.accumulo.miniclusterImpl.MiniAccumuloConfigImpl;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.fs.RawLocalFileSystem;
+import org.apache.hadoop.io.Text;
+import org.junit.jupiter.api.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ExportTableCommandWithMultipleVolumesIT extends 
AccumuloClusterHarness {
+  private static final Logger log =
+      LoggerFactory.getLogger(ExportTableCommandWithMultipleVolumesIT.class);
+
+  Path v1, v2;
+
+  public static String[] row_numbers = "1,2,3,4,5,6,7,8,9,10".split(",");
+
+  String baseDirStr = "";
+  String baseDir2Str = "";
+  String originalVolume = "";
+  String secondVolume = "";
+
+  @Override
+  protected Duration defaultTimeout() {
+    return Duration.ofMinutes(1);
+  }
+
+  @Override
+  public void configureMiniCluster(MiniAccumuloConfigImpl cfg, Configuration 
hadoopCoreSite) {
+    File baseDir = cfg.getDir();
+
+    // get first volume name
+    baseDirStr = baseDir.toString();
+    String[] baseDirArray = baseDirStr.split("/");
+    originalVolume = baseDirArray[2];
+
+    // get second volume name
+    String[] baseDir2Array = baseDirArray;
+    baseDir2Array[2] = baseDir2Array[2] + "2";

Review Comment:
   After thinking about this a bit more and looking at the code, I don't think 
what I suggested will work. In fact I am not sure of a way to write a test for 
this code. It seems that, to properly test this code, two volumes need to be 
present. However, an additional volume can not be created or expected to 
already exist on the machine for a test.
   
   I am able to get the new test to pass only after manually creating a new 
directory for the test to create resources inside of. For example, with my 
username `dgarguilo`, the test expects to be able to create the following 
directories:
   * 
/home/**dgarguilo**/github/accumulo/test/target/mini-tests/org.apache.accumulo.test.ExportTableCommandWithMultipleVolumesIT_testExportCommand/volumes/**v1**
   * 
/home/**dgarguilo2**/github/accumulo/test/target/mini-tests/org.apache.accumulo.test.ExportTableCommandWithMultipleVolumesIT_testExportCommand/volumes/**v2**
   
   The second of which I had to create manually. Obviously this can't be 
expected to happen for a test to pass.
   
   In conclusion, after manually creating the needed directory and having the 
test pass, it seems like these changes are working but I don't think we can 
keep the test as is. I am not sure how to move forward with these changes. 
Should the new IT be removed and just rely on manual verification of these 
changes or should something else happen?



-- 
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]

Reply via email to