From 04db900772889d70836dbd733f844782fb7adecd Mon Sep 17 00:00:00 2001 From: Sean Busbey Date: Thu, 14 Jun 2018 13:00:08 -0500 Subject: [PATCH] HBASE-20733 QABot should run checkstyle tests if the checkstyle configs change Signed-off-by: Mike Drob --- dev-support/hbase-personality.sh | 51 ++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/dev-support/hbase-personality.sh b/dev-support/hbase-personality.sh index 2c6e4a80890..8004167e167 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}" @@ -130,6 +132,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} @@ -188,16 +195,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 } @@ -648,23 +670,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