yetus-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
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 GMT
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 <aajisaka@apache.org>


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 <aw@apache.org>
Authored: Mon Jan 11 13:58:34 2016 -0800
Committer: Allen Wittenauer <aw@apache.org>
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


Mime
View raw message