kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject [2/4] incubator-kudu git commit: Fix run-test and dist-test to make paths absolute
Date Fri, 22 Jan 2016 04:25:55 GMT
Fix run-test and dist-test to make paths absolute

This fixes issues with run-test.sh (and transitively with dist-test)
when trying to run them from within a working directory which isn't
the repository root. The recent out-of-tree build patch broke some
of this behavior.

Tested by verifying I can now run:
  ../build-support/run-test.sh ./latest/cbtree-test

from my build directory. I also successfully submitted a dist-test task.

Change-Id: Ief6768d05fc4ae5016813909f819fc9e99f9ebd6
Reviewed-on: http://gerrit.cloudera.org:8080/1857
Reviewed-by: Todd Lipcon <todd@apache.org>
Tested-by: Todd Lipcon <todd@apache.org>


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

Branch: refs/heads/master
Commit: 23c6c66d60c9addbd6c58f2bc73c71d496fb80a9
Parents: ae865a5
Author: Todd Lipcon <todd@apache.org>
Authored: Wed Jan 20 23:13:18 2016 -0800
Committer: Todd Lipcon <todd@apache.org>
Committed: Fri Jan 22 04:21:26 2016 +0000

----------------------------------------------------------------------
 README.adoc                |  8 ++++++++
 build-support/dist_test.py |  2 +-
 build-support/run-test.sh  | 20 +++++++++++---------
 3 files changed, 20 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/23c6c66d/README.adoc
----------------------------------------------------------------------
diff --git a/README.adoc b/README.adoc
index ae80060..0478a26 100644
--- a/README.adoc
+++ b/README.adoc
@@ -212,6 +212,14 @@ Instead, use a command like:
 $ ctest -R foo-test
 ----
 
+or
+
+[source,bash]
+----
+$ build-support/run-test.sh build/tsan/latest/foo-test [--test-arguments-here]
+----
+
+
 ...and then view the logs in _build/tsan/test-logs/_
 
 In order for all of the suppressions to work, you need libraries with debug

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/23c6c66d/build-support/dist_test.py
----------------------------------------------------------------------
diff --git a/build-support/dist_test.py b/build-support/dist_test.py
index aa312ca..ceb37b7 100755
--- a/build-support/dist_test.py
+++ b/build-support/dist_test.py
@@ -236,7 +236,7 @@ def create_archive_input(staging, argv,
   files.append(rel_test_exe)
   deps = ldd_deps(abs_test_exe)
   for d in DEPS_FOR_ALL:
-    d = os.path.realpath(d)
+    d = os.path.realpath(rel_to_abs(d))
     if os.path.isdir(d):
       d += "/"
     deps.append(d)

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/23c6c66d/build-support/run-test.sh
----------------------------------------------------------------------
diff --git a/build-support/run-test.sh b/build-support/run-test.sh
index 605a325..f9f7f60 100755
--- a/build-support/run-test.sh
+++ b/build-support/run-test.sh
@@ -33,13 +33,14 @@
 # central test server.
 
 # Path to the test executable or script to be run.
+# May be relative or absolute.
 TEST_PATH=$1
 
-# Path to the root source directory. This script is expected to live within it.
-SOURCE_ROOT=$(dirname "$BASH_SOURCE")/..
+# Absolute path to the root source directory. This script is expected to live within it.
+SOURCE_ROOT=$(cd $(dirname "$BASH_SOURCE")/.. ; pwd)
 
-# Path to the root build directory. The test path is expected to be within it.
-BUILD_ROOT=$(dirname "$TEST_PATH")/..
+# Absolute path to the root build directory. The test path is expected to be within it.
+BUILD_ROOT=$(cd $(dirname "$TEST_PATH")/.. ; pwd)
 
 TEST_LOGDIR=$BUILD_ROOT/test-logs
 mkdir -p $TEST_LOGDIR
@@ -49,6 +50,7 @@ mkdir -p $TEST_DEBUGDIR
 
 TEST_DIRNAME=$(cd $(dirname $TEST_PATH); pwd)
 TEST_FILENAME=$(basename $TEST_PATH)
+ABS_TEST_PATH=$TEST_DIRNAME/$TEST_FILENAME
 shift
 TEST_NAME=$(echo $TEST_FILENAME | perl -pe 's/\..+?$//') # Remove path and extension (if
any).
 
@@ -148,8 +150,8 @@ for ATTEMPT_NUMBER in $(seq 1 $TEST_EXECUTION_ATTEMPTS) ; do
 
   echo "Running $TEST_NAME, redirecting output into $LOGFILE" \
     "(attempt ${ATTEMPT_NUMBER}/$TEST_EXECUTION_ATTEMPTS)"
-  $TEST_PATH "$@" --test_timeout_after $KUDU_TEST_TIMEOUT 2>&1 \
-    | $SOURCE_ROOT/build-support/stacktrace_addr2line.pl $TEST_PATH \
+  $ABS_TEST_PATH "$@" --test_timeout_after $KUDU_TEST_TIMEOUT 2>&1 \
+    | $SOURCE_ROOT/build-support/stacktrace_addr2line.pl $ABS_TEST_PATH \
     | $pipe_cmd > $LOGFILE
   STATUS=$?
 
@@ -189,7 +191,7 @@ for ATTEMPT_NUMBER in $(seq 1 $TEST_EXECUTION_ATTEMPTS) ; do
 
   if [ -n "$KUDU_REPORT_TEST_RESULTS" ]; then
     echo Reporting results
-    $SOURCE_ROOT/build-support/report-test.sh "$TEST_PATH" "$LOGFILE" "$STATUS" &
+    $SOURCE_ROOT/build-support/report-test.sh "$ABS_TEST_PATH" "$LOGFILE" "$STATUS" &
 
     # On success, we'll do "best effort" reporting, and disown the subprocess.
     # On failure, we want to upload the failed test log. So, in that case,
@@ -229,12 +231,12 @@ fi
 COREFILES=$(ls | grep ^core)
 if [ -n "$COREFILES" ]; then
   echo Found core dump. Saving executable and core files.
-  gzip < $TEST_PATH > "$TEST_DEBUGDIR/$TEST_NAME.gz" || exit $?
+  gzip < $ABS_TEST_PATH > "$TEST_DEBUGDIR/$TEST_NAME.gz" || exit $?
   for COREFILE in $COREFILES; do
     gzip < $COREFILE > "$TEST_DEBUGDIR/$TEST_NAME.$COREFILE.gz" || exit $?
   done
   # Pull in any .so files as well.
-  for LIB in $(ldd $TEST_PATH | grep $BUILD_ROOT | awk '{print $3}'); do
+  for LIB in $(ldd $ABS_TEST_PATH | grep $BUILD_ROOT | awk '{print $3}'); do
     LIB_NAME=$(basename $LIB)
     gzip < $LIB > "$TEST_DEBUGDIR/$LIB_NAME.gz" || exit $?
   done


Mime
View raw message