From 0ce001a9da78f5bdc770f133bf7a630fea438ddf Mon Sep 17 00:00:00 2001 From: Sean Busbey Date: Mon, 23 Apr 2018 16:51:49 -0500 Subject: [PATCH] HBASE-20478 hbase-anti precommit test should log details and add a footer as needed. --- dev-support/hbase-personality.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/dev-support/hbase-personality.sh b/dev-support/hbase-personality.sh index b010503553..c514a501b2 100755 --- a/dev-support/hbase-personality.sh +++ b/dev-support/hbase-personality.sh @@ -611,6 +611,7 @@ function hbaseanti_patchfile local patchfile=$1 local warnings local result + local logfile if [[ "${BUILDMODE}" = full ]]; then return 0 @@ -621,34 +622,53 @@ function hbaseanti_patchfile fi big_console_header "Checking for known anti-patterns" + logfile="patchfile-hbaseanti-results.txt" + > "${PATCH_DIR}/${logfile}" start_clock warnings=$(${GREP} -c 'new TreeMap>"${PATCH_DIR}/${logfile}" + ${GREP} 'new TreeMap>"${PATCH_DIR}/${logfile}" + start_clock ((result=result+1)) fi warnings=$(${GREP} -c 'import org.apache.hadoop.classification' "${patchfile}") if [[ ${warnings} -gt 0 ]]; then add_vote_table -1 hbaseanti "" "The patch appears use Hadoop classification instead of HBase." + echo "Use of Hadoop classification annotations in patch" + echo "Use of Hadoop classification annotations in patch" >>"${PATCH_DIR}/${logfile}" + ${GREP} 'import org.apache.hadoop.classification' "${patchfile}" >>"${PATCH_DIR}/${logfile}" + start_clock ((result=result+1)) fi warnings=$(${GREP} -c 'import org.codehaus.jackson' "${patchfile}") if [[ ${warnings} -gt 0 ]]; then add_vote_table -1 hbaseanti "" "The patch appears use Jackson 1 classes/annotations." + echo "Use of Jackson 1 classes/annotations in patch" + echo "Use of Jackson 1 classes/annotations in patch" >>"${PATCH_DIR}/${logfile}" + ${GREP} 'import org.codehaus.jackson' "${patchfile}" >>"${PATCH_DIR}/${logfile}" + start_clock ((result=result+1)) fi warnings=$(${GREP} -cE 'org.apache.commons.logging.Log(Factory|;)' "${patchfile}") if [[ ${warnings} -gt 0 ]]; then add_vote_table -1 hbaseanti "" "The patch appears to use commons-logging instead of slf4j." + echo "Use of commons-logging instead of slf4j in patch" + echo "Use of commons-logging instead of slf4j in patch" >>"${PATCH_DIR}/${logfile}" + ${GREP} -E 'org.apache.commons.logging.Log(Factory|;)' "${patchfile}" >>"${PATCH_DIR}/${logfile}" + start_clock ((result=result+1)) fi if [[ ${result} -gt 0 ]]; then + add_footer_table hbaseanti "@@BASE@@/${logfile}" return 1 fi -- 2.16.1