HBASE-20733 QABot should run checkstyle tests if the checkstyle configs change

Signed-off-by: Mike Drob <md...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/20772f13
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/20772f13
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/20772f13

Branch: refs/heads/branch-1.2
Commit: 20772f139d7d60ecbd9228f007c35547fa64a196
Parents: 595307f
Author: Sean Busbey <bus...@apache.org>
Authored: Thu Jun 14 13:00:08 2018 -0500
Committer: Sean Busbey <bus...@apache.org>
Committed: Thu Jun 14 20:27:14 2018 -0500

----------------------------------------------------------------------
 dev-support/hbase-personality.sh | 51 +++++++++++++++++++----------------
 1 file changed, 28 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/20772f13/dev-support/hbase-personality.sh
----------------------------------------------------------------------
diff --git a/dev-support/hbase-personality.sh b/dev-support/hbase-personality.sh
index 059d7c2..1b313f4 100755
--- a/dev-support/hbase-personality.sh
+++ b/dev-support/hbase-personality.sh
@@ -67,10 +67,12 @@ function personality_globals
 
   # Yetus 0.7.0 enforces limits. Default proclimit is 1000.
   # Up it. See HBASE-19902 for how we arrived at this number.
+  #shellcheck disable=SC2034
   PROCLIMIT=10000
 
   # Set docker container to run with 20g. Default is 4g in yetus.
   # See HBASE-19902 for how we arrived at 20g.
+  #shellcheck disable=SC2034
   DOCKERMEMLIMIT=20g
 }
 
@@ -106,7 +108,7 @@ function personality_modules
   local repostatus=$1
   local testtype=$2
   local extra=""
-  local MODULES=(${CHANGED_MODULES[@]})
+  local MODULES=("${CHANGED_MODULES[@]}")
 
   yetus_info "Personality: ${repostatus} ${testtype}"
 
@@ -129,6 +131,11 @@ function personality_modules
     MODULES=(.)
   fi
 
+  # If the checkstyle configs change, check everything.
+  if [[ "${testtype}" == checkstyle ]] && [[ "${MODULES[*]}" =~ 
hbase-checkstyle ]]; then
+    MODULES=(.)
+  fi
+
   if [[ ${testtype} == mvninstall ]]; then
     # shellcheck disable=SC2086
     personality_enqueue_module . ${extra}
@@ -183,16 +190,31 @@ function personality_modules
 function personality_file_tests
 {
   local filename=$1
+  yetus_debug "HBase specific personality_file_tests"
   # If the change is to the refguide, then we don't need any builtin yetus 
tests
   # the refguide test (below) will suffice for coverage.
   if [[ ${filename} =~ src/main/asciidoc ]] ||
      [[ ${filename} =~ src/main/xslt ]]; then
     yetus_debug "Skipping builtin yetus checks for ${filename}. refguide test 
should pick it up."
-  # fallback to checking which tests based on what yetus would do by default
-  elif declare -f "${BUILDTOOL}_builtin_personality_file_tests" >/dev/null; 
then
-    "${BUILDTOOL}_builtin_personality_file_tests" "${filename}"
-  elif declare -f builtin_personality_file_tests >/dev/null; then
-    builtin_personality_file_tests "${filename}"
+  else
+    # If we change our asciidoc, rebuild mvnsite
+    if [[ ${BUILDTOOL} = maven ]]; then
+      if [[ ${filename} =~ src/site || ${filename} =~ src/main/asciidoc ]]; 
then
+        yetus_debug "tests/mvnsite: ${filename}"
+        add_test mvnsite
+      fi
+    fi
+    # If we change checkstyle configs, run checkstyle
+    if [[ ${filename} =~ checkstyle.*\.xml ]]; then
+      yetus_debug "tests/checkstyle: ${filename}"
+      add_test checkstyle
+    fi
+    # fallback to checking which tests based on what yetus would do by default
+    if declare -f "${BUILDTOOL}_builtin_personality_file_tests" >/dev/null; 
then
+      "${BUILDTOOL}_builtin_personality_file_tests" "${filename}"
+    elif declare -f builtin_personality_file_tests >/dev/null; then
+      builtin_personality_file_tests "${filename}"
+    fi
   fi
 }
 
@@ -640,23 +662,6 @@ function hbaseanti_patchfile
   return 0
 }
 
-
-## @description  hbase custom mvnsite file filter.  See HBASE-15042
-## @audience     private
-## @stability    evolving
-## @param        filename
-function mvnsite_filefilter
-{
-  local filename=$1
-
-  if [[ ${BUILDTOOL} = maven ]]; then
-    if [[ ${filename} =~ src/site || ${filename} =~ src/main/asciidoc ]]; then
-      yetus_debug "tests/mvnsite: ${filename}"
-      add_test mvnsite
-    fi
-  fi
-}
-
 ## This is named so that yetus will check us right after running tests.
 ## Essentially, we check for normal failures and then we look for zombies.
 #function hbase_unit_logfilter

Reply via email to