Repository: hadoop
Updated Branches:
  refs/heads/HADOOP-12111 d3b5c4cf7 -> 2c4208f2b


HADOOP-12303. test-patch pylint plugin fails silently and votes +1 incorrectly 
(Kengo Seki via aw)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/2c4208f2
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/2c4208f2
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/2c4208f2

Branch: refs/heads/HADOOP-12111
Commit: 2c4208f2bf5806052de2c5d884460754adc65659
Parents: d3b5c4c
Author: Allen Wittenauer <[email protected]>
Authored: Thu Aug 20 08:19:15 2015 -0700
Committer: Allen Wittenauer <[email protected]>
Committed: Thu Aug 20 08:19:41 2015 -0700

----------------------------------------------------------------------
 dev-support/test-patch.d/pylint.sh | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/2c4208f2/dev-support/test-patch.d/pylint.sh
----------------------------------------------------------------------
diff --git a/dev-support/test-patch.d/pylint.sh 
b/dev-support/test-patch.d/pylint.sh
index ebac162..1ee5a8f 100755
--- a/dev-support/test-patch.d/pylint.sh
+++ b/dev-support/test-patch.d/pylint.sh
@@ -56,6 +56,8 @@ function pylint_filefilter
 function pylint_preapply
 {
   local i
+  local count
+  local tmp=${PATCH_DIR}/pylint.$$.${RANDOM}
 
   verify_needed_test pylint
   if [[ $? == 0 ]]; then
@@ -76,10 +78,17 @@ function pylint_preapply
   for i in ${CHANGED_FILES}; do
     if [[ ${i} =~ \.py$ && -f ${i} ]]; then
       # shellcheck disable=SC2086
-      eval "${PYLINT} ${PYLINT_OPTIONS} --output-format=parseable --reports=n 
${i}" 2>/dev/null |
+      eval "${PYLINT} ${PYLINT_OPTIONS} --output-format=parseable --reports=n 
${i}" 2>${tmp} |
       ${AWK} '1<NR' >> "${PATCH_DIR}/branch-pylint-result.txt"
     fi
+    # shellcheck disable=SC2016
+    count=$(${GREP} -v "^No config file found" "${tmp}" | wc -l | ${AWK} 
'{print $1}')
+    if [[ ${count} -gt 0 ]]; then
+      add_footer_table pylint "prepatch stderr: ${tmp}"
+      return 1
+    fi
   done
+  rm "${tmp}" 2>/dev/null
   popd >/dev/null
   # keep track of how much as elapsed for us already
   PYLINT_TIMER=$(stop_clock)
@@ -89,9 +98,11 @@ function pylint_preapply
 function pylint_postapply
 {
   local i
+  local count
   local numPrepatch
   local numPostpatch
   local diffPostpatch
+  local tmp=${PATCH_DIR}/pylint.$$.${RANDOM}
 
   verify_needed_test pylint
   if [[ $? == 0 ]]; then
@@ -118,10 +129,18 @@ function pylint_postapply
   for i in ${CHANGED_FILES}; do
     if [[ ${i} =~ \.py$ && -f ${i} ]]; then
       # shellcheck disable=SC2086
-      eval "${PYLINT} ${PYLINT_OPTIONS} --output-format=parseable --reports=n 
${i}" 2>/dev/null |
+      eval "${PYLINT} ${PYLINT_OPTIONS} --output-format=parseable --reports=n 
${i}" 2>${tmp} |
       ${AWK} '1<NR' >> "${PATCH_DIR}/patch-pylint-result.txt"
     fi
+    # shellcheck disable=SC2016
+    count=$(${GREP} -v "^No config file found" "${tmp}" | wc -l | ${AWK} 
'{print $1}')
+    if [[ ${count} -gt 0 ]]; then
+      add_vote_table -1 pylint "Something bad seems to have happened in 
running pylint. Please check pylint stderr files."
+      add_footer_table pylint "postpatch stderr: ${tmp}"
+      return 1
+    fi
   done
+  rm "${tmp}" 2>/dev/null
   popd >/dev/null
 
   # shellcheck disable=SC2016

Reply via email to