hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ni...@apache.org
Subject svn commit: r619499 - /hadoop/core/nightly/hudsonBuildHadoopPatch.sh
Date Thu, 07 Feb 2008 16:47:40 GMT
Author: nigel
Date: Thu Feb  7 08:47:38 2008
New Revision: 619499

URL: http://svn.apache.org/viewvc?rev=619499&view=rev
Log:
Added check to for unit tests in patch process

Modified:
    hadoop/core/nightly/hudsonBuildHadoopPatch.sh

Modified: hadoop/core/nightly/hudsonBuildHadoopPatch.sh
URL: http://svn.apache.org/viewvc/hadoop/core/nightly/hudsonBuildHadoopPatch.sh?rev=619499&r1=619498&r2=619499&view=diff
==============================================================================
--- hadoop/core/nightly/hudsonBuildHadoopPatch.sh (original)
+++ hadoop/core/nightly/hudsonBuildHadoopPatch.sh Thu Feb  7 08:47:38 2008
@@ -114,6 +114,33 @@
 }
 
 ###############################################################################
+### Check for JUnit tests in the patch
+checkTests () {
+  echo ""
+  echo ""
+  echo "======================================================================"
+  echo "======================================================================"
+  echo "    Checking there are new or changed JUnit tests in the patch."
+  echo "======================================================================"
+  echo "======================================================================"
+  echo ""
+  echo ""
+  testReferences=`$GREP -c '/Test' $PATCH_DIR/patch`
+  echo "There appear to be $testReferences test files referenced in the patch."
+  if [[ $testReferences == 0 ]] ; then
+    JIRA_COMMENT="$JIRA_COMMENT
+
+    tests included -1.  The patch doesn't appear to include any new or modified JUnit tests.
+                        Please justify why no unit tests are needed for this patch."
+    return 1
+  fi
+  JIRA_COMMENT="$JIRA_COMMENT
+
+    tests included +1.  The patch appears to include $testReferences new or modified tests."
+  return 0
+}
+
+###############################################################################
 ### Attempt to apply the patch
 applyPatch () {
   echo ""
@@ -462,6 +489,8 @@
 setup
 checkAuthor
 RESULT=$?
+checkTests
+(( RESULT = RESULT + $? ))
 applyPatch
 if [[ $? != 0 ]] ; then
   submitJiraComment 1



Mime
View raw message