You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@yetus.apache.org by bu...@apache.org on 2015/09/23 04:24:03 UTC

[33/50] [abbrv] yetus git commit: HADOOP-12303. test-patch pylint plugin fails silently and votes +1 incorrectly (Kengo Seki via aw)

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/yetus/repo
Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/f3562c67
Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/f3562c67
Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/f3562c67

Branch: refs/heads/master
Commit: f3562c67f358787cae0271c16bc0485eb69abea1
Parents: 42fd07c
Author: Allen Wittenauer <aw...@apache.org>
Authored: Thu Aug 20 08:19:15 2015 -0700
Committer: Allen Wittenauer <aw...@apache.org>
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/yetus/blob/f3562c67/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