[ 
https://issues.apache.org/jira/browse/HDFS-16260?focusedWorklogId=662802&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-662802
 ]

ASF GitHub Bot logged work on HDFS-16260:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 08/Oct/21 15:53
            Start Date: 08/Oct/21 15:53
    Worklog Time Spent: 10m 
      Work Description: goiri commented on a change in pull request #3532:
URL: https://github.com/apache/hadoop/pull/3532#discussion_r725127055



##########
File path: 
hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/tests/tools/hdfs-tool-test-fixtures.h
##########
@@ -0,0 +1,100 @@
+/*
+  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.
+*/
+
+#ifndef LIBHDFSPP_TOOLS_HDFS_TOOL_TEST_FIXTURES
+#define LIBHDFSPP_TOOLS_HDFS_TOOL_TEST_FIXTURES
+
+#include <functional>
+#include <memory>
+
+#include <gtest/gtest.h>
+
+#include "hdfs-tool.h"
+
+/**
+ * {@class HdfsToolBasicTest} is a fixture that houses basic tests on {@link
+ * hdfs::tools::HdfsTool} interface. It contains the "Happy path" tests which
+ * covers the scenarios where {@link hdfs::tools::HdfsTool} is expected to
+ * work just fine.
+ *
+ * {@class HdfsToolBasicTest} is parameterized on a lambda returning an 
instance
+ * of {@link hdfs::tools::HdfsTool} wrapped in a std::unique_ptr. We then run
+ * the tests on this instance. Each test runs in isolation. So, a new instance
+ * is created for each test.
+ */
+class HdfsToolBasicTest

Review comment:
       We are doing a lot of refactoring here that is not directly delete 
snapshot.
   Let's do a separate JIRA for this refactor.

##########
File path: 
hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/tests/tools/CMakeLists.txt
##########
@@ -16,7 +16,21 @@
 # limitations under the License.
 #
 
-add_executable(hdfs_tool_test hdfs-allow-snapshot-mock.cc hdfs-cat-mock.cc 
hdfs-tool-test.cc main.cc)
-target_include_directories(hdfs_tool_test PRIVATE ../tools ../../tools 
../../tools/hdfs-allow-snapshot ../../tools/hdfs-cat)
-target_link_libraries(hdfs_tool_test PRIVATE gmock_main hdfs_allowSnapshot_lib 
hdfs_cat_lib)
+add_executable(hdfs_tool_test
+                hdfs-allow-snapshot-mock.cc
+                hdfs-delete-snapshot-mock.cc
+                hdfs-cat-mock.cc
+                hdfs-tool-test-fixtures.cc
+                hdfs-tool-test.cc main.cc)

Review comment:
       If we are splitting per line, let's split main.cc too




-- 
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: common-issues-unsubscr...@hadoop.apache.org

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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 662802)
    Time Spent: 50m  (was: 40m)

> Make hdfs_deleteSnapshot tool cross platform
> --------------------------------------------
>
>                 Key: HDFS-16260
>                 URL: https://issues.apache.org/jira/browse/HDFS-16260
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: hdfs-client, libhdfs++, tools
>    Affects Versions: 3.4.0
>         Environment: Centos 7, Centos 8, Debian 10, Ubuntu Focal
>            Reporter: Gautham Banasandra
>            Assignee: Gautham Banasandra
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> The source files for hdfs_deleteSnapshot uses *getopt* for parsing the 
> command line arguments. getopt is available only on Linux and thus, isn't 
> cross platform. We need to replace getopt with *boost::program_options* to 
> make this cross platform.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to