From 70f9ace41265973a05055392c9e3ecf3bc466d1e Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 8 Sep 2011 18:39:11 +0000 Subject: [PATCH] HADOOP-7612. Change test-patch to run tests for all nested modules. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1166848 13f79535-47bb-0310-9956-ffa450edef68 --- dev-support/test-patch.sh | 76 ++++++------------- .../hadoop-common/CHANGES.txt | 3 + 2 files changed, 27 insertions(+), 52 deletions(-) diff --git a/dev-support/test-patch.sh b/dev-support/test-patch.sh index 1be8d04850..3cea7c4cb7 100755 --- a/dev-support/test-patch.sh +++ b/dev-support/test-patch.sh @@ -64,6 +64,7 @@ printUsage() { echo "--findbugs-home= Findbugs home directory (default FINDBUGS_HOME environment variable)" echo "--forrest-home= Forrest home directory (default FORREST_HOME environment variable)" echo "--dirty-workspace Allow the local SVN workspace to have uncommitted changes" + echo "--run-tests Run all tests below the base directory" echo echo "Jenkins-only options:" echo "--jenkins Run by Jenkins (runs tests and posts results to JIRA)" @@ -130,6 +131,9 @@ parseArgs() { --dirty-workspace) DIRTY_WORKSPACE=true ;; + --run-tests) + RUN_TESTS=true + ;; *) PATCH_OR_DEFECT=$i ;; @@ -249,6 +253,18 @@ setup () { echo "======================================================================" echo "" echo "" + if [[ ! -d hadoop-common-project ]]; then + cd $bindir/.. + echo "Compiling $(pwd)" + echo "$MVN clean test -DskipTests > $PATCH_DIR/trunkCompile.txt 2>&1" + $MVN clean test -DskipTests > $PATCH_DIR/trunkCompile.txt 2>&1 + if [[ $? != 0 ]] ; then + echo "Top-level trunk compilation is broken?" + cleanupAndExit 1 + fi + cd - + fi + echo "Compiling $(pwd)" echo "$MVN clean test -DskipTests -D${PROJECT_NAME}PatchProcess -Ptest-patch > $PATCH_DIR/trunkJavacWarnings.txt 2>&1" $MVN clean test -DskipTests -D${PROJECT_NAME}PatchProcess -Ptest-patch > $PATCH_DIR/trunkJavacWarnings.txt 2>&1 if [[ $? != 0 ]] ; then @@ -580,26 +596,12 @@ runTests () { echo "" echo "" - failed_tests="" - modules=$(findModules) - for module in $modules; - do - pushd $module - echo " Running tests in $module" - ### Kill any rogue build processes from the last attempt - $PS auxwww | $GREP ${PROJECT_NAME}PatchProcess | $AWK '{print $2}' | /usr/bin/xargs -t -I {} /bin/kill -9 {} > /dev/null - - echo "$MVN clean test -Pnative -D${PROJECT_NAME}PatchProcess" - $MVN clean test -Pnative -D${PROJECT_NAME}PatchProcess - if [[ $? != 0 ]] ; then - ### Find and format names of failed tests - module_failed_tests=`find . -name 'TEST*.xml' | xargs $GREP -l -E " $TMP - - # if all of the lines start with a/ or b/, then this is a git patch that - # was generated without --no-prefix - if ! $GREP -qv '^a/\|^b/' $TMP ; then - sed -i -e 's,^[ab]/,,' $TMP - fi - - PREFIX_DIRS=$(cut -d '/' -f 1 $TMP | sort | uniq) - - # if all of the lines start with hadoop-common-project/, hadoop-hdfs-project/, or hadoop-mapreduce-project/, this is - # relative to the hadoop root instead of the subproject root - if [[ "$PREFIX_DIRS" =~ ^(hadoop-common-project|hadoop-hdfs-project|hadoop-mapreduce-project)$ ]]; then - echo $PREFIX_DIRS - return 0 - elif ! echo "$PREFIX_DIRS" | grep -vxq 'hadoop-common-project\|hadoop-hdfs-project\|hadoop-mapreduce-project' ; then - echo $PREFIX_DIRS - return 0 - fi - - # No modules found. Running from current directory. - echo . -} - ############################################################################### ### Run the test-contrib target runContribTests () { @@ -820,8 +792,8 @@ checkFindbugsWarnings (( RESULT = RESULT + $? )) checkReleaseAuditWarnings (( RESULT = RESULT + $? )) -### Do not call these when run by a developer -if [[ $JENKINS == "true" ]] ; then +### Run tests for Jenkins or if explictly asked for by a developer +if [[ $JENKINS == "true" || $RUN_TESTS == "true" ]] ; then runTests (( RESULT = RESULT + $? )) runContribTests diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index d62fa2db3a..dd148f6b83 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -371,6 +371,9 @@ Release 0.23.0 - Unreleased HADOOP-7507. Allow ganglia metrics to include the metrics system tags in the gmetric names. (Alejandro Abdelnur via todd) + HADOOP-7612. Change test-patch to run tests for all nested modules. + (tomwhite) + OPTIMIZATIONS HADOOP-7333. Performance improvement in PureJavaCrc32. (Eric Caspole