You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2012/04/24 20:06:27 UTC
svn commit: r1329903 - /hbase/branches/0.94/dev-support/test-util.sh
Author: stack
Date: Tue Apr 24 18:06:27 2012
New Revision: 1329903
URL: http://svn.apache.org/viewvc?rev=1329903&view=rev
Log:
HBASE-5865 test-util.sh broken with unittest updates
Modified:
hbase/branches/0.94/dev-support/test-util.sh
Modified: hbase/branches/0.94/dev-support/test-util.sh
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/dev-support/test-util.sh?rev=1329903&r1=1329902&r2=1329903&view=diff
==============================================================================
--- hbase/branches/0.94/dev-support/test-util.sh (original)
+++ hbase/branches/0.94/dev-support/test-util.sh Tue Apr 24 18:06:27 2012
@@ -39,9 +39,13 @@ options:
-n N Run each test N times. Default = 1.
-s N Print N slowest tests
-H Print which tests are hanging (if any)
+ -e Echo the maven call before running. Default: not enabled
+ -r Runs remotely, on the build server. Default: not enabled
EOF
}
+echoUsage=0
+server=0
testFile=
doClean=""
testType=verify
@@ -59,7 +63,7 @@ else
fi
testDir=$scriptDir/../../../target/surefire-reports
-while getopts "hcHun:s:f:" OPTION
+while getopts "hcerHun:s:f:" OPTION
do
case $OPTION in
h)
@@ -84,6 +88,12 @@ do
f)
testFile=$OPTARG
;;
+ e)
+ echoUsage=1
+ ;;
+ r)
+ server=1
+ ;;
?)
usage
exit 1
@@ -124,15 +134,44 @@ do
#Now loop through each test
for (( j = 0; j < $numTests; j++ ))
do
- nice -10 mvn $doClean $testType -Dtest=${test[$j]}
- if [ $? -ne 0 ]; then
+ # Create the general command
+ cmd="nice -10 mvn $doClean $testType -Dtest=${test[$j]}"
+
+ # Add that is should run locally, if not on the server
+ if [ ${server} -eq 0 ]; then
+ cmd="${cmd} -P localTests"
+ fi
+
+ # Print the command, if we should
+ if [ ${echoUsage} -eq 1 ]; then
+ echo "${cmd}"
+ fi
+
+ # Run the command
+ $cmd
+
+ if [ $? -ne 0 ]; then
echo "${test[$j]} failed, iteration: $i"
exit 1
fi
done
else
echo "EXECUTING ALL TESTS"
- nice -10 mvn $doClean $testType
+ # Create the general command
+ cmd="nice -10 mvn $doClean $testType"
+
+ # Add that is should run locally, if not on the server
+ if [ ${server} -eq 0 ]; then
+ cmd="${cmd} -P localTests"
+ fi
+
+ # Print the command, if we should
+ if [ ${echoUsage} -eq 1 ]; then
+ echo "${cmd}"
+ fi
+
+ #now run the command
+ $cmd
fi
done