HBASE-4826 Modify hbasetests.sh to take into account the new pom.xml with surefire

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1204100 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2011-11-19 22:35:50 +00:00
parent 35981f50f9
commit 261e33d939
1 changed files with 40 additions and 12 deletions

52
dev-support/hbasetests.sh Normal file → Executable file
View File

@ -1,4 +1,21 @@
#!/usr/bin/env bash
##
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##
#
# This script:
# - analyse the content of the .java test file to split them between
@ -27,6 +44,10 @@
#
######################################### parameters
#mvn test -Dtest=org.apache.hadoop.hbase.regionserver.TestScanWithBloomError $*
#exit
#set to 0 to run only developpers tests (small & medium categories)
runAllTests=0
@ -53,8 +74,8 @@ rootTestClassDirectory="./src/test/java/"
surefireReportDirectory="./target/surefire-reports/"
#variable to use to debug the script without launching the tests
mvnCommand=mvn
#mvnCommand=echo
mvnCommand="mvn "
#mvnCommand="echo $mvnCommand"
######################################### Functions
#get the list of the process considered as dead
@ -102,13 +123,15 @@ function cleanProcess {
son=`ps -o pid= --pid $pId | wc -l`
if (test $son -gt 0)
then
echo "$pId, java sub process of $id, is still running after a nice kill, using kill -9 now"
echo "$pId, java sub process of $id, is still running after a standard kill, using kill -9 now"
echo "Stack for $pId before kill -9:"
jstack -F -l $pId
kill -9 $pId
echo "kill sent, waiting for 2 seconds"
sleep 2
echo "Process $pId killed by kill -9"
else
echo "Process $pId killed by standard kill -9"
echo "Process $pId killed by standard kill -15"
fi
else
echo "$pId is not a java process (it's $name), I don't kill it."
@ -192,13 +215,18 @@ do
then
isLarge=`grep "@Category" $testFile | grep "LargeTests.class" | wc -l`
if (test $isLarge -eq 0)
then
isSmall=1
#sanity check on small tests
isStrange=`grep "\.startMini" $testFile | wc -l`
if (test $isStrange -gt 0)
then
isSmall=`grep "@Category" $testFile | grep "SmallTests.class" | wc -l`
if (test $isSmall -eq 0)
then
echo "$testFile is categorized as 'small' but contains a .startMini string. Keep it as small anyway"
echo "$testName is not categorized, so it won't be tested"
else
#sanity check on small tests
isStrange=`grep "\.startMini" $testFile | wc -l`
if (test $isStrange -gt 0)
then
echo "$testFile is categorized as 'small' but contains a .startMini string. Keep it as small anyway, but it's strange."
fi
fi
fi
fi
@ -269,8 +297,8 @@ runList2=${runList2:1:${#runList2}}
#now we can run the tests, at last!
echo "Running small tests with one maven instance, in parallel"
$mvnCommand -P parallelTests test -Dtest=$smallList $args
#echo Small tests are $smallList
$mvnCommand -P singleJVMTests test -Dtest=$smallList $args
cleanProcess
exeTime=$(((`date +%s` - $startTime)/60))