kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [2/3] kudu git commit: mini-cluster: make available when building with NO_TESTS
Date Thu, 05 Oct 2017 04:16:14 GMT
mini-cluster: make available when building with NO_TESTS

There's an upcoming patch to the Kudu CLI to add a "control shell" which can
create miniclusters. To that end, the mini-cluster cmake module has to be
available even when building with NO_TESTS=1. Here's what I had to change:
- We need the MiniKdc, so I pulled it out of security-test and into a new
  mini_kdc cmake module. While I was there I also renamed security-test to
  security_test_util.
- We need kudu_curl_util for ExternalMiniCluster::GetInt64Metric, so I
  pulled it out of its NO_TESTS=1 guard.
- We need some kudu_test_util functions for MiniKdc and MiniCluster binary
  paths and data roots, so I also pulled it out of its NO_TESTS=1 guard.

Change-Id: I7b2fae0144b602bdfefbc44a7f98205f0d8a4a30
Reviewed-on: http://gerrit.cloudera.org:8080/8209
Tested-by: Adar Dembo <adar@cloudera.com>
Reviewed-by: Todd Lipcon <todd@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/3f2bf6df
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/3f2bf6df
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/3f2bf6df

Branch: refs/heads/master
Commit: 3f2bf6df5ddd2221d40913619707033cc6627625
Parents: dca65a0
Author: Adar Dembo <adar@cloudera.com>
Authored: Tue Oct 3 12:38:37 2017 -0700
Committer: Adar Dembo <adar@cloudera.com>
Committed: Thu Oct 5 04:15:00 2017 +0000

----------------------------------------------------------------------
 src/kudu/integration-tests/CMakeLists.txt |  2 +-
 src/kudu/mini-cluster/CMakeLists.txt      |  8 ++---
 src/kudu/rpc/CMakeLists.txt               |  8 ++++-
 src/kudu/security/CMakeLists.txt          | 25 +++++++++++----
 src/kudu/server/CMakeLists.txt            |  4 +--
 src/kudu/util/CMakeLists.txt              | 42 ++++++++++++++------------
 6 files changed, 53 insertions(+), 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/3f2bf6df/src/kudu/integration-tests/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/CMakeLists.txt b/src/kudu/integration-tests/CMakeLists.txt
index 8184bad..82c144d 100644
--- a/src/kudu/integration-tests/CMakeLists.txt
+++ b/src/kudu/integration-tests/CMakeLists.txt
@@ -43,7 +43,7 @@ target_link_libraries(integration-tests
   kudu_fs
   kudu_test_util
   kudu_tools_util
-  security-test)
+  security_test_util)
 add_dependencies(integration-tests
   kudu-tserver
   kudu-master)

http://git-wip-us.apache.org/repos/asf/kudu/blob/3f2bf6df/src/kudu/mini-cluster/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/kudu/mini-cluster/CMakeLists.txt b/src/kudu/mini-cluster/CMakeLists.txt
index 6b074ed..1c51273 100644
--- a/src/kudu/mini-cluster/CMakeLists.txt
+++ b/src/kudu/mini-cluster/CMakeLists.txt
@@ -15,11 +15,6 @@
 # specific language governing permissions and limitations
 # under the License.
 
-# Everything in this module is test-related.
-if (NO_TESTS)
-  return()
-endif()
-
 set(MINI_CLUSTER_SRCS
   external_mini_cluster.cc
   internal_mini_cluster.cc
@@ -35,11 +30,12 @@ target_link_libraries(mini-cluster
   kudu_client
   kudu_common
   kudu_curl_util
+  kudu_test_util
   kudu_util
   krpc
   master
   master_proto
-  security-test
+  mini_kdc
   server_base_proto
   tablet_proto
   tserver

http://git-wip-us.apache.org/repos/asf/kudu/blob/3f2bf6df/src/kudu/rpc/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/CMakeLists.txt b/src/kudu/rpc/CMakeLists.txt
index 71a7adc..4555702 100644
--- a/src/kudu/rpc/CMakeLists.txt
+++ b/src/kudu/rpc/CMakeLists.txt
@@ -118,7 +118,13 @@ target_link_libraries(rtest_krpc
   rtest_diff_package_proto)
 
 # Tests
-set(KUDU_TEST_LINK_LIBS rtest_krpc krpc rpc_header_proto security-test ${KUDU_MIN_TEST_LIBS})
+set(KUDU_TEST_LINK_LIBS
+  krpc
+  mini_kdc
+  rpc_header_proto
+  rtest_krpc
+  security_test_util
+  ${KUDU_MIN_TEST_LIBS})
 ADD_KUDU_TEST(exactly_once_rpc-test)
 ADD_KUDU_TEST(mt-rpc-test RUN_SERIAL true)
 ADD_KUDU_TEST(negotiation-test)

http://git-wip-us.apache.org/repos/asf/kudu/blob/3f2bf6df/src/kudu/security/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/kudu/security/CMakeLists.txt b/src/kudu/security/CMakeLists.txt
index 0dc7d0f..c669e25 100644
--- a/src/kudu/security/CMakeLists.txt
+++ b/src/kudu/security/CMakeLists.txt
@@ -86,17 +86,29 @@ ADD_EXPORTABLE_LIBRARY(security
 
 
 ##############################
-# security-test
+# mini_kdc
+##############################
+
+set(MINI_KDC_SRCS test/mini_kdc.cc)
+
+add_library(mini_kdc ${MINI_KDC_SRCS})
+target_link_libraries(mini_kdc
+  gutil
+  kudu_test_util
+  kudu_util)
+
+##############################
+# security_test_util
 ##############################
 
 if (NOT NO_TESTS)
   set(SECURITY_TEST_SRCS
     security-test-util.cc
-    test/mini_kdc.cc
-    test/test_certs.cc test/test_pass.cc)
+    test/test_certs.cc
+    test/test_pass.cc)
 
-  add_library(security-test ${SECURITY_TEST_SRCS})
-  target_link_libraries(security-test
+  add_library(security_test_util ${SECURITY_TEST_SRCS})
+  target_link_libraries(security_test_util
     gutil
     kudu_test_util
     kudu_util
@@ -104,8 +116,9 @@ if (NOT NO_TESTS)
 
   # Tests
   set(KUDU_TEST_LINK_LIBS
+    mini_kdc
     security
-    security-test
+    security_test_util
     ${KUDU_MIN_TEST_LIBS})
 
   ADD_KUDU_TEST(ca/cert_management-test)

http://git-wip-us.apache.org/repos/asf/kudu/blob/3f2bf6df/src/kudu/server/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/kudu/server/CMakeLists.txt b/src/kudu/server/CMakeLists.txt
index e1a0362..4c0d9ab 100644
--- a/src/kudu/server/CMakeLists.txt
+++ b/src/kudu/server/CMakeLists.txt
@@ -77,9 +77,9 @@ endif()
 # server_process tests
 #########################################
 
-set(KUDU_TEST_LINK_LIBS  ${KUDU_MIN_TEST_LIBS}
+set(KUDU_TEST_LINK_LIBS ${KUDU_MIN_TEST_LIBS}
   kudu_curl_util
   server_process
-  security-test)
+  security_test_util)
 ADD_KUDU_TEST(rpc_server-test)
 ADD_KUDU_TEST(webserver-test)

http://git-wip-us.apache.org/repos/asf/kudu/blob/3f2bf6df/src/kudu/util/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/kudu/util/CMakeLists.txt b/src/kudu/util/CMakeLists.txt
index 91ac758..ec71364 100644
--- a/src/kudu/util/CMakeLists.txt
+++ b/src/kudu/util/CMakeLists.txt
@@ -268,35 +268,37 @@ ADD_EXPORTABLE_LIBRARY(kudu_util_compression
 # kudu_test_util
 #######################################
 
-if(NOT NO_TESTS)
-  add_library(kudu_test_util
-    test_util.cc)
-  target_link_libraries(kudu_test_util
-    gflags
-    glog
-    gmock
-    kudu_util)
+# Used by mini-cluster, so must be built even when NO_TESTS=0.
+add_library(kudu_test_util
+  test_util.cc)
+target_link_libraries(kudu_test_util
+  gflags
+  glog
+  gmock
+  kudu_util)
 
-  if(NOT APPLE)
-    target_link_libraries(kudu_test_util
-      vmem)
-  endif()
+if(NOT APPLE)
+  target_link_libraries(kudu_test_util
+    vmem)
+endif()
 
 #######################################
 # kudu_curl_util
 #######################################
-  add_library(kudu_curl_util
-    curl_util.cc)
-  target_link_libraries(kudu_curl_util
-    security
-    ${CURL_LIBRARIES}
-    glog
-    gutil)
+
+# Used by mini-cluster, so must be built even when NO_TESTS=0.
+add_library(kudu_curl_util
+  curl_util.cc)
+target_link_libraries(kudu_curl_util
+  security
+  ${CURL_LIBRARIES}
+  glog
+  gutil)
 
 #######################################
 # kudu_test_main
 #######################################
-
+if(NOT NO_TESTS)
   add_library(kudu_test_main
     test_main.cc)
   target_link_libraries(kudu_test_main


Mime
View raw message