kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject kudu git commit: build: don't name unsharded tests with a shard suffix
Date Mon, 12 Mar 2018 22:26:51 GMT
Repository: kudu
Updated Branches:
  refs/heads/master 0c05e8375 -> fbf6062ca


build: don't name unsharded tests with a shard suffix

Change-Id: I33611f9766381d367c7a5ac7b09a00f01c48fe74
Reviewed-on: http://gerrit.cloudera.org:8080/9524
Tested-by: Kudu Jenkins
Reviewed-by: Adar Dembo <adar@cloudera.com>


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

Branch: refs/heads/master
Commit: fbf6062cacd2a14cb9497bc29bf821b0578431dc
Parents: 0c05e83
Author: Todd Lipcon <todd@apache.org>
Authored: Tue Mar 6 17:36:50 2018 -0800
Committer: Adar Dembo <adar@cloudera.com>
Committed: Mon Mar 12 22:26:32 2018 +0000

----------------------------------------------------------------------
 CMakeLists.txt            | 7 ++++++-
 build-support/run-test.sh | 8 ++++++--
 2 files changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/fbf6062c/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 753da44..03ddbd9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -757,7 +757,12 @@ function(ADD_KUDU_TEST REL_TEST_NAME)
 
   math(EXPR MAX_SHARD "${ARG_NUM_SHARDS} - 1")
   foreach(SHARD_NUM RANGE ${MAX_SHARD})
-    set(TARGET ${TEST_NAME}.${SHARD_NUM})
+    # Only name the targets with a '.<shard>' if the test is sharded.
+    if(${ARG_NUM_SHARDS} EQUAL 1)
+      set(TARGET ${TEST_NAME})
+    else()
+      set(TARGET ${TEST_NAME}.${SHARD_NUM})
+    endif()
 
     add_test(${TARGET}
       ${BUILD_SUPPORT_DIR}/run-test.sh ${TEST_PATH})

http://git-wip-us.apache.org/repos/asf/kudu/blob/fbf6062c/build-support/run-test.sh
----------------------------------------------------------------------
diff --git a/build-support/run-test.sh b/build-support/run-test.sh
index c1b7647..93c9cd6 100755
--- a/build-support/run-test.sh
+++ b/build-support/run-test.sh
@@ -63,8 +63,12 @@ shift
 # The "short" test name doesn't include the shard number.
 SHORT_TEST_NAME=$(echo $TEST_FILENAME | perl -pe 's/\..+?$//')
 
-# The full test name does include the shard number.
-TEST_NAME=${SHORT_TEST_NAME}.${GTEST_SHARD_INDEX:-0}
+# The full test name does include the shard number if the test is sharded.
+if [ "$GTEST_TOTAL_SHARDS" -gt 1 ]; then
+  TEST_NAME=${SHORT_TEST_NAME}.${GTEST_SHARD_INDEX:?}
+else
+  TEST_NAME=${SHORT_TEST_NAME}
+fi
 
 # Determine whether the test is a known flaky by comparing against the user-specified
 # list.


Mime
View raw message