Return-Path: X-Original-To: apmail-yetus-commits-archive@minotaur.apache.org Delivered-To: apmail-yetus-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5976719000 for ; Thu, 14 Jan 2016 16:04:10 +0000 (UTC) Received: (qmail 97643 invoked by uid 500); 14 Jan 2016 16:04:09 -0000 Delivered-To: apmail-yetus-commits-archive@yetus.apache.org Received: (qmail 97622 invoked by uid 500); 14 Jan 2016 16:04:09 -0000 Mailing-List: contact commits-help@yetus.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@yetus.apache.org Delivered-To: mailing list commits@yetus.apache.org Received: (qmail 97613 invoked by uid 99); 14 Jan 2016 16:04:09 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Jan 2016 16:04:09 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id C66A5E3872; Thu, 14 Jan 2016 16:04:08 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: aw@apache.org To: commits@yetus.apache.org Message-Id: <4e832d0e820e4b6fbbe2a54e3286c2dd@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: yetus git commit: YETUS-271. findbugs.sh will -1 if there are no java source code in the module. Date: Thu, 14 Jan 2016 16:04:08 +0000 (UTC) Repository: yetus Updated Branches: refs/heads/master e330e3fdf -> d49f2ff1a YETUS-271. findbugs.sh will -1 if there are no java source code in the module. Signed-off-by: Akira AJISAKA Project: http://git-wip-us.apache.org/repos/asf/yetus/repo Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/d49f2ff1 Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/d49f2ff1 Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/d49f2ff1 Branch: refs/heads/master Commit: d49f2ff1a171b321a7e2f45af9fc61311c9ad11b Parents: e330e3f Author: Allen Wittenauer Authored: Mon Jan 11 13:58:34 2016 -0800 Committer: Allen Wittenauer Committed: Thu Jan 14 08:02:24 2016 -0800 ---------------------------------------------------------------------- precommit/test-patch.d/findbugs.sh | 45 ++++++++++++++++++++++++++++++++- precommit/test-patch.sh | 26 +++++++++++++++++++ 2 files changed, 70 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/yetus/blob/d49f2ff1/precommit/test-patch.d/findbugs.sh ---------------------------------------------------------------------- diff --git a/precommit/test-patch.d/findbugs.sh b/precommit/test-patch.d/findbugs.sh index a9e9614..2419048 100755 --- a/precommit/test-patch.d/findbugs.sh +++ b/precommit/test-patch.d/findbugs.sh @@ -80,6 +80,41 @@ function findbugs_precheck fi } +## @description Dequeue maven modules that lack java sources +## @audience private +## @stability evolving +## @replaceable no +## @param repostatus +function findbugs_maven_skipper +{ + declare repostat=$1 + declare -i i=0 + declare skiplist=() + declare modname + + start_clock + #shellcheck disable=SC2153 + until [[ ${i} -eq ${#MODULE[@]} ]]; do + # If there are no java source code in the module, + # skip parsing output xml file. + if [[ ! -d "${MODULE[${i}]}/src/main/java" + && ! -d "${MODULE[${i}]}/src/test/java" ]]; then + skiplist=("${skiplist[@]}" "${MODULE[$i]}") + fi + ((i=i+1)) + done + + i=0 + + for modname in "${skiplist[@]}"; do + dequeue_personality_module "${modname}" + done + + if [[ -n "${modname}" ]]; then + add_vote_table 0 findbugs "Skipped ${repostat} modules with no Java source: ${skiplist[*]}" + fi +} + ## @description Run the maven findbugs plugin and record found issues in a bug database ## @audience private ## @stability evolving @@ -97,6 +132,13 @@ function findbugs_runner local savestop personality_modules "${name}" findbugs + + # strip out any modules that aren't actually java modules + # this can save a lot of time during testing + if [[ "${BUILDTOOL}" = maven ]]; then + findbugs_maven_skipper "${name}" + fi + "${BUILDTOOL}_modules_worker" "${name}" findbugs if [[ ${UNSUPPORTED_TEST} = true ]]; then @@ -124,7 +166,6 @@ function findbugs_runner ;; esac - if [[ ! -f ${file} ]]; then module_status ${i} -1 "" "${name}/${module} no findbugs output file (${file})" ((i=i+1)) @@ -212,6 +253,7 @@ function findbugs_preapply ((modindex=modindex+1)) continue fi + module=${MODULE[${modindex}]} start_clock offset_clock "${MODULE_STATUS_TIMER[${modindex}]}" @@ -289,6 +331,7 @@ function findbugs_postinstall ((i=i+1)) continue fi + start_clock offset_clock "${MODULE_STATUS_TIMER[${i}]}" module="${MODULE[${i}]}" http://git-wip-us.apache.org/repos/asf/yetus/blob/d49f2ff1/precommit/test-patch.sh ---------------------------------------------------------------------- diff --git a/precommit/test-patch.sh b/precommit/test-patch.sh index a71c299..bb98e69 100755 --- a/precommit/test-patch.sh +++ b/precommit/test-patch.sh @@ -1854,6 +1854,32 @@ function personality_enqueue_module ((MODCOUNT=MODCOUNT+1)) } +## @description Remove a module +## @audience public +## @stability evolving +## @replaceable no +## @param modulenames +function dequeue_personality_module +{ + declare modname=$1 + declare oldmodule=("${MODULE[@]}") + declare oldmodparams=("${MODULEESXTRAPARAM[@]}") + declare modindex=0 + + yetus_debug "Personality: dequeue $*" + + clear_personality_queue + + until [[ ${modindex} -eq ${#oldmodule[@]} ]]; do + if [[ "${oldmodule[${modindex}]}" = "${modname}" ]]; then + yetus_debug "Personality: removing ${modindex}, ${oldmodule[${modindex}]} = ${modname}" + else + personality_enqueue_module "${oldmodule[${modindex}]}" "${oldmodparams[${modindex}]}" + fi + ((modindex=modindex+1)) + done +} + ## @description Utility to push many tests into the failure list ## @audience private ## @stability evolving