Skip to content

Commit

Permalink
build: don't name unsharded tests with a shard suffix
Browse files Browse the repository at this point in the history
Change-Id: I33611f9766381d367c7a5ac7b09a00f01c48fe74
Reviewed-on: http://gerrit.cloudera.org:8080/9524
Tested-by: Kudu Jenkins
Reviewed-by: Adar Dembo <[email protected]>
  • Loading branch information
toddlipcon authored and adembo committed Mar 12, 2018
1 parent 0c05e83 commit fbf6062
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
8 changes: 6 additions & 2 deletions build-support/run-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit fbf6062

Please sign in to comment.