Repository: yetus Updated Branches: refs/heads/master e42326a1d -> cc91d6134
YETUS-660. checkstyle should report when it fails to execute Signed-off-by: Jack Bearden <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/yetus/repo Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/444b2007 Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/444b2007 Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/444b2007 Branch: refs/heads/master Commit: 444b20079813bfc6df10d643aff8dc9e7714066e Parents: e42326a Author: Allen Wittenauer <[email protected]> Authored: Wed Aug 15 10:19:53 2018 -0700 Committer: Allen Wittenauer <[email protected]> Committed: Wed Aug 22 16:18:55 2018 -0700 ---------------------------------------------------------------------- precommit/test-patch.d/checkstyle.sh | 16 +++++++++++----- precommit/test-patch.d/java.sh | 1 + precommit/test-patch.d/maven.sh | 27 +++++++++++---------------- 3 files changed, 23 insertions(+), 21 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/yetus/blob/444b2007/precommit/test-patch.d/checkstyle.sh ---------------------------------------------------------------------- diff --git a/precommit/test-patch.d/checkstyle.sh b/precommit/test-patch.d/checkstyle.sh index e297a13..5bfca02 100755 --- a/precommit/test-patch.d/checkstyle.sh +++ b/precommit/test-patch.d/checkstyle.sh @@ -151,6 +151,7 @@ function checkstyle_runner declare text declare linenum declare codeline + declare cmdresult # first, let's clear out any previous run information modules_reset @@ -195,15 +196,21 @@ function checkstyle_runner #shellcheck disable=SC2086 echo_and_redirect "${logfile}" ${cmd} - ${SED} -e "s,^\[ERROR\] ,,g" -e "s,^\[WARN\] ,,g" "${logfile}" \ + cmdresult=$? + + ${SED} -e 's,^\[ERROR\] ,,g' -e 's,^\[WARN\] ,,g' "${logfile}" \ | ${GREP} ^/ \ | ${SED} -e "s,${BASEDIR},.,g" \ > "${tmp}" - if [[ $? == 0 ]] ; then - module_status ${i} +1 "${logfile}" "${BUILDMODEMSG} ${modulesuffix} passed checkstyle" + if [[ "${modulesuffix}" == . ]]; then + modulesuffix=root + fi + + if [[ ${cmdresult} == 0 ]]; then + module_status ${i} +1 "${logfile}" "${BUILDMODEMSG} passed checkstyle in ${modulesuffix}" else - module_status ${i} -1 "${logfile}" "${BUILDMODEMSG} ${modulesuffix} failed checkstyle" + module_status ${i} -1 "${logfile}" "${BUILDMODEMSG} fails to run checkstyle in ${modulesuffix}" ((result = result + 1)) fi @@ -220,7 +227,6 @@ function checkstyle_runner ${GREP} "${j}" "${tmp}" >> "${tmp}.1" done - # now that we have just the files we care about, # let's unscrew it. You see... http://git-wip-us.apache.org/repos/asf/yetus/blob/444b2007/precommit/test-patch.d/java.sh ---------------------------------------------------------------------- diff --git a/precommit/test-patch.d/java.sh b/precommit/test-patch.d/java.sh index f36c868..8515650 100755 --- a/precommit/test-patch.d/java.sh +++ b/precommit/test-patch.d/java.sh @@ -40,6 +40,7 @@ function initialize_java fi if declare -f maven_add_install >/dev/null 2>&1; then + maven_add_install javac maven_add_install javadoc fi http://git-wip-us.apache.org/repos/asf/yetus/blob/444b2007/precommit/test-patch.d/maven.sh ---------------------------------------------------------------------- diff --git a/precommit/test-patch.d/maven.sh b/precommit/test-patch.d/maven.sh index 2a384de..dba0a2a 100755 --- a/precommit/test-patch.d/maven.sh +++ b/precommit/test-patch.d/maven.sh @@ -127,6 +127,7 @@ function maven_initialize { # we need to do this before docker does it as root + maven_add_install compile maven_add_install mvnsite maven_add_install unit @@ -565,7 +566,7 @@ function mvnsite_postcompile return 0 } -## @description Verify mvn install works +## @description maven precompile phase ## @audience private ## @stability evolving ## @replaceable no @@ -581,24 +582,15 @@ function maven_precompile return 0 fi - if verify_needed_test javac; then + # not everything needs a maven install + # but quite a few do ... + # shellcheck disable=SC2086 + for index in ${MAVEN_NEED_INSTALL}; do need=true - else - # not everything needs a maven install - # but quite a few do ... - # shellcheck disable=SC2086 - for index in ${MAVEN_NEED_INSTALL}; do - if verify_needed_test ${index}; then - need=branch - fi - done - fi + done if [[ "${need}" = false ]]; then return 0 - elif [[ "${need}" = branch - && "${repostatus}" = patch ]]; then - return 0 fi if [[ "${repostatus}" = branch ]]; then @@ -608,7 +600,10 @@ function maven_precompile fi personality_modules "${repostatus}" mvninstall - modules_workers "${repostatus}" mvninstall -fae clean install -DskipTests=true -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dfindbugs.skip=true + modules_workers "${repostatus}" mvninstall -fae \ + clean install \ + -DskipTests=true -Dmaven.javadoc.skip=true \ + -Dcheckstyle.skip=true -Dfindbugs.skip=true result=$? modules_messages "${repostatus}" mvninstall true if [[ ${result} != 0 ]]; then
