You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@yetus.apache.org by aw...@apache.org on 2016/04/17 19:14:49 UTC

[01/23] yetus git commit: YETUS-366. Wrapper script generated by build.sh doesn't work if the user is in the same location and executes it with a relative path [Forced Update!]

Repository: yetus
Updated Branches:
  refs/heads/YETUS-156 1341bc7d1 -> cbd3406d2 (forced update)


YETUS-366. Wrapper script generated by build.sh doesn't work if the user is in the same location and executes it with a relative path

Signed-off-by: Sean Busbey <bu...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/yetus/repo
Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/4ea61e23
Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/4ea61e23
Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/4ea61e23

Branch: refs/heads/YETUS-156
Commit: 4ea61e238ab0a2b77aa59efc7c319c5b40532295
Parents: c7cc9db
Author: Allen Wittenauer <aw...@apache.org>
Authored: Wed Apr 13 07:55:26 2016 -0700
Committer: Allen Wittenauer <aw...@apache.org>
Committed: Sun Apr 17 10:05:38 2016 -0700

----------------------------------------------------------------------
 build.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/yetus/blob/4ea61e23/build.sh
----------------------------------------------------------------------
diff --git a/build.sh b/build.sh
index ebf2872..8be3911 100755
--- a/build.sh
+++ b/build.sh
@@ -192,7 +192,7 @@ do
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-"\$(dirname "\$(dirname "\${BASH_SOURCE-0}")")/lib/${utility}" "\${@}"
+exec "\$(dirname -- "\${BASH_SOURCE-0}")/../lib/${utility}" "\${@}"
 EOF
   chmod +x "${bin_tarball}/bin/${wrapper}"
 done


[12/23] yetus git commit: YETUS-350. plug-in changes for build driver

Posted by aw...@apache.org.
YETUS-350. plug-in changes for build driver

Signed-off-by: Allen Wittenauer <aw...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/yetus/repo
Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/882b1b7c
Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/882b1b7c
Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/882b1b7c

Branch: refs/heads/YETUS-156
Commit: 882b1b7c35d8940e6768b1ffc9ef7073ed1468fb
Parents: 25b9f8c
Author: Allen Wittenauer <aw...@apache.org>
Authored: Tue Mar 29 16:57:57 2016 -0700
Committer: Allen Wittenauer <aw...@apache.org>
Committed: Sun Apr 17 10:14:34 2016 -0700

----------------------------------------------------------------------
 precommit/test-patch.d/asflicense.sh |  8 ++--
 precommit/test-patch.d/author.sh     | 74 +++++++++++++++++++++++++------
 precommit/test-patch.d/autoconf.sh   | 14 +++---
 precommit/test-patch.d/checkstyle.sh | 25 +++++------
 precommit/test-patch.d/cmake.sh      |  4 +-
 precommit/test-patch.d/findbugs.sh   | 15 ++++---
 precommit/test-patch.d/gradle.sh     |  4 +-
 precommit/test-patch.d/maven.sh      | 32 +++++++++----
 precommit/test-patch.d/perlcritic.sh |  8 ++--
 precommit/test-patch.d/pylint.sh     | 12 ++---
 precommit/test-patch.d/rubocop.sh    |  8 ++--
 precommit/test-patch.d/ruby-lint.sh  |  8 ++--
 precommit/test-patch.d/shellcheck.sh |  8 ++--
 precommit/test-patch.d/shelldocs.sh  |  8 ++--
 precommit/test-patch.d/test4tests.sh |  4 ++
 precommit/test-patch.d/whitespace.sh | 38 +++++++++++-----
 precommit/test-patch.d/xml.sh        |  6 +--
 17 files changed, 177 insertions(+), 99 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/yetus/blob/882b1b7c/precommit/test-patch.d/asflicense.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch.d/asflicense.sh b/precommit/test-patch.d/asflicense.sh
index edf7a7f..593e4af 100755
--- a/precommit/test-patch.d/asflicense.sh
+++ b/precommit/test-patch.d/asflicense.sh
@@ -61,7 +61,7 @@ function asflicense_tests
   local numpatch
   local btfails=true
 
-  big_console_header "Determining number of patched ASF License errors"
+  big_console_header "Determining number of ASF License errors"
 
   start_clock
 
@@ -105,7 +105,7 @@ function asflicense_tests
   # RAT fails the build if there are license problems.
   # so let's take advantage of that a bit.
   if [[ $? == 0 && ${btfails} = true ]]; then
-    add_vote_table 1 asflicense "Patch does not generate ASF License warnings."
+    add_vote_table 1 asflicense "${BUILDMODEMSG} does not generate ASF License warnings."
     return 0
   fi
 
@@ -134,7 +134,7 @@ function asflicense_tests
   echo "There appear to be ${numpatch} ASF License warnings after applying the patch."
   if [[ -n ${numpatch}
      && ${numpatch} -gt 0 ]] ; then
-    add_vote_table -1 asflicense "Patch generated ${numpatch} ASF License warnings."
+    add_vote_table -1 asflicense "${BUILDMODEMSG} generated ${numpatch} ASF License warnings."
 
     echo "Lines that start with ????? in the ASF License "\
         "report indicate files that do not have an Apache license header:" \
@@ -146,7 +146,7 @@ function asflicense_tests
     add_footer_table asflicense "@@BASE@@/patch-asflicense-problems.txt"
     return 1
   fi
-  add_vote_table 1 asflicense "Patch does not generate ASF License warnings."
+  add_vote_table 1 asflicense "${BUILDMODEMSG} does not generate ASF License warnings."
   return 0
 }
 

http://git-wip-us.apache.org/repos/asf/yetus/blob/882b1b7c/precommit/test-patch.d/author.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch.d/author.sh b/precommit/test-patch.d/author.sh
index 4497d03..2e148d8 100755
--- a/precommit/test-patch.d/author.sh
+++ b/precommit/test-patch.d/author.sh
@@ -16,21 +16,50 @@
 
 add_test_type author
 
-## @description  Check the current directory for @author tags
+## @description  helper function for @author tags check
 ## @audience     private
 ## @stability    evolving
 ## @replaceable  no
 ## @return       0 on success
 ## @return       1 on failure
+function author_generic
+{
+  declare authortags
+  declare i
+
+  # shellcheck disable=SC2016
+  authortags=$(wc -l "${PATCH_DIR}/author-tags.txt" | "${AWK}" '{print $1}')
+  echo "There appear to be ${authortags} @author tags in the patch."
+  if [[ ${authortags} != 0 ]] ; then
+    add_vote_table -1 @author \
+      "${BUILDMODEMSG} appears to contain ${authortags} @author tags which the" \
+      " community has agreed to not allow in code contributions."
+    add_footer_table @author "@@BASE@@/author-tags.txt"
+    return 1
+  fi
+  add_vote_table +1 @author "${BUILDMODEMSG} does not contain any @author tags."
+  return 0
+}
+
+## @description  Check the current patchfile for @author tags
+## @audience     private
+## @stability    evolving
+## @replaceable  no
+## @return       0 on success
+## @return       1 on failure
+## @param        patchfile
 function author_patchfile
 {
   declare patchfile=$1
-  declare authorTags
   # shellcheck disable=SC2155
   declare -r appname=$(basename "${BASH_SOURCE-$0}")
   declare i
 
-  big_console_header "Checking there are no @author tags in the patch."
+  if [[ "${BUILDMODE}" != patch ]]; then
+    return
+  fi
+
+  big_console_header "Checking for @author tags: ${BUILDMODE}"
 
   start_clock
 
@@ -43,16 +72,33 @@ function author_patchfile
   done
 
   ${GREP} -i -n '^[^-].*@author' "${patchfile}" >> "${PATCH_DIR}/author-tags.txt"
-  # shellcheck disable=SC2016
-  authorTags=$(wc -l "${PATCH_DIR}/author-tags.txt" | "${AWK}" '{print $1}')
-  echo "There appear to be ${authorTags} @author tags in the patch."
-  if [[ ${authorTags} != 0 ]] ; then
-    add_vote_table -1 @author \
-      "The patch appears to contain ${authorTags} @author tags which the" \
-      " community has agreed to not allow in code contributions."
-    add_footer_table @author "@@BASE@@/author-tags.txt"
-    return 1
+  author_generic
+}
+
+
+## @description  Check the current directory for @author tags
+## @audience     private
+## @stability    evolving
+## @replaceable  no
+## @return       0 on success
+## @return       1 on failure
+function author_postcompile
+{
+  # shellcheck disable=SC2155
+  declare -r appname=$(basename "${BASH_SOURCE-$0}")
+  declare i
+
+  if [[ "${BUILDMODE}" != full ]]; then
+    return
   fi
-  add_vote_table +1 @author "The patch does not contain any @author tags."
-  return 0
+
+  big_console_header "Checking for @author tags: ${BUILDMODE}"
+
+  start_clock
+
+  "${GIT}" grep -n -I --extended-regexp -i '^[^-].*@author' \
+    | ${GREP} -v "${appname}" \
+    >> "${PATCH_DIR}/author-tags.txt"
+
+  author_generic
 }

http://git-wip-us.apache.org/repos/asf/yetus/blob/882b1b7c/precommit/test-patch.d/autoconf.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch.d/autoconf.sh b/precommit/test-patch.d/autoconf.sh
index 2937e72..933a8c0 100755
--- a/precommit/test-patch.d/autoconf.sh
+++ b/precommit/test-patch.d/autoconf.sh
@@ -91,9 +91,9 @@ function autoconf_precompile
   fi
 
   if [[ "${repostatus}" = branch ]]; then
-    big_console_header "Pre-patch ${PATCH_BRANCH} autoconf verification"
+    big_console_header "autoconf verification: ${PATCH_BRANCH}"
   else
-    big_console_header "Patch autoconf verification"
+    big_console_header "autoconf verification: ${BUILDMODE}"
   fi
 
   personality_modules "${repostatus}" autoreconf
@@ -108,7 +108,7 @@ function autoconf_precompile
       # shellcheck disable=SC2153
       add_vote_table -1 autoreconf "${PATCH_BRANCH} unable to autoreconf"
     else
-      add_vote_table -1 autoreconf "${repostatus} unable to autoreconf"
+      add_vote_table -1 autoreconf "${BUILDMODEMSG} is unable to autoreconf"
     fi
     add_footer_table "autoreconf" "@@BASE@@/${repostatus}-autoconf-autoreconf"
     return 1
@@ -117,7 +117,7 @@ function autoconf_precompile
       # shellcheck disable=SC2153
       add_vote_table +1 autoreconf "${PATCH_BRANCH} autoreconf successful"
     else
-      add_vote_table +1 autoreconf "${repostatus} autoreconf successful"
+      add_vote_table +1 autoreconf "${BUILDMODEMSG} can autoreconf"
     fi
   fi
 
@@ -138,7 +138,7 @@ function autoconf_precompile
       # shellcheck disable=SC2153
       add_vote_table -1 configure "${PATCH_BRANCH} unable to configure"
     else
-      add_vote_table -1 configure "${repostatus} unable to configure"
+      add_vote_table -1 configure "${BUILDMODEMSG} is unable to configure"
     fi
     add_footer_table "configure" "@@BASE@@/${repostatus}-autoconf-configure"
     return 1
@@ -147,7 +147,7 @@ function autoconf_precompile
       # shellcheck disable=SC2153
       add_vote_table +1 configure "${PATCH_BRANCH} configure successful"
     else
-      add_vote_table +1 configure "${repostatus} configure successful"
+      add_vote_table +1 configure "${BUILDMODEMSG} can configure"
     fi
   fi
   return 0
@@ -201,4 +201,4 @@ function autoconf_builtin_personality_file_tests
   else
     make_builtin_personality_file_tests "${filename}"
   fi
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/yetus/blob/882b1b7c/precommit/test-patch.d/checkstyle.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch.d/checkstyle.sh b/precommit/test-patch.d/checkstyle.sh
index 4363e4d..bba3369 100755
--- a/precommit/test-patch.d/checkstyle.sh
+++ b/precommit/test-patch.d/checkstyle.sh
@@ -140,7 +140,6 @@ function checkstyle_runner
   declare savestop
   declare output
   declare logfile
-  declare repo
   declare modulesuffix
   declare cmd
   declare logline
@@ -151,12 +150,6 @@ function checkstyle_runner
   # first, let's clear out any previous run information
   modules_reset
 
-  if [[ ${repostatus} == branch ]]; then
-    repo=${PATCH_BRANCH}
-  else
-    repo="the patch"
-  fi
-
   # loop through the modules we've been given
   #shellcheck disable=SC2153
   until [[ $i -eq ${#MODULE[@]} ]]; do
@@ -200,14 +193,14 @@ function checkstyle_runner
       > "${tmp}"
 
     if [[ $? == 0 ]] ; then
-      module_status ${i} +1 "${logfile}" "${modulesuffix} in ${repo} passed checkstyle"
+      module_status ${i} +1 "${logfile}" "${BUILDMODEMSG} ${modulesuffix} passed checkstyle"
     else
-      module_status ${i} -1 "${logfile}" "${modulesuffix} in ${repo} failed checkstyle"
+      module_status ${i} -1 "${logfile}" "${BUILDMODEMSG} ${modulesuffix} failed checkstyle"
       ((result = result + 1))
     fi
 
     # if we have some output, we need to do more work:
-    if [[ -s ${tmp} ]]; then
+    if [[ -s ${tmp} && "${BUILDMODE}" = patch ]]; then
 
       # first, let's pull out all of the files that
       # we actually care about, esp since that run
@@ -219,6 +212,7 @@ 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...
 
@@ -248,7 +242,8 @@ function checkstyle_runner
       popd >/dev/null
       # later on, calcdiff will turn this into code(:column):error
       # compare, and then put the file:line back onto it.
-
+    else
+      cp -p "${tmp}" "${output}"
     fi
 
     rm "${tmp}" "${tmp}.1" 2>/dev/null
@@ -288,7 +283,7 @@ function checkstyle_preapply
     return 0
   fi
 
-  big_console_header "${PATCH_BRANCH} checkstyle"
+  big_console_header "checkstyle: ${PATCH_BRANCH}"
 
   start_clock
 
@@ -321,7 +316,7 @@ function checkstyle_postapply
     return 0
   fi
 
-  big_console_header "Patch checkstyle plugin"
+  big_console_header "checkstyle: ${BUILDMODE}"
 
   start_clock
 
@@ -371,9 +366,9 @@ function checkstyle_postapply
 
     if [[ ${addpatch} -gt 0 ]] ; then
       ((result = result + 1))
-      module_status ${i} -1 "diff-checkstyle-${fn}.txt" "${mod}: patch ${statstring}"
+      module_status ${i} -1 "diff-checkstyle-${fn}.txt" "${mod}: ${BUILDMODEMSG} ${statstring}"
     elif [[ ${fixedpatch} -gt 0 ]]; then
-      module_status ${i} +1 "diff-checkstyle-${fn}.txt" "${mod}: patch ${statstring}"
+      module_status ${i} +1 "diff-checkstyle-${fn}.txt" "${mod}: ${BUILDMODEMSG} ${statstring}"
       summarize=false
     fi
     ((i=i+1))

http://git-wip-us.apache.org/repos/asf/yetus/blob/882b1b7c/precommit/test-patch.d/cmake.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch.d/cmake.sh b/precommit/test-patch.d/cmake.sh
index 9b5f265..7e68a4d 100755
--- a/precommit/test-patch.d/cmake.sh
+++ b/precommit/test-patch.d/cmake.sh
@@ -128,9 +128,9 @@ function cmake_precompile
 
   if [[ "${repostatus}" = branch ]]; then
     # shellcheck disable=SC2153
-    big_console_header "${PATCH_BRANCH} cmake CMakeLists.txt"
+    big_console_header "cmake CMakeLists.txt: ${PATCH_BRANCH}"
   else
-    big_console_header "Patch cmake CMakeLists.txt"
+    big_console_header "cmake CMakeLists.txt: ${BUILDMODE}"
   fi
 
   personality_modules "${repostatus}" CMakeLists.txt

http://git-wip-us.apache.org/repos/asf/yetus/blob/882b1b7c/precommit/test-patch.d/findbugs.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch.d/findbugs.sh b/precommit/test-patch.d/findbugs.sh
index e4399fc..152d85f 100755
--- a/precommit/test-patch.d/findbugs.sh
+++ b/precommit/test-patch.d/findbugs.sh
@@ -95,10 +95,8 @@ function findbugs_precheck
 ## @audience     private
 ## @stability    evolving
 ## @replaceable  no
-## @param        repostatus
 function findbugs_maven_skipper
 {
-  declare repostat=$1
   declare -i i=0
   declare skiplist=()
   declare modname
@@ -122,7 +120,11 @@ function findbugs_maven_skipper
   done
 
   if [[ -n "${modname}" ]]; then
-    add_vote_table 0 findbugs "Skipped ${repostat} modules with no Java source: ${skiplist[*]}"
+    if [[ "${BUILDMODE}" = patch ]]; then
+      add_vote_table 0 findbugs "Skipped patched modules with no Java source: ${skiplist[*]}"
+    else
+      add_vote_table 0 findbugs "Skipped ${#skiplist[@]} modules in the source tree with no Java source."
+    fi
   fi
 }
 
@@ -132,6 +134,7 @@ function findbugs_maven_skipper
 ## @replaceable  no
 ## @return       0 on success
 ## @return       1 on failure
+## @param        repostatus
 function findbugs_runner
 {
   local name=$1
@@ -147,7 +150,7 @@ function findbugs_runner
   # 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}"
+    findbugs_maven_skipper
   fi
 
   "${BUILDTOOL}_modules_worker" "${name}" findbugs
@@ -248,7 +251,7 @@ function findbugs_preapply
     return 0
   fi
 
-  big_console_header "Pre-patch findbugs detection"
+  big_console_header "findbugs detection: ${PATCH_BRANCH}"
 
   findbugs_runner branch
   result=$?
@@ -329,7 +332,7 @@ function findbugs_postinstall
     return 0
   fi
 
-  big_console_header "Patch findbugs detection"
+  big_console_header "findbugs detection: ${BUILDMODE}"
 
   findbugs_runner patch
 

http://git-wip-us.apache.org/repos/asf/yetus/blob/882b1b7c/precommit/test-patch.d/gradle.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch.d/gradle.sh b/precommit/test-patch.d/gradle.sh
index 1f971fa..e809465 100755
--- a/precommit/test-patch.d/gradle.sh
+++ b/precommit/test-patch.d/gradle.sh
@@ -106,9 +106,9 @@ function gradle_precompile
 
   if [[ "${repostatus}" = branch ]]; then
     # shellcheck disable=SC2153
-    big_console_header "${PATCH_BRANCH} gradle bootstrap"
+    big_console_header "gradle boostrap: ${PATCH_BRANCH}"
   else
-    big_console_header "Patch gradle bootstrap"
+    big_console_header "gradle bootstrap: ${BUILDMODE}"
   fi
 
   personality_modules "${repostatus}" gradleboot

http://git-wip-us.apache.org/repos/asf/yetus/blob/882b1b7c/precommit/test-patch.d/maven.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch.d/maven.sh b/precommit/test-patch.d/maven.sh
index 1a2a86b..32f4b37 100755
--- a/precommit/test-patch.d/maven.sh
+++ b/precommit/test-patch.d/maven.sh
@@ -95,6 +95,11 @@ function maven_parse_args
 
 function maven_initialize
 {
+  if ! verify_command "maven" "${MAVEN}"; then
+    return 1
+  fi
+
+  # we need to do this before docker does it as root
 
   maven_add_install mvneclipse
   maven_add_install mvnsite
@@ -139,7 +144,7 @@ function maven_precheck
   fi
 
   if [[ ${MAVEN_CUSTOM_REPOS} = true ]]; then
-    MAVEN_LOCAL_REPO="${MAVEN_CUSTOM_REPOS_DIR}/${PROJECT_NAME}-${PATCH_BRANCH}-${INSTANCE}"
+    MAVEN_LOCAL_REPO="${MAVEN_CUSTOM_REPOS_DIR}/${PROJECT_NAME}-${PATCH_BRANCH}-${BUILDMODE}-${INSTANCE}"
     if [[ -e "${MAVEN_LOCAL_REPO}"
        && ! -d "${MAVEN_LOCAL_REPO}" ]]; then
       yetus_error "ERROR: ${MAVEN_LOCAL_REPO} is not a directory."
@@ -369,7 +374,8 @@ function maven_builtin_personality_modules
   # this always makes sure the local repo has a fresh
   # copy of everything per pom rules.
   if [[ ${repostatus} == branch
-        && ${testtype} == mvninstall ]];then
+        && ${testtype} == mvninstall ]] ||
+     [[ "${BUILDMODE}" = full ]];then
     personality_enqueue_module "${CHANGED_UNION_MODULES}"
     return
   fi
@@ -450,9 +456,9 @@ function mvnsite_postcompile
   fi
 
   if [[ "${repostatus}" = branch ]]; then
-    big_console_header "Pre-patch ${PATCH_BRANCH} maven site verification"
+    big_console_header "maven site verification: ${PATCH_BRANCH}"
   else
-    big_console_header "Patch maven site verification"
+    big_console_header "maven site verification: ${BUILDMODE}"
   fi
 
   personality_modules "${repostatus}" mvnsite
@@ -485,9 +491,9 @@ function mvneclipse_postcompile
   fi
 
   if [[ "${repostatus}" = branch ]]; then
-    big_console_header "Pre-patch ${PATCH_BRANCH} maven eclipse verification"
+    big_console_header "maven eclipse verification: ${PATCH_BRANCH}"
   else
-    big_console_header "Patch maven eclipse verification"
+    big_console_header "maven eclipse verification: ${BUILDMODE}"
   fi
 
   personality_modules "${repostatus}" mvneclipse
@@ -536,10 +542,14 @@ function maven_precompile
    return 0
   fi
 
+  if [[ "${BUILDMODE}" = Full ]]; then
+    return 0
+  fi
+
   if [[ "${repostatus}" = branch ]]; then
-    big_console_header "Pre-patch ${PATCH_BRANCH} maven install"
+    big_console_header "maven install: ${PATCH_BRANCH}"
   else
-    big_console_header "Patch maven install"
+    big_console_header "maven install: ${BUILDMODE}"
   fi
 
   personality_modules "${repostatus}" mvninstall
@@ -675,5 +685,9 @@ function maven_reorder_modules
   yetus_debug "Maven: finish re-ordering modules"
   yetus_debug "Finished list: ${CHANGED_MODULES[*]}"
 
-  add_vote_table 0 mvndep "Maven dependency ordering for ${repostatus}"
+  if [[ "${BUILDMODE}" = patch ]]; then
+    add_vote_table 0 mvndep "Maven dependency ordering for ${repostatus}"
+  else
+    add_vote_table 0 mvndep "Maven dependency ordering"
+  fi
 }

http://git-wip-us.apache.org/repos/asf/yetus/blob/882b1b7c/precommit/test-patch.d/perlcritic.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch.d/perlcritic.sh b/precommit/test-patch.d/perlcritic.sh
index 8297f46..b376347 100755
--- a/precommit/test-patch.d/perlcritic.sh
+++ b/precommit/test-patch.d/perlcritic.sh
@@ -64,7 +64,7 @@ function perlcritic_preapply
     return 0
   fi
 
-  big_console_header "Perl::Critic plugin: prepatch"
+  big_console_header "Perl::Critic plugin: ${PATCH_BRANCH}"
 
   start_clock
 
@@ -106,7 +106,7 @@ function perlcritic_postapply
     return 0
   fi
 
-  big_console_header "Perl::Critic plugin: postpatch"
+  big_console_header "Perl::Critic plugin: ${BUILDMODE}"
 
   start_clock
 
@@ -147,11 +147,11 @@ function perlcritic_postapply
   statstring=$(generic_calcdiff_status "${numPrepatch}" "${numPostpatch}" "${diffPostpatch}" )
 
   if [[ ${diffPostpatch} -gt 0 ]]; then
-    add_vote_table -1 perlcritic "The applied patch ${statstring}"
+    add_vote_table -1 perlcritic "${BUILDMODEMSG} ${statstring}"
     add_footer_table perlcritic "@@BASE@@/diff-patch-perlcritic.txt"
     return 1
   elif [[ ${fixedpatch} -gt 0 ]]; then
-    add_vote_table +1 perlcritic "The applied patch ${statstring}"
+    add_vote_table +1 perlcritic "${BUILDMODEMSG} ${statstring}"
     return 0
   fi
 

http://git-wip-us.apache.org/repos/asf/yetus/blob/882b1b7c/precommit/test-patch.d/pylint.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch.d/pylint.sh b/precommit/test-patch.d/pylint.sh
index 2a9e1f8..0f1790f 100755
--- a/precommit/test-patch.d/pylint.sh
+++ b/precommit/test-patch.d/pylint.sh
@@ -71,7 +71,7 @@ function pylint_preapply
     return 0
   fi
 
-  big_console_header "pylint plugin: prepatch"
+  big_console_header "pylint plugin: ${PATCH_BRANCH}"
 
   start_clock
 
@@ -87,7 +87,7 @@ function pylint_preapply
   if [[ -f ${PATCH_DIR}/${pylintStderr} ]]; then
     count=$(${GREP} -vc "^No config file found" "${PATCH_DIR}/${pylintStderr}")
     if [[ ${count} -gt 0 ]]; then
-      add_footer_table pylint "prepatch stderr: @@BASE@@/${pylintStderr}"
+      add_footer_table pylint "${PATCH_BRANCH} stderr: @@BASE@@/${pylintStderr}"
       return 1
     fi
   fi
@@ -113,7 +113,7 @@ function pylint_postapply
     return 0
   fi
 
-  big_console_header "pylint plugin: postpatch"
+  big_console_header "pylint plugin: ${BUILDMODE}"
 
   start_clock
 
@@ -135,7 +135,7 @@ function pylint_postapply
     count=$(${GREP} -vc "^No config file found" "${PATCH_DIR}/${pylintStderr}")
     if [[ ${count} -gt 0 ]]; then
       add_vote_table -1 pylint "Something bad seems to have happened in running pylint. Please check pylint stderr files."
-      add_footer_table pylint "postpatch stderr: @@BASE@@/${pylintStderr}"
+      add_footer_table pylint "${BUILDMODEMSG} stderr: @@BASE@@/${pylintStderr}"
       return 1
     fi
   fi
@@ -158,11 +158,11 @@ function pylint_postapply
   statstring=$(generic_calcdiff_status "${numPrepatch}" "${numPostpatch}" "${diffPostpatch}" )
 
   if [[ ${diffPostpatch} -gt 0 ]] ; then
-    add_vote_table -1 pylint "The applied patch ${statstring}"
+    add_vote_table -1 pylint "${BUILDMODEMSG} ${statstring}"
     add_footer_table pylint "@@BASE@@/diff-patch-pylint.txt"
     return 1
   elif [[ ${fixedpatch} -gt 0 ]]; then
-    add_vote_table +1 pylint "The applied patch ${statstring}"
+    add_vote_table +1 pylint "${BUILDMODEMSG} ${statstring}"
     return 0
   fi
 

http://git-wip-us.apache.org/repos/asf/yetus/blob/882b1b7c/precommit/test-patch.d/rubocop.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch.d/rubocop.sh b/precommit/test-patch.d/rubocop.sh
index 8e1d5b8..f73c073 100755
--- a/precommit/test-patch.d/rubocop.sh
+++ b/precommit/test-patch.d/rubocop.sh
@@ -64,7 +64,7 @@ function rubocop_preapply
     return 0
   fi
 
-  big_console_header "rubocop plugin: prepatch"
+  big_console_header "rubocop plugin: ${PATCH_BRANCH}"
 
   start_clock
 
@@ -106,7 +106,7 @@ function rubocop_postapply
     return 0
   fi
 
-  big_console_header "rubocop plugin: postpatch"
+  big_console_header "rubocop plugin: ${BUILDMODE}"
 
   start_clock
 
@@ -146,11 +146,11 @@ function rubocop_postapply
   statstring=$(generic_calcdiff_status "${numPrepatch}" "${numPostpatch}" "${diffPostpatch}" )
 
   if [[ ${diffPostpatch} -gt 0 ]] ; then
-    add_vote_table -1 rubocop "The applied patch ${statstring}"
+    add_vote_table -1 rubocop "${BUILDMODEMSG} ${statstring}"
     add_footer_table rubocop "@@BASE@@/diff-patch-rubocop.txt"
     return 1
   elif [[ ${fixedpatch} -gt 0 ]]; then
-    add_vote_table +1 rubocop "The applied patch ${statstring}"
+    add_vote_table +1 rubocop "${BUILDMODEMSG} ${statstring}"
     return 0
   fi
 

http://git-wip-us.apache.org/repos/asf/yetus/blob/882b1b7c/precommit/test-patch.d/ruby-lint.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch.d/ruby-lint.sh b/precommit/test-patch.d/ruby-lint.sh
index 94d4f53..c57887b 100755
--- a/precommit/test-patch.d/ruby-lint.sh
+++ b/precommit/test-patch.d/ruby-lint.sh
@@ -63,7 +63,7 @@ function ruby_lint_preapply
     return 0
   fi
 
-  big_console_header "ruby-lint plugin: prepatch"
+  big_console_header "ruby-lint plugin: ${PATCH_BRANCH}"
 
   start_clock
 
@@ -136,7 +136,7 @@ function ruby_lint_postapply
     return 0
   fi
 
-  big_console_header "ruby-lint plugin: postpatch"
+  big_console_header "ruby-lint plugin: ${BUILDMODE}"
 
   start_clock
 
@@ -176,11 +176,11 @@ function ruby_lint_postapply
   statstring=$(generic_calcdiff_status "${numPrepatch}" "${numPostpatch}" "${diffPostpatch}" )
 
   if [[ ${diffPostpatch} -gt 0 ]] ; then
-    add_vote_table -1 ruby-lint "The applied patch ${statstring}"
+    add_vote_table -1 ruby-lint "${BUILDMODEMSG} ${statstring}"
     add_footer_table ruby-lint "@@BASE@@/diff-patch-ruby-lint.txt"
     return 1
   elif [[ ${fixedpatch} -gt 0 ]]; then
-    add_vote_table +1 ruby-lint "The applied patch ${statstring}"
+    add_vote_table +1 ruby-lint "${BUILDMODEMSG} ${statstring}"
     return 0
   fi
 

http://git-wip-us.apache.org/repos/asf/yetus/blob/882b1b7c/precommit/test-patch.d/shellcheck.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch.d/shellcheck.sh b/precommit/test-patch.d/shellcheck.sh
index e9a7e15..0e053e3 100755
--- a/precommit/test-patch.d/shellcheck.sh
+++ b/precommit/test-patch.d/shellcheck.sh
@@ -106,7 +106,7 @@ function shellcheck_preapply
     return 0
   fi
 
-  big_console_header "shellcheck plugin: prepatch"
+  big_console_header "shellcheck plugin: ${PATCH_BRANCH}"
 
   start_clock
 
@@ -157,7 +157,7 @@ function shellcheck_postapply
     return 0
   fi
 
-  big_console_header "shellcheck plugin: postpatch"
+  big_console_header "shellcheck plugin: ${BUILDMODE}"
 
   start_clock
 
@@ -194,12 +194,12 @@ function shellcheck_postapply
   statstring=$(generic_calcdiff_status "${numPrepatch}" "${numPostpatch}" "${diffPostpatch}" )
 
   if [[ ${diffPostpatch} -gt 0 ]] ; then
-    add_vote_table -1 shellcheck "The applied patch ${statstring}"
+    add_vote_table -1 shellcheck "${BUILDMODEMSG} ${statstring}"
     add_footer_table shellcheck "@@BASE@@/diff-patch-shellcheck.txt"
     bugsystem_linecomments "shellcheck" "${PATCH_DIR}/diff-patch-shellcheck.txt"
     return 1
   elif [[ ${fixedpatch} -gt 0 ]]; then
-    add_vote_table +1 shellcheck "The applied patch ${statstring}"
+    add_vote_table +1 shellcheck "${BUILDMODEMSG} ${statstring}"
     return 0
   fi
 

http://git-wip-us.apache.org/repos/asf/yetus/blob/882b1b7c/precommit/test-patch.d/shelldocs.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch.d/shelldocs.sh b/precommit/test-patch.d/shelldocs.sh
index fea982a..d52fa6b 100755
--- a/precommit/test-patch.d/shelldocs.sh
+++ b/precommit/test-patch.d/shelldocs.sh
@@ -103,7 +103,7 @@ function shelldocs_preapply
     return 0
   fi
 
-  big_console_header "shelldocs plugin: prepatch"
+  big_console_header "shelldocs plugin: ${PATCH_BRANCH}"
 
   start_clock
 
@@ -134,7 +134,7 @@ function shelldocs_postapply
     return 0
   fi
 
-  big_console_header "shelldocs plugin: postpatch"
+  big_console_header "shelldocs plugin: ${BUILDMODE}"
 
   start_clock
 
@@ -170,12 +170,12 @@ function shelldocs_postapply
   statstring=$(generic_calcdiff_status "${numPrepatch}" "${numPostpatch}" "${diffPostpatch}" )
 
   if [[ ${diffPostpatch} -gt 0 ]] ; then
-    add_vote_table -1 shelldocs "The applied patch ${statstring}"
+    add_vote_table -1 shelldocs "${BUILDMODEMSG} ${statstring}"
     add_footer_table shelldocs "@@BASE@@/diff-patch-shelldocs.txt"
     bugsystem_linecomments "shelldocs" "${PATCH_DIR}/diff-patch-shelldocs.txt"
     return 1
   elif [[ ${fixedpatch} -gt 0 ]]; then
-    add_vote_table +1 shelldocs "The applied patch ${statstring}"
+    add_vote_table +1 shelldocs "${BUILDMODEMSG} ${statstring}"
     return 0
   fi
 

http://git-wip-us.apache.org/repos/asf/yetus/blob/882b1b7c/precommit/test-patch.d/test4tests.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch.d/test4tests.sh b/precommit/test-patch.d/test4tests.sh
index 644fbf9..6c3230c 100755
--- a/precommit/test-patch.d/test4tests.sh
+++ b/precommit/test-patch.d/test4tests.sh
@@ -27,6 +27,10 @@ function test4tests_patchfile
   declare testReferences=0
   declare i
 
+  if [[ "${BUILDMODE}" = full ]]; then
+    return
+  fi
+
   big_console_header "Checking there are new or changed tests in the patch."
 
   if ! verify_needed_test unit; then

http://git-wip-us.apache.org/repos/asf/yetus/blob/882b1b7c/precommit/test-patch.d/whitespace.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch.d/whitespace.sh b/precommit/test-patch.d/whitespace.sh
index a613d81..da0789b 100755
--- a/precommit/test-patch.d/whitespace.sh
+++ b/precommit/test-patch.d/whitespace.sh
@@ -49,21 +49,37 @@ function whitespace_postcompile
   start_clock
 
   pushd "${BASEDIR}" >/dev/null
-  # shellcheck disable=SC2016
-  ${AWK} '/\t/ {print $0}' \
-      "${GITDIFFCONTENT}" \
-    | ${GREP} -v Makefile: >> "${PATCH_DIR}/whitespace-tabs.txt"
 
-   ${GREP} -E '[[:blank:]]$' \
-     "${GITDIFFCONTENT}" \
-      >> "${PATCH_DIR}/whitespace-eol.txt"
+  case "${BUILDMODE}" in
+    patch)
+      # shellcheck disable=SC2016
+      ${AWK} '/\t/ {print $0}' \
+          "${GITDIFFCONTENT}" \
+        | ${GREP} -v Makefile: >> "${PATCH_DIR}/whitespace-tabs.txt"
+
+       ${GREP} -E '[[:blank:]]$' \
+         "${GITDIFFCONTENT}" \
+          >> "${PATCH_DIR}/whitespace-eol.txt"
+    ;;
+    full)
+      ${GIT} grep -n -I --extended-regexp '[[:blank:]]$' \
+         >> "${PATCH_DIR}/whitespace-eol.txt"
+      ${GIT} grep -n -I $'\t' \
+        | "${GREP}" -v Makefile \
+        >> "${PATCH_DIR}/whitespace-tabs.txt"
+    ;;
+  esac
 
   # shellcheck disable=SC2016
   count=$(wc -l "${PATCH_DIR}/whitespace-eol.txt" | ${AWK} '{print $1}')
 
   if [[ ${count} -gt 0 ]]; then
-    add_vote_table -1 whitespace "The patch has ${count}"\
-      " line(s) that end in whitespace. Use git apply --whitespace=fix."
+    if [[ "${BUILDMODE}" = full ]]; then
+      add_vote_table -1 whitespace "${BUILDMODEMSG} has ${count} line(s) that end in whitespace."
+    else
+      add_vote_table -1 whitespace \
+        "${BUILDMODEMSG} has ${count} line(s) that end in whitespace. Use git apply --whitespace=fix."
+    fi
 
     whitespace_linecomment_reporter "${PATCH_DIR}/whitespace-eol.txt" "end of line"
     add_footer_table whitespace "@@BASE@@/whitespace-eol.txt"
@@ -74,7 +90,7 @@ function whitespace_postcompile
   count=$(wc -l "${PATCH_DIR}/whitespace-tabs.txt" | ${AWK} '{print $1}')
 
   if [[ ${count} -gt 0 ]]; then
-    add_vote_table -1 whitespace "The patch has ${count}"\
+    add_vote_table -1 whitespace "${BUILDMODEMSG} ${count}"\
       " line(s) with tabs."
     add_footer_table whitespace "@@BASE@@/whitespace-tabs.txt"
     whitespace_linecomment_reporter "${PATCH_DIR}/whitespace-tabs.txt" "tabs in line"
@@ -87,6 +103,6 @@ function whitespace_postcompile
   fi
 
   popd >/dev/null
-  add_vote_table +1 whitespace "Patch has no whitespace issues."
+  add_vote_table +1 whitespace "${BUILDMODEMSG} has no whitespace issues."
   return 0
 }

http://git-wip-us.apache.org/repos/asf/yetus/blob/882b1b7c/precommit/test-patch.d/xml.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch.d/xml.sh b/precommit/test-patch.d/xml.sh
index 08e0a61..6460522 100755
--- a/precommit/test-patch.d/xml.sh
+++ b/precommit/test-patch.d/xml.sh
@@ -48,7 +48,7 @@ function xml_postcompile
     return 0
   fi
 
-  big_console_header "Checking if XML files are well-formed"
+  big_console_header "XML verification: ${BUILDMODE}"
 
   js="${JAVA_HOME}/bin/jrunscript"
 
@@ -65,13 +65,13 @@ function xml_postcompile
   done
 
   if [[ ${count} -gt 0 ]]; then
-    add_vote_table -1 xml "The patch has ${count} ill-formed XML file(s)."
+    add_vote_table -1 xml "${BUILDMODEMSG} has ${count} ill-formed XML file(s)."
     add_footer_table xml "@@BASE@@/xml.txt"
     popd >/dev/null
     return 1
   fi
 
   popd >/dev/null
-  add_vote_table +1 xml "The patch has no ill-formed XML file."
+  add_vote_table +1 xml "${BUILDMODEMSG} has no ill-formed XML file."
   return 0
 }


[04/23] yetus git commit: YETUS-289. shelldocs should output error positions in lint mode

Posted by aw...@apache.org.
YETUS-289. shelldocs should output error positions in lint mode

Signed-off-by: Sean Busbey <bu...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/yetus/repo
Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/585e97d4
Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/585e97d4
Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/585e97d4

Branch: refs/heads/YETUS-156
Commit: 585e97d45a86991e23b83ea32216d4b4b50fac60
Parents: 9f0f3d8
Author: Allen Wittenauer <aw...@apache.org>
Authored: Thu Apr 14 10:08:16 2016 -0700
Committer: Allen Wittenauer <aw...@apache.org>
Committed: Sun Apr 17 10:08:15 2016 -0700

----------------------------------------------------------------------
 precommit/personality/accumulo.sh |  8 ++++++
 precommit/personality/bigtop.sh   | 43 +++--------------------------
 precommit/personality/drill.sh    |  3 +++
 precommit/personality/flink.sh    |  3 +++
 precommit/personality/geode.sh    |  3 +++
 precommit/personality/hadoop.sh   | 27 +++++++++++++++++++
 precommit/personality/hbase.sh    |  8 ++++++
 precommit/personality/jmeter.sh   | 10 +++++++
 precommit/personality/kafka.sh    |  8 ++++++
 precommit/personality/orc.sh      |  3 +++
 precommit/personality/pig.sh      |  8 ++++++
 precommit/personality/samza.sh    |  4 ++-
 precommit/personality/tajo.sh     |  3 +++
 precommit/personality/tez.sh      |  3 +++
 shelldocs/shelldocs.py            | 49 +++++++++++++++++++++++++---------
 15 files changed, 130 insertions(+), 53 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/yetus/blob/585e97d4/precommit/personality/accumulo.sh
----------------------------------------------------------------------
diff --git a/precommit/personality/accumulo.sh b/precommit/personality/accumulo.sh
index de1b890..d99bf82 100755
--- a/precommit/personality/accumulo.sh
+++ b/precommit/personality/accumulo.sh
@@ -17,6 +17,9 @@
 # Run all plugins
 personality_plugins "all"
 
+## @description  Globals specific to this personality
+## @audience     private
+## @stability    evolving
 function personality_globals
 {
   #shellcheck disable=SC2034
@@ -33,6 +36,11 @@ function personality_globals
   CHECKSTYLE_GOAL="check"
 }
 
+## @description  Queue up modules for this personality
+## @audience     private
+## @stability    evolving
+## @param        repostatus
+## @param        testtype
 function personality_modules
 {
   local repostatus=$1

http://git-wip-us.apache.org/repos/asf/yetus/blob/585e97d4/precommit/personality/bigtop.sh
----------------------------------------------------------------------
diff --git a/precommit/personality/bigtop.sh b/precommit/personality/bigtop.sh
index 039618b..c374289 100755
--- a/precommit/personality/bigtop.sh
+++ b/precommit/personality/bigtop.sh
@@ -16,6 +16,9 @@
 
 personality_plugins "all,-checkstyle,-findbugs"
 
+## @description  Globals specific to this personality
+## @audience     private
+## @stability    evolving
 function personality_globals
 {
   # shellcheck disable=SC2034
@@ -26,44 +29,4 @@ function personality_globals
   BUILDTOOL=gradle
   # shellcheck disable=SC2034
   GITHUB_REPO="apache/bigtop"
-  # shellcheck disable=SC2034
-  BIGTOP_PUPPETSETUP=false
-}
-
-add_test_type bigtop
-
-function bigtop_usage
-{
-  yetus_add_option "--bigtop-puppet=[false|true]" "execute the bigtop puppet setup (needs sudo to root)"
-}
-
-function bigtop_parse_args
-{
-  local i
-
-  for i in "$@"; do
-    case ${i} in
-      --bigtop-puppet=*)
-        BIGTOP_PUPPETSETUP=${i#*=}
-      ;;
-    esac
-  done
-}
-
-function bigtop_precheck_postinstall
-{
-  if [[ ${BIGTOP_PUPPETSETUP} = "true" ]]; then
-    pushd "${BASEDIR}" >/dev/null
-    echo_and_redirect "${PATCH_DIR}/bigtop-branch-toolchain.txt" "${GRADLEW}" toolchain
-    popd >/dev/null
-  fi
-}
-
-function bigtop_postapply_postinstall
-{
-  if [[ ${BIGTOP_PUPPETSETUP} = "true" ]]; then
-    pushd "${BASEDIR}" >/dev/null
-    echo_and_redirect "${PATCH_DIR}/bigtop-patch-toolchain.txt" "${GRADLEW}" toolchain
-    popd >/dev/null
-  fi
 }

http://git-wip-us.apache.org/repos/asf/yetus/blob/585e97d4/precommit/personality/drill.sh
----------------------------------------------------------------------
diff --git a/precommit/personality/drill.sh b/precommit/personality/drill.sh
index 48fcb2e..b58ed07 100755
--- a/precommit/personality/drill.sh
+++ b/precommit/personality/drill.sh
@@ -16,6 +16,9 @@
 
 personality_plugins "all"
 
+## @description  Globals specific to this personality
+## @audience     private
+## @stability    evolving
 function personality_globals
 {
   #shellcheck disable=SC2034

http://git-wip-us.apache.org/repos/asf/yetus/blob/585e97d4/precommit/personality/flink.sh
----------------------------------------------------------------------
diff --git a/precommit/personality/flink.sh b/precommit/personality/flink.sh
index 8a077ac..6b4f0a8 100755
--- a/precommit/personality/flink.sh
+++ b/precommit/personality/flink.sh
@@ -16,6 +16,9 @@
 
 personality_plugins "all"
 
+## @description  Globals specific to this personality
+## @audience     private
+## @stability    evolving
 function personality_globals
 {
   #shellcheck disable=SC2034

http://git-wip-us.apache.org/repos/asf/yetus/blob/585e97d4/precommit/personality/geode.sh
----------------------------------------------------------------------
diff --git a/precommit/personality/geode.sh b/precommit/personality/geode.sh
index f345fe8..9f5c0ec 100755
--- a/precommit/personality/geode.sh
+++ b/precommit/personality/geode.sh
@@ -16,6 +16,9 @@
 
 personality_plugins "all,-ant,-javac,-scalac,-scaladoc"
 
+## @description  Globals specific to this personality
+## @audience     private
+## @stability    evolving
 function personality_globals
 {
   #shellcheck disable=SC2034

http://git-wip-us.apache.org/repos/asf/yetus/blob/585e97d4/precommit/personality/hadoop.sh
----------------------------------------------------------------------
diff --git a/precommit/personality/hadoop.sh b/precommit/personality/hadoop.sh
index 02df4b1..59dfd2c 100755
--- a/precommit/personality/hadoop.sh
+++ b/precommit/personality/hadoop.sh
@@ -18,6 +18,9 @@
 
 personality_plugins "all,-ant,-gradle,-scalac,-scaladoc"
 
+## @description  Globals specific to this personality
+## @audience     private
+## @stability    evolving
 function personality_globals
 {
   #shellcheck disable=SC2034
@@ -32,6 +35,10 @@ function personality_globals
   PYLINT_OPTIONS="--indent-string='  '"
 }
 
+## @description  Calculate the actual module ordering
+## @audience     private
+## @stability    evolving
+## @param        ordering
 function hadoop_order
 {
   declare ordering=$1
@@ -47,6 +54,10 @@ function hadoop_order
   echo "${hadoopm}"
 }
 
+## @description  Install extra modules for unit tests
+## @audience     private
+## @stability    evolving
+## @param        ordering
 function hadoop_unittest_prereqs
 {
   declare input=$1
@@ -88,6 +99,10 @@ function hadoop_unittest_prereqs
   fi
 }
 
+## @description  Calculate the flags/settings for native code
+## @description  based upon the OS
+## @audience     private
+## @stability    evolving
 function hadoop_native_flags
 {
 
@@ -137,6 +152,11 @@ function hadoop_native_flags
   esac
 }
 
+## @description  Queue up modules for this personality
+## @audience     private
+## @stability    evolving
+## @param        repostatus
+## @param        testtype
 function personality_modules
 {
   declare repostatus=$1
@@ -269,6 +289,10 @@ function personality_modules
   done
 }
 
+## @description  Add tests based upon personality needs
+## @audience     private
+## @stability    evolving
+## @param        filename
 function personality_file_tests
 {
   declare filename=$1
@@ -332,6 +356,9 @@ function personality_file_tests
   fi
 }
 
+## @description  Image to print on success
+## @audience     private
+## @stability    evolving
 function hadoop_console_success
 {
   printf "IF9fX19fX19fX18gCjwgU3VjY2VzcyEgPgogLS0tLS0tLS0tLSAKIFwgICAg";

http://git-wip-us.apache.org/repos/asf/yetus/blob/585e97d4/precommit/personality/hbase.sh
----------------------------------------------------------------------
diff --git a/precommit/personality/hbase.sh b/precommit/personality/hbase.sh
index 7863bb2..352d2e3 100755
--- a/precommit/personality/hbase.sh
+++ b/precommit/personality/hbase.sh
@@ -16,6 +16,9 @@
 
 personality_plugins "all"
 
+## @description  Globals specific to this personality
+## @audience     private
+## @stability    evolving
 function personality_globals
 {
   #shellcheck disable=SC2034
@@ -32,6 +35,11 @@ function personality_globals
   MAVEN_OPTS="${MAVEN_OPTS:-"-Xmx3100M"}"
 }
 
+## @description  Queue up modules for this personality
+## @audience     private
+## @stability    evolving
+## @param        repostatus
+## @param        testtype
 function personality_modules
 {
   local repostatus=$1

http://git-wip-us.apache.org/repos/asf/yetus/blob/585e97d4/precommit/personality/jmeter.sh
----------------------------------------------------------------------
diff --git a/precommit/personality/jmeter.sh b/precommit/personality/jmeter.sh
index a9da710..194fc4f 100755
--- a/precommit/personality/jmeter.sh
+++ b/precommit/personality/jmeter.sh
@@ -16,6 +16,9 @@
 
 personality_plugins "all,-javadoc,-findbugs,-asflicense"
 
+## @description  Globals specific to this personality
+## @audience     private
+## @stability    evolving
 function personality_globals
 {
   # shellcheck disable=SC2034
@@ -30,11 +33,18 @@ function personality_globals
 
 add_test_type jmeter
 
+## @description  Personality usage options
+## @audience     private
+## @stability    evolving
 function jmeter_usage
 {
   yetus_add_option "--jmeter-download-jars=<bool>"  "download third-party jars needed by ant build"
 }
 
+## @description  Process personality options
+## @audience     private
+## @stability    evolving
+## @param        arguments
 function jmeter_parse_args
 {
   declare i

http://git-wip-us.apache.org/repos/asf/yetus/blob/585e97d4/precommit/personality/kafka.sh
----------------------------------------------------------------------
diff --git a/precommit/personality/kafka.sh b/precommit/personality/kafka.sh
index 8d866c9..0c2f749 100755
--- a/precommit/personality/kafka.sh
+++ b/precommit/personality/kafka.sh
@@ -16,6 +16,9 @@
 
 personality_plugins "all,-checkstyle,-asflicense"
 
+## @description  Globals specific to this personality
+## @audience     private
+## @stability    evolving
 function personality_globals
 {
   #shellcheck disable=SC2034
@@ -30,6 +33,11 @@ function personality_globals
   GITHUB_REPO="apache/kafka"
 }
 
+## @description  Queue up modules for this personality
+## @audience     private
+## @stability    evolving
+## @param        repostatus
+## @param        testtype
 function personality_modules
 {
   declare repostatus=$1

http://git-wip-us.apache.org/repos/asf/yetus/blob/585e97d4/precommit/personality/orc.sh
----------------------------------------------------------------------
diff --git a/precommit/personality/orc.sh b/precommit/personality/orc.sh
index b4fda31..0582b17 100755
--- a/precommit/personality/orc.sh
+++ b/precommit/personality/orc.sh
@@ -16,6 +16,9 @@
 
 personality_plugins "all,-checkstyle,-findbugs"
 
+## @description  Globals specific to this personality
+## @audience     private
+## @stability    evolving
 function personality_globals
 {
   #shellcheck disable=SC2034

http://git-wip-us.apache.org/repos/asf/yetus/blob/585e97d4/precommit/personality/pig.sh
----------------------------------------------------------------------
diff --git a/precommit/personality/pig.sh b/precommit/personality/pig.sh
index 639df01..2014fda 100755
--- a/precommit/personality/pig.sh
+++ b/precommit/personality/pig.sh
@@ -16,6 +16,9 @@
 
 personality_plugins "all"
 
+## @description  Globals specific to this personality
+## @audience     private
+## @stability    evolving
 function personality_globals
 {
   #shellcheck disable=SC2034
@@ -28,6 +31,11 @@ function personality_globals
   BUILDTOOL=ant
 }
 
+## @description  Queue up modules for this personality
+## @audience     private
+## @stability    evolving
+## @param        repostatus
+## @param        testtype
 function personality_modules
 {
   local repostatus=$1

http://git-wip-us.apache.org/repos/asf/yetus/blob/585e97d4/precommit/personality/samza.sh
----------------------------------------------------------------------
diff --git a/precommit/personality/samza.sh b/precommit/personality/samza.sh
index e649106..430ffbb 100755
--- a/precommit/personality/samza.sh
+++ b/precommit/personality/samza.sh
@@ -14,9 +14,11 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-
 personality_plugins "all,-checkstyle"
 
+## @description  Globals specific to this personality
+## @audience     private
+## @stability    evolving
 function personality_globals
 {
   #shellcheck disable=SC2034

http://git-wip-us.apache.org/repos/asf/yetus/blob/585e97d4/precommit/personality/tajo.sh
----------------------------------------------------------------------
diff --git a/precommit/personality/tajo.sh b/precommit/personality/tajo.sh
index ffe580a..32b4242 100755
--- a/precommit/personality/tajo.sh
+++ b/precommit/personality/tajo.sh
@@ -16,6 +16,9 @@
 
 personality_plugins "all"
 
+## @description  Globals specific to this personality
+## @audience     private
+## @stability    evolving
 function personality_globals
 {
   #shellcheck disable=SC2034

http://git-wip-us.apache.org/repos/asf/yetus/blob/585e97d4/precommit/personality/tez.sh
----------------------------------------------------------------------
diff --git a/precommit/personality/tez.sh b/precommit/personality/tez.sh
index 91ea0e5..4b0e3ec 100755
--- a/precommit/personality/tez.sh
+++ b/precommit/personality/tez.sh
@@ -16,6 +16,9 @@
 
 personality_plugins "all"
 
+## @description  Globals specific to this personality
+## @audience     private
+## @stability    evolving
 function personality_globals
 {
   #shellcheck disable=SC2034

http://git-wip-us.apache.org/repos/asf/yetus/blob/585e97d4/shelldocs/shelldocs.py
----------------------------------------------------------------------
diff --git a/shelldocs/shelldocs.py b/shelldocs/shelldocs.py
index e575add..70d486c 100755
--- a/shelldocs/shelldocs.py
+++ b/shelldocs/shelldocs.py
@@ -66,7 +66,8 @@ def toc(tlist):
 
 class ShellFunction(object):
     """a shell function"""
-    def __init__(self):
+
+    def __init__(self, filename):
         '''Initializer'''
         self.name = None
         self.audience = None
@@ -75,6 +76,8 @@ class ShellFunction(object):
         self.returnt = None
         self.desc = None
         self.params = None
+        self.filename = filename
+        self.linenum = 0
 
     def __cmp__(self, other):
         '''comparison'''
@@ -102,6 +105,15 @@ class ShellFunction(object):
         self.returnt = None
         self.desc = None
         self.params = None
+        self.linenum = 0
+        self.filename = None
+
+    def getfilename(self):
+        '''get the name of the function'''
+        if self.filename is None:
+            return "undefined"
+        else:
+            return self.filename
 
     def setname(self, text):
         '''set the name of the function'''
@@ -115,6 +127,14 @@ class ShellFunction(object):
         else:
             return self.name
 
+    def setlinenum(self, linenum):
+        '''set the line number of the function'''
+        self.linenum = linenum
+
+    def getlinenum(self):
+        '''get the line number of the function'''
+        return self.linenum
+
     def setaudience(self, text):
         '''set the audience of the function'''
         self.audience = docstrip("audience", text)
@@ -249,13 +269,15 @@ class ShellFunction(object):
         for attr in ("audience", "stability", "replaceable"):
             value = getfuncs[attr]()
             if value == "None":
-                messages.append("ERROR: function %s has no @%s" %
-                                (self.getname(), attr.lower()))
+                messages.append("%s:%u: ERROR: function %s has no @%s" %
+                                (self.getfilename(), self.getlinenum(),
+                                 self.getname(), attr.lower()))
             elif value not in validvalues[attr]:
                 validvalue = "|".join(v.lower() for v in validvalues[attr])
                 messages.append(
-                    "ERROR: function %s has invalid value (%s) for @%s (%s)" %
-                    (self.getname(), value.lower(), attr.lower(), validvalue))
+                    "%s:%u: ERROR: function %s has invalid value (%s) for @%s (%s)"
+                    % (self.getfilename(), self.getlinenum(), self.getname(),
+                       value.lower(), attr.lower(), validvalue))
         return "\n".join(messages)
 
     def __str__(self):
@@ -271,8 +293,8 @@ class ShellFunction(object):
 def main():
     '''main entry point'''
     parser = OptionParser(
-        usage=
-        "usage: %prog [--skipprnorep] --output OUTFILE --input INFILE [--input INFILE ...]")
+        usage="usage: %prog [--skipprnorep] " + "[--output OUTFILE|--lint] " +
+        "--input INFILE " + "[--input INFILE ...]")
     parser.add_option("-o",
                       "--output",
                       dest="outfile",
@@ -303,12 +325,12 @@ def main():
         default=False,
         help="display version information for shelldocs and exit.")
 
-    (options, args) = parser.parse_args()
+    (options, dummy_args) = parser.parse_args()
 
     if options.release_version:
         with open(
-            os.path.join(
-                os.path.dirname(__file__), "../VERSION"), 'r') as ver_file:
+                os.path.join(
+                    os.path.dirname(__file__), "../VERSION"), 'r') as ver_file:
             print ver_file.read()
         sys.exit(0)
 
@@ -322,8 +344,10 @@ def main():
     try:
         for filename in options.infile:
             with open(filename, "r") as shellcode:
-                funcdef = ShellFunction()
+                funcdef = ShellFunction(filename)
+                linenum = 0
                 for line in shellcode:
+                    linenum = linenum + 1
                     if line.startswith('## @description'):
                         funcdef.adddesc(line)
                     elif line.startswith('## @audience'):
@@ -338,13 +362,14 @@ def main():
                         funcdef.addreturn(line)
                     elif line.startswith('function'):
                         funcdef.setname(line)
+                        funcdef.setlinenum(linenum)
                         if options.skipprnorep and \
                           funcdef.getaudience() == "Private" and \
                           funcdef.getreplace() == "No":
                             pass
                         else:
                             allfuncs.append(funcdef)
-                        funcdef = ShellFunction()
+                        funcdef = ShellFunction(filename)
     except IOError, err:
         print >> sys.stderr, "ERROR: Failed to read from file: %s. Aborting." % err.filename
         sys.exit(1)


[16/23] yetus git commit: YETUS-375. build driver: maven install actually needs to be dumber

Posted by aw...@apache.org.
YETUS-375. build driver: maven install actually needs to be dumber

Signed-off-by: Allen Wittenauer <aw...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/yetus/repo
Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/779945e1
Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/779945e1
Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/779945e1

Branch: refs/heads/YETUS-156
Commit: 779945e1a2ddecb65b8c81965c62cf0b72a3d73d
Parents: a254ac9
Author: Allen Wittenauer <aw...@apache.org>
Authored: Wed Apr 13 06:56:58 2016 -0700
Committer: Allen Wittenauer <aw...@apache.org>
Committed: Sun Apr 17 10:14:34 2016 -0700

----------------------------------------------------------------------
 precommit/test-patch.d/maven.sh | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/yetus/blob/779945e1/precommit/test-patch.d/maven.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch.d/maven.sh b/precommit/test-patch.d/maven.sh
index d65aeaa..3d37c37 100755
--- a/precommit/test-patch.d/maven.sh
+++ b/precommit/test-patch.d/maven.sh
@@ -523,14 +523,7 @@ function maven_precompile
   fi
 
   if verify_needed_test javac; then
-    # if we are in full build mode, then
-    # there is no need to do an initial install
-    # since we will be doing a full compile from basedir
-    # for projects like hadoop, this saves quite a bit
-    # of time
-    if [[ "${BUILDMODE}" = patch ]]; then
-      need=true
-    fi
+    need=true
   else
     # not everything needs a maven install
     # but quite a few do ...


[13/23] yetus git commit: YETUS-348. add ability to write console report to a file

Posted by aw...@apache.org.
YETUS-348. add ability to write console report to a file

Signed-off-by: Allen Wittenauer <aw...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/yetus/repo
Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/02081d05
Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/02081d05
Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/02081d05

Branch: refs/heads/YETUS-156
Commit: 02081d05aa93a36b452972cb646957fda3f3234a
Parents: dde4962
Author: Allen Wittenauer <aw...@apache.org>
Authored: Tue Mar 29 15:23:33 2016 -0700
Committer: Allen Wittenauer <aw...@apache.org>
Committed: Sun Apr 17 10:14:34 2016 -0700

----------------------------------------------------------------------
 precommit/core.d/00-yetuslib.sh                 |  2 +-
 precommit/core.d/builtin-bugsystem.sh           | 10 ++++++++++
 precommit/core.d/docker.sh                      |  5 +++++
 .../test-patch-docker/launch-test-patch.sh      |  4 ++++
 precommit/test-patch.sh                         | 20 +++++++++++++++++---
 5 files changed, 37 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/yetus/blob/02081d05/precommit/core.d/00-yetuslib.sh
----------------------------------------------------------------------
diff --git a/precommit/core.d/00-yetuslib.sh b/precommit/core.d/00-yetuslib.sh
index 90ffa16..25118cb 100755
--- a/precommit/core.d/00-yetuslib.sh
+++ b/precommit/core.d/00-yetuslib.sh
@@ -101,7 +101,7 @@ function yetus_run_and_redirect
 ## @description  Given a filename or dir, return the absolute version of it
 ## @audience     public
 ## @stability    stable
-## @param        directory
+## @param        fsobj
 ## @replaceable  no
 ## @return       0 success
 ## @return       1 failure

http://git-wip-us.apache.org/repos/asf/yetus/blob/02081d05/precommit/core.d/builtin-bugsystem.sh
----------------------------------------------------------------------
diff --git a/precommit/core.d/builtin-bugsystem.sh b/precommit/core.d/builtin-bugsystem.sh
index f83e7c9..c7d9a6c 100755
--- a/precommit/core.d/builtin-bugsystem.sh
+++ b/precommit/core.d/builtin-bugsystem.sh
@@ -45,6 +45,11 @@ function console_finalreport
   declare seccoladj=0
   declare spcfx=${PATCH_DIR}/spcl.txt
 
+  if [[ -n "${CONSOLE_REPORT_FILE}" ]]; then
+    exec 6>&1
+    exec >"${CONSOLE_REPORT_FILE}"
+  fi
+
   if [[ ${result} == 0 ]]; then
     if [[ ${ROBOT} == false ]]; then
       if declare -f ${PROJECT_NAME}_console_success >/dev/null; then
@@ -154,4 +159,9 @@ function console_finalreport
     printf "%s\n" "${comment}"
     ((i=i+1))
   done
+
+  if [[ -n "${CONSOLE_REPORT_FILE}" ]]; then
+    exec 1>&6 6>&-
+    cat "${CONSOLE_REPORT_FILE}"
+  fi
 }

http://git-wip-us.apache.org/repos/asf/yetus/blob/02081d05/precommit/core.d/docker.sh
----------------------------------------------------------------------
diff --git a/precommit/core.d/docker.sh b/precommit/core.d/docker.sh
index 2d7f550..062c8c1 100755
--- a/precommit/core.d/docker.sh
+++ b/precommit/core.d/docker.sh
@@ -570,6 +570,11 @@ PatchSpecificDocker
     DOCKER_EXTRAARGS=("--privileged" "${DOCKER_EXTRAARGS[@]}")
   fi
 
+  if [[ -n "${CONSOLE_REPORT_FILE}" ]]; then
+    touch "${CONSOLE_REPORT_FILE}"
+    DOCKER_EXTRAARGS=("${DOCKER_EXTRAARGS[@]}" "-v" "${CONSOLE_REPORT_FILE}:/testptch/console.txt")
+  fi
+
   client=$(docker_version Client)
   server=$(docker_version Server)
 

http://git-wip-us.apache.org/repos/asf/yetus/blob/02081d05/precommit/test-patch-docker/launch-test-patch.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch-docker/launch-test-patch.sh b/precommit/test-patch-docker/launch-test-patch.sh
index a7b040c..d54c502 100755
--- a/precommit/test-patch-docker/launch-test-patch.sh
+++ b/precommit/test-patch-docker/launch-test-patch.sh
@@ -57,6 +57,10 @@ if [[ "${PATCH_SYSTEM}" = generic ]]; then
   OVERWRITEARGS=("${OVERWRITEARGS[@]}" "/testptch/extras/patch")
 fi
 
+if [[ -f /testptch/console.txt ]]; then
+  OVERWRITEARGS=("${OVERWRITEARGS[@]}" "--console-report-file=/testptch/console.txt")
+fi
+
 cd "${PATCH_DIR}/precommit/"
 #shellcheck disable=SC2086
 "${PATCH_DIR}/precommit/test-patch.sh" \

http://git-wip-us.apache.org/repos/asf/yetus/blob/02081d05/precommit/test-patch.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch.sh b/precommit/test-patch.sh
index 0260c59..a55bb05 100755
--- a/precommit/test-patch.sh
+++ b/precommit/test-patch.sh
@@ -651,7 +651,6 @@ function relative_dir
 ## @replaceable  no
 function yetus_usage
 {
-
   declare bugsys
   declare jdktlist
 
@@ -725,6 +724,7 @@ function yetus_usage
   yetus_add_option "--build-url=<url>" "Set the build location web page (Default: '${BUILD_URL}')"
   yetus_add_option "--build-url-console=<location>" "Location relative to --build-url of the console (Default: '${BUILD_URL_CONSOLE}')"
   yetus_add_option "--build-url-patchdir=<location>" "Location relative to --build-url of the --patch-dir (Default: '${BUILD_URL_ARTIFACTS}')"
+  yetus_add_option "--console-report-file=<file>" "Save the final console-based report to a file in addition to the screen"
   yetus_add_option "--console-urls" "Use the build URL instead of path on the console report"
   yetus_add_option "--instance=<string>" "Parallel execution identifier string"
   yetus_add_option "--jenkins" "Enable Jenkins-specifc handling (auto: --robot)"
@@ -789,6 +789,9 @@ function parse_args
         # shellcheck disable=SC2034
         BUILD_URL_CONSOLE=${i#*=}
       ;;
+      --console-report-file=*)
+        CONSOLE_REPORT_FILE=${i#*=}
+      ;;
       --console-urls)
         # shellcheck disable=SC2034
         CONSOLE_USE_BUILD_URL=true
@@ -940,6 +943,7 @@ function parse_args
     PATCH_DIR="${USER_PATCH_DIR}"
   fi
 
+  # we need absolute dir for PATCH_DIR
   cd "${STARTINGDIR}" || cleanup_and_exit 1
   if [[ ! -d ${PATCH_DIR} ]]; then
     mkdir -p "${PATCH_DIR}"
@@ -950,10 +954,20 @@ function parse_args
       cleanup_and_exit 1
     fi
   fi
-
-  # we need absolute dir for PATCH_DIR
   PATCH_DIR=$(yetus_abs "${PATCH_DIR}")
 
+  # we need absolute dir for ${CONSOLE_REPORT_FILE}
+  if [[ -n "${CONSOLE_REPORT_FILE}" ]]; then
+    touch "${CONSOLE_REPORT_FILE}"
+    if [[ $? != 0 ]]; then
+      yetus_error "ERROR: cannot write to ${CONSOLE_REPORT_FILE}. Disabling console report file."
+      unset CONSOLE_REPORT_FILE
+    else
+      j="${CONSOLE_REPORT_FILE}"
+      CONSOLE_REPORT_FILE=$(yetus_abs "${j}")
+    fi
+  fi
+
   if [[ ${RESETREPO} == "true" ]] ; then
     yetus_add_entry EXEC_MODES ResetRepo
   fi


[17/23] yetus git commit: YETUS-354. findbugs in build driver has problems

Posted by aw...@apache.org.
YETUS-354. findbugs in build driver has problems

Signed-off-by: Allen Wittenauer <aw...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/yetus/repo
Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/24be6d35
Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/24be6d35
Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/24be6d35

Branch: refs/heads/YETUS-156
Commit: 24be6d3554505e18758c3d2d81017b8a7659d498
Parents: 102df11
Author: Allen Wittenauer <aw...@apache.org>
Authored: Mon Apr 11 10:45:18 2016 -0700
Committer: Allen Wittenauer <aw...@apache.org>
Committed: Sun Apr 17 10:14:34 2016 -0700

----------------------------------------------------------------------
 precommit/test-patch.d/findbugs.sh | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/yetus/blob/24be6d35/precommit/test-patch.d/findbugs.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch.d/findbugs.sh b/precommit/test-patch.d/findbugs.sh
index 152d85f..24ccc95 100755
--- a/precommit/test-patch.d/findbugs.sh
+++ b/precommit/test-patch.d/findbugs.sh
@@ -281,9 +281,19 @@ function findbugs_preapply
 
     if [[ ${module_findbugs_warnings} -gt 0 ]] ; then
       msg="${module} in ${PATCH_BRANCH} has ${module_findbugs_warnings} extant Findbugs warnings."
-      if [[ "${FINDBUGS_WARNINGS_FAIL_PRECHECK}" == "true" ]]; then
+      if [[ "${FINDBUGS_WARNINGS_FAIL_PRECHECK}" = "true" ]]; then
         module_status ${modindex} -1 "branch-findbugs-${fn}-warnings.html" "${msg}"
         ((result=result+1))
+      elif [[ "${BUILDMODE}" = full ]]; then
+        module_status ${modindex} -1 "branch-findbugs-${fn}-warnings.html" "${msg}"
+        ((result=result+1))
+        populate_test_table FindBugs "module:${module}"
+        #shellcheck disable=SC2162
+        while read line; do
+          firstpart=$(echo "${line}" | cut -f2 -d:)
+          secondpart=$(echo "${line}" | cut -f9- -d' ')
+          add_test_table "" "${firstpart}:${secondpart}"
+        done < <("${FINDBUGS_HOME}/bin/convertXmlToText" "${warnings_file}.xml")
       else
         module_status ${modindex} 0 "branch-findbugs-${fn}-warnings.html" "${msg}"
       fi
@@ -466,7 +476,7 @@ function findbugs_rebuild
 {
   declare repostatus=$1
 
-  if [[ "${repostatus}" = branch ]]; then
+  if [[ "${repostatus}" = branch || "${BUILDMODE}" = full ]]; then
     findbugs_preapply
   else
     findbugs_postinstall


[10/23] yetus git commit: YETUS-349. core engine changes for build driver

Posted by aw...@apache.org.
YETUS-349. core engine changes for build driver

Signed-off-by: Allen Wittenauer <aw...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/yetus/repo
Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/25b9f8c4
Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/25b9f8c4
Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/25b9f8c4

Branch: refs/heads/YETUS-156
Commit: 25b9f8c453ed2cbd989ae2719434a56dc60086f5
Parents: 02081d0
Author: Allen Wittenauer <aw...@apache.org>
Authored: Tue Mar 29 16:30:27 2016 -0700
Committer: Allen Wittenauer <aw...@apache.org>
Committed: Sun Apr 17 10:14:34 2016 -0700

----------------------------------------------------------------------
 precommit/core.d/01-common.sh |  22 +++++
 precommit/test-patch.sh       | 163 ++++++++++++++++++++++++-------------
 2 files changed, 130 insertions(+), 55 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/yetus/blob/25b9f8c4/precommit/core.d/01-common.sh
----------------------------------------------------------------------
diff --git a/precommit/core.d/01-common.sh b/precommit/core.d/01-common.sh
index 0661f6e..f31d613 100755
--- a/precommit/core.d/01-common.sh
+++ b/precommit/core.d/01-common.sh
@@ -536,6 +536,9 @@ function verify_command
     yetus_error "executable for '${cmd_name}' was not specified."
     return 1
   fi
+  if [[ ! "${cmd_path}" =~ / ]]; then
+    cmd_path=$(command -v "${cmd_path}")
+  fi
   if [[ ! -f ${cmd_path} ]]; then
     yetus_error "executable '${cmd_path}' for '${cmd_name}' does not exist."
     return 1
@@ -546,3 +549,22 @@ function verify_command
   fi
   return 0
 }
+
+## @description  Faster dirname, given the assumption that
+## @description  dirs are always absolute (e.g., start with /)
+## @description  DO NOT USE with relative paths or where
+## @description  assumption may not be valid!
+## @audience     private
+## @stability    evolving
+## @replaceable  no
+## @param        fileobj
+function faster_dirname
+{
+  declare o=$1
+
+  if [[ "${o}" =~ / ]]; then
+    echo "${o%/*}"
+  else
+    echo .
+  fi
+}

http://git-wip-us.apache.org/repos/asf/yetus/blob/25b9f8c4/precommit/test-patch.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch.sh b/precommit/test-patch.sh
index a55bb05..23e7c3a 100755
--- a/precommit/test-patch.sh
+++ b/precommit/test-patch.sh
@@ -91,6 +91,9 @@ function setup_defaults
   CHANGED_UNION_MODULES=""
   REEXECED=false
   RESETREPO=false
+  BUILDMODE=patch
+  # shellcheck disable=SC2034
+  BUILDMODEMSG="The patch"
   ISSUE=""
   TIMER=$(date +"%s")
   BUILDTOOL=maven
@@ -664,10 +667,14 @@ function yetus_usage
   jdktlist=$(echo ${JDK_TEST_LIST})
   jdktlist=${jdktlist// /,}
 
-  echo "test-patch.sh [OPTIONS] patch"
-  echo ""
-  echo "Where:"
-  echo "  patch is a file, URL, or bugsystem-compatible location of the patch file"
+  if [[ "${BUILDMODE}" = patch ]]; then
+    echo "${BINNAME} [OPTIONS] patch"
+    echo ""
+    echo "Where:"
+    echo "  patch is a file, URL, or bugsystem-compatible location of the patch file"
+  else
+    echo "${BINNAME} [OPTIONS]"
+  fi
   echo ""
   echo "Options:"
   echo ""
@@ -681,6 +688,7 @@ function yetus_usage
   yetus_add_option "--contrib-guide=<url>" "URL to point new users towards project conventions. (default: ${PATCH_NAMING_RULE} )"
   yetus_add_option "--debug" "If set, then output some extra stuff to stderr"
   yetus_add_option "--dirty-workspace" "Allow the local git workspace to have uncommitted changes"
+  yetus_add_option "--empty-patch" "Create a summary of the current source tree"
   yetus_add_option "--java-home=<path>" "Set JAVA_HOME (In Docker mode, this should be local to the image)"
   yetus_add_option "--linecomments=<bug>" "Only write line comments to this comma delimited list (defaults to bugcomments)"
   yetus_add_option "--list-plugins" "List all installed plug-ins and then exit"
@@ -805,6 +813,11 @@ function parse_args
       --instance=*)
         INSTANCE=${i#*=}
       ;;
+      --empty-patch)
+        BUILDMODE=full
+        # shellcheck disable=SC2034
+        BUILDMODEMSG="The source tree"
+      ;;
       --java-home=*)
         JAVA_HOME=${i#*=}
       ;;
@@ -895,7 +908,8 @@ function parse_args
 
   docker_parse_args "$@"
 
-  if [[ -z "${PATCH_OR_ISSUE}" ]]; then
+  if [[ -z "${PATCH_OR_ISSUE}"
+       && "${BUILDMODE}" = patch ]]; then
     yetus_usage
     exit 1
   fi
@@ -1014,7 +1028,7 @@ function find_buildfile_dir
       yetus_debug "ERROR: ${buildfile} is not found."
       return 1
     else
-      dir=$(dirname "${dir}")
+      dir=$(faster_dirname "${dir}")
     fi
   done
 }
@@ -1027,17 +1041,29 @@ function find_buildfile_dir
 function find_changed_files
 {
   declare line
+  declare oldifs
 
-  # get a list of all of the files that have been changed,
-  # except for /dev/null (which would be present for new files).
-  # Additionally, remove any a/ b/ patterns at the front of the patch filenames.
-  # shellcheck disable=SC2016
-  while read -r line; do
-    CHANGED_FILES=("${CHANGED_FILES[@]}" "${line}")
-  done < <(
-    ${AWK} 'function p(s){sub("^[ab]/","",s); if(s!~"^/dev/null"){print s}}
-    /^diff --git /   { p($3); p($4) }
-    /^(\+\+\+|---) / { p($2) }' "${PATCH_DIR}/patch" | sort -u)
+  case "${BUILDMODE}" in
+    full)
+      echo "Building a list of all files in the source tree"
+      oldifs=${IFS}
+      IFS=$'\n'
+      CHANGED_FILES=($(git ls-files))
+      IFS=${oldifs}
+    ;;
+    patch)
+      # get a list of all of the files that have been changed,
+      # except for /dev/null (which would be present for new files).
+      # Additionally, remove any a/ b/ patterns at the front of the patch filenames.
+      # shellcheck disable=SC2016
+      while read -r line; do
+        CHANGED_FILES=("${CHANGED_FILES[@]}" "${line}")
+      done < <(
+        ${AWK} 'function p(s){sub("^[ab]/","",s); if(s!~"^/dev/null"){print s}}
+        /^diff --git /   { p($3); p($4) }
+        /^(\+\+\+|---) / { p($2) }' "${PATCH_DIR}/patch" | sort -u)
+      ;;
+    esac
 }
 
 ## @description Check for directories to skip during
@@ -1070,7 +1096,7 @@ function module_skipdir
     if [[ ${dir} == "." || ${dir} == "/" ]]; then
       return 0
     else
-      dir=$(dirname "${dir}")
+      dir=$(faster_dirname "${dir}")
       yetus_debug "Trying to skip: ${dir}"
     fi
   done
@@ -1107,8 +1133,15 @@ function find_changed_modules
   if [[ -z ${buildfile} ]]; then
     tmpmods=(".")
   else
+
     # Now find all the modules that were changed
     for i in "${CHANGED_FILES[@]}"; do
+
+      # TODO: optimize this
+      if [[ "${BUILDMODE}" = full && ! "${i}" =~ ${buildfile} ]]; then
+        continue
+      fi
+
       dirt=$(dirname "${i}")
 
       module_skipdir "${dirt}"
@@ -1277,8 +1310,10 @@ function git_checkout
 
     currentbranch=$(${GIT} rev-parse --abbrev-ref HEAD)
     if [[ "${currentbranch}" != "${PATCH_BRANCH}" ]];then
-      echo "WARNING: Current git branch is ${currentbranch} but patch is built for ${PATCH_BRANCH}."
-      echo "WARNING: Continuing anyway..."
+      if [[ "${BUILDMODE}" = patch ]]; then
+        echo "WARNING: Current git branch is ${currentbranch} but patch is built for ${PATCH_BRANCH}."
+        echo "WARNING: Continuing anyway..."
+      fi
       PATCH_BRANCH=${currentbranch}
     fi
   fi
@@ -1403,8 +1438,11 @@ function determine_issue
 ## @replaceable  no
 function determine_needed_tests
 {
-  local i
-  local plugin
+  declare i
+  declare plugin
+
+  big_console_header "Determining needed tests"
+  echo "(Depending upon input size and number of plug-ins, this may take a while)"
 
   for i in "${CHANGED_FILES[@]}"; do
     yetus_debug "Determining needed tests for ${i}"
@@ -1597,7 +1635,7 @@ function check_reexec
     fi
   done
 
-  if [[ ${copy} == true ]]; then
+  if [[ ${copy} == true && "${BUILDMODE}" != full ]]; then
     big_console_header "precommit patch detected"
 
     if [[ ${RESETREPO} == false ]]; then
@@ -1740,8 +1778,10 @@ function modules_messages
   declare statusjdk
   declare multijdkmode=false
 
-  if [[ ${repostatus} == branch ]]; then
+  if [[ "${repostatus}" == branch ]]; then
     repo=${PATCH_BRANCH}
+  elif [[ "${BUILDMODE}" == full ]]; then
+    repo="the source"
   else
     repo="the patch"
   fi
@@ -2382,12 +2422,16 @@ function generic_calcdiff_status
   ((samepatch=numpatch-addpatch))
   ((fixedpatch=numbranch-numpatch+addpatch))
 
-  printf "generated %i new + %i unchanged - %i fixed = %i total (was %i)" \
-    "${addpatch}" \
-    "${samepatch}" \
-    "${fixedpatch}" \
-    "${numpatch}" \
-    "${numbranch}"
+  if [[ "${BUILDMODE}" = full ]]; then
+    printf "has %i issues." "${addpatch}"
+  else
+    printf "generated %i new + %i unchanged - %i fixed = %i total (was %i)" \
+      "${addpatch}" \
+      "${samepatch}" \
+      "${fixedpatch}" \
+      "${numpatch}" \
+      "${numbranch}"
+  fi
 }
 
 ## @description  Helper routine for plugins to ask projects, etc
@@ -2595,7 +2639,7 @@ function generic_post_handler
     return 0
   fi
 
-  big_console_header "Patch ${testtype} verification"
+  big_console_header "${testtype} verification: ${BUILDMODE}"
 
   for jdkindex in ${JDK_DIR_LIST}; do
     if [[ ${multijdkmode} == true ]]; then
@@ -2719,9 +2763,9 @@ function compile
   fi
 
   if [[ ${codebase} = "branch" ]]; then
-    big_console_header "Pre-patch ${PATCH_BRANCH} compilation"
+    big_console_header "${PATCH_BRANCH} compilation: pre-patch"
   else
-    big_console_header "Patch compilation"
+    big_console_header "${PATCH_BRANCH} compilation: ${BUILDMODE}"
   fi
 
   yetus_debug "Is JVM Required? ${JVM_REQUIRED}"
@@ -2894,26 +2938,33 @@ function initialize
 
   echo "Modes: ${EXEC_MODES}"
 
-  locate_patch
+  if [[ "${BUILDMODE}" = patch ]]; then
+    locate_patch
+
+    # from here on out, we'll be in ${BASEDIR} for cwd
+    # plugins need to pushd/popd if they change.
+    git_checkout
 
-  # from here on out, we'll be in ${BASEDIR} for cwd
-  # plugins need to pushd/popd if they change.
-  git_checkout
+    determine_issue
+    if [[ "${ISSUE}" == 'Unknown' ]]; then
+      echo "Testing patch on ${PATCH_BRANCH}."
+    else
+      echo "Testing ${ISSUE} patch on ${PATCH_BRANCH}."
+    fi
+
+    patchfile_dryrun_driver "${PATCH_DIR}/patch"
+    if [[ $? != 0 ]]; then
+      ((RESULT = RESULT + 1))
+      yetus_error "ERROR: ${PATCH_OR_ISSUE} does not apply to ${PATCH_BRANCH}."
+      add_vote_table -1 patch "${PATCH_OR_ISSUE} does not apply to ${PATCH_BRANCH}. Rebase required? Wrong Branch? See ${PATCH_NAMING_RULE} for help."
+      bugsystem_finalreport 1
+      cleanup_and_exit 1
+    fi
 
-  determine_issue
-  if [[ "${ISSUE}" == 'Unknown' ]]; then
-    echo "Testing patch on ${PATCH_BRANCH}."
   else
-    echo "Testing ${ISSUE} patch on ${PATCH_BRANCH}."
-  fi
 
-  patchfile_dryrun_driver "${PATCH_DIR}/patch"
-  if [[ $? != 0 ]]; then
-    ((RESULT = RESULT + 1))
-    yetus_error "ERROR: ${PATCH_OR_ISSUE} does not apply to ${PATCH_BRANCH}."
-    add_vote_table -1 patch "${PATCH_OR_ISSUE} does not apply to ${PATCH_BRANCH}. Rebase required? Wrong Branch? See ${PATCH_NAMING_RULE} for help."
-    bugsystem_finalreport 1
-    cleanup_and_exit 1
+    git_checkout
+
   fi
 
   find_changed_files
@@ -2984,17 +3035,19 @@ initialize "$@"
 
 prechecks
 
-patchfiletests
-((RESULT=RESULT+$?))
+if [[ "${BUILDMODE}" = patch ]]; then
+  patchfiletests
+  ((RESULT=RESULT+$?))
 
-compile_cycle branch
-((RESULT=RESULT+$?))
+  compile_cycle branch
+  ((RESULT=RESULT+$?))
 
-distclean
+  distclean
 
-apply_patch_file
+  apply_patch_file
 
-compute_gitdiff
+  compute_gitdiff
+fi
 
 compile_cycle patch
 ((RESULT=RESULT+$?))


[03/23] yetus git commit: YETUS-377. clean up whitespace

Posted by aw...@apache.org.
YETUS-377. clean up whitespace

Signed-off-by: Sean Busbey <bu...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/yetus/repo
Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/9f0f3d8a
Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/9f0f3d8a
Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/9f0f3d8a

Branch: refs/heads/YETUS-156
Commit: 9f0f3d8a57eff997b9c57041a19ecd58e4c984bc
Parents: 1652c31
Author: Allen Wittenauer <aw...@apache.org>
Authored: Thu Apr 14 08:35:11 2016 -0700
Committer: Allen Wittenauer <aw...@apache.org>
Committed: Sun Apr 17 10:07:23 2016 -0700

----------------------------------------------------------------------
 asf-site-src/source/_footer.md.erb              |  4 ++--
 .../fonts/glyphicons-halflings-regular.svg      |  2 +-
 asf-site-src/source/index.html.md               | 10 ++++-----
 asf-site-src/source/layouts/layout.erb          | 22 ++++++++++----------
 asf-site-src/source/mailinglists.html.md        | 12 +++++------
 yetus-project/pom.xml                           |  4 ++--
 6 files changed, 27 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/yetus/blob/9f0f3d8a/asf-site-src/source/_footer.md.erb
----------------------------------------------------------------------
diff --git a/asf-site-src/source/_footer.md.erb b/asf-site-src/source/_footer.md.erb
index 42f357b..861663b 100644
--- a/asf-site-src/source/_footer.md.erb
+++ b/asf-site-src/source/_footer.md.erb
@@ -22,9 +22,9 @@
     <footer class="footer">
         <div class="row-fluid">
             <div class="span12 text-left">
-							<div class="span12">
+              <div class="span12">
                 Copyright 2008-2016 <a href="http://www.apache.org/">Apache Software Foundation</a>. Licensed under the <a href="http://www.apache.org/licenses/">Apache License v2.0</a>. Apache Yetus and the Apache feather logo are trademarks of The Apache Software Foundation.
-							</div>
+              </div>
             </div>
 
         </div>

http://git-wip-us.apache.org/repos/asf/yetus/blob/9f0f3d8a/asf-site-src/source/assets/fonts/glyphicons-halflings-regular.svg
----------------------------------------------------------------------
diff --git a/asf-site-src/source/assets/fonts/glyphicons-halflings-regular.svg b/asf-site-src/source/assets/fonts/glyphicons-halflings-regular.svg
index 94fb549..f155876 100644
--- a/asf-site-src/source/assets/fonts/glyphicons-halflings-regular.svg
+++ b/asf-site-src/source/assets/fonts/glyphicons-halflings-regular.svg
@@ -285,4 +285,4 @@
 <glyph unicode="&#x1f511;" d="M250 1200h600q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-150v-500l-255 -178q-19 -9 -32 -1t-13 29v650h-150q-21 0 -35.5 14.5t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5zM400 1100v-100h300v100h-300z" />
 <glyph unicode="&#x1f6aa;" d="M250 1200h750q39 0 69.5 -40.5t30.5 -84.5v-933l-700 -117v950l600 125h-700v-1000h-100v1025q0 23 15.5 49t34.5 26zM500 525v-100l100 20v100z" />
 </font>
-</defs></svg> 
\ No newline at end of file
+</defs></svg>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/yetus/blob/9f0f3d8a/asf-site-src/source/index.html.md
----------------------------------------------------------------------
diff --git a/asf-site-src/source/index.html.md b/asf-site-src/source/index.html.md
index 868e36f..bd7ec5b 100644
--- a/asf-site-src/source/index.html.md
+++ b/asf-site-src/source/index.html.md
@@ -18,12 +18,12 @@
 -->
 
 <div class="masthead">
-	<div class="jumbotron">
+  <div class="jumbotron">
           <h1>Apache Yetus</h1>
-	  <div>
-	    <p>... is a collection of libraries and tools that enable contribution and release processes for software projects.</p>
-	  </div>
-	</div>
+    <div>
+      <p>... is a collection of libraries and tools that enable contribution and release processes for software projects.</p>
+    </div>
+  </div>
 </div>
 
 It provides:

http://git-wip-us.apache.org/repos/asf/yetus/blob/9f0f3d8a/asf-site-src/source/layouts/layout.erb
----------------------------------------------------------------------
diff --git a/asf-site-src/source/layouts/layout.erb b/asf-site-src/source/layouts/layout.erb
index a389fd4..16cfd2c 100644
--- a/asf-site-src/source/layouts/layout.erb
+++ b/asf-site-src/source/layouts/layout.erb
@@ -21,23 +21,23 @@
     <head>
         <meta charset="utf-8">
         <title>Apache Yetus</title>
-		    <meta name="viewport" content="width=device-width, initial-scale=1.0">
-		    <meta name="description" content="">
-		    <meta name="author" content="">
+        <meta name="viewport" content="width=device-width, initial-scale=1.0">
+        <meta name="description" content="">
+        <meta name="author" content="">
 
-		    <link href="/assets/css/bootstrap.css" rel="stylesheet">
-		    <link href="/assets/css/bootstrap-theme.css" rel="stylesheet">
+        <link href="/assets/css/bootstrap.css" rel="stylesheet">
+        <link href="/assets/css/bootstrap-theme.css" rel="stylesheet">
                     <link href="/assets/css/font-awesome.css" rel="stylesheet">
 
-		    <!-- JS -->
-		    <script type="text/javascript" src="/assets/js/jquery-2.1.4.min.js"></script>
-		    <script type="text/javascript" src="/assets/js/bootstrap.js"></script>
-	</head>
+        <!-- JS -->
+        <script type="text/javascript" src="/assets/js/jquery-2.1.4.min.js"></script>
+        <script type="text/javascript" src="/assets/js/bootstrap.js"></script>
+  </head>
     <body>
       <%= partial "header" %>
       <div class="container">
         <%= yield %>
-	  </div>
+    </div>
       <%= partial "footer" %>
-	</body>
+  </body>
 </html>

http://git-wip-us.apache.org/repos/asf/yetus/blob/9f0f3d8a/asf-site-src/source/mailinglists.html.md
----------------------------------------------------------------------
diff --git a/asf-site-src/source/mailinglists.html.md b/asf-site-src/source/mailinglists.html.md
index d367262..40f513a 100644
--- a/asf-site-src/source/mailinglists.html.md
+++ b/asf-site-src/source/mailinglists.html.md
@@ -19,13 +19,13 @@
 
 # Community
 <div class="row-fluid">
-	<div class="col-lg-6">
-		<h3>Mailing Lists</h3>
-		<p><strong>Developers</strong> - Development related discussion.</p>
+  <div class="col-lg-6">
+    <h3>Mailing Lists</h3>
+    <p><strong>Developers</strong> - Development related discussion.</p>
 
-		<p><a href="mailto:dev-subscribe@yetus.apache.org">Subscribe</a> | <a href="mailto:dev-unsubscribe@yetus.apache.org">Unsubscribe</a> | <a href="http://mail-archives.apache.org/mod_mbox/yetus-dev/">Archive</a></p>
+    <p><a href="mailto:dev-subscribe@yetus.apache.org">Subscribe</a> | <a href="mailto:dev-unsubscribe@yetus.apache.org">Unsubscribe</a> | <a href="http://mail-archives.apache.org/mod_mbox/yetus-dev/">Archive</a></p>
 
-		<p><strong>Commits</strong> - Commit notification source repository.</p>
+    <p><strong>Commits</strong> - Commit notification source repository.</p>
 
                 <p><a href="mailto:commits-subscribe@yetus.apache.org">Subscribe</a> | <a href="mailto:commits-unsubscribe@yetus.apache.org">Unsubscribe</a> | <a href="http://mail-archives.apache.org/mod_mbox/yetus-commits/">Archive</a></p>
 
@@ -33,6 +33,6 @@
 
                 <p><a href="mailto:notifications-subscribe@yetus.apache.org">Subscribe</a> | <a href="mailto:notifications-unsubscribe@yetus.apache.org">Unsubscribe</a> | <a href="http://mail-archives.apache.org/mod_mbox/yetus-notifications/">Archive</a></p>
 
-	</div>
+  </div>
 </div>
 <hr>

http://git-wip-us.apache.org/repos/asf/yetus/blob/9f0f3d8a/yetus-project/pom.xml
----------------------------------------------------------------------
diff --git a/yetus-project/pom.xml b/yetus-project/pom.xml
index 462b15d..99b8c5d 100644
--- a/yetus-project/pom.xml
+++ b/yetus-project/pom.xml
@@ -7,9 +7,9 @@
   to you under the Apache License, Version 2.0 (the
   "License"); you may not use this file except in compliance
   with the License.  You may obtain a copy of the License at
-  
+
       http://www.apache.org/licenses/LICENSE-2.0
-  
+
   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.


[15/23] yetus git commit: YETUS-351. documentation changes for build driver

Posted by aw...@apache.org.
YETUS-351. documentation changes for build driver

Signed-off-by: Allen Wittenauer <aw...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/yetus/repo
Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/885e9283
Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/885e9283
Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/885e9283

Branch: refs/heads/YETUS-156
Commit: 885e9283b7516bdb9ffe828e9af87d7e2248cf94
Parents: 867bc9c
Author: Allen Wittenauer <aw...@apache.org>
Authored: Tue Mar 29 17:19:41 2016 -0700
Committer: Allen Wittenauer <aw...@apache.org>
Committed: Sun Apr 17 10:14:34 2016 -0700

----------------------------------------------------------------------
 .../documentation/in-progress/precommit-qbt.md  | 37 ++++++++++++++++++++
 1 file changed, 37 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/yetus/blob/885e9283/asf-site-src/source/documentation/in-progress/precommit-qbt.md
----------------------------------------------------------------------
diff --git a/asf-site-src/source/documentation/in-progress/precommit-qbt.md b/asf-site-src/source/documentation/in-progress/precommit-qbt.md
new file mode 100644
index 0000000..2cb8036
--- /dev/null
+++ b/asf-site-src/source/documentation/in-progress/precommit-qbt.md
@@ -0,0 +1,37 @@
+<!---
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+qbt
+===
+
+`qbt` is a command to execute test-patch without a patch.  It uses
+the same plug-ins and the same options as test-patch.  The only
+difference is that no patch file, location, etc should be supplied.
+It is meant to be a way to easily get test-patch's output on your
+current source tree.  It is suitable to be run as a regularly
+scheduled build as part of your overall development strategy.
+
+When using an automation tool, it may be useful to use the
+`--console-report-file` option to send the summary email to a
+file. This can then be used with systems like Jenkin's
+email-ext plug-in to send the output as an emailed report:
+
+```
+${FILE,path="<report-file-path>"}
+```


[05/23] yetus git commit: YETUS-65. fix shellcheck 4.1 errors

Posted by aw...@apache.org.
YETUS-65. fix shellcheck 4.1 errors

Signed-off-by: Sean Busbey <bu...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/yetus/repo
Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/14cae37c
Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/14cae37c
Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/14cae37c

Branch: refs/heads/YETUS-156
Commit: 14cae37c6148e92c6015a090a6ae327b1cd8574d
Parents: 585e97d
Author: Allen Wittenauer <aw...@apache.org>
Authored: Thu Apr 14 08:45:48 2016 -0700
Committer: Allen Wittenauer <aw...@apache.org>
Committed: Sun Apr 17 10:09:21 2016 -0700

----------------------------------------------------------------------
 precommit/core.d/00-yetuslib.sh      |  2 ++
 precommit/smart-apply-patch.sh       |  2 +-
 precommit/test-patch.d/bugzilla.sh   |  2 --
 precommit/test-patch.d/shellcheck.sh |  2 +-
 precommit/test-patch.sh              | 10 ++++++----
 5 files changed, 10 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/yetus/blob/14cae37c/precommit/core.d/00-yetuslib.sh
----------------------------------------------------------------------
diff --git a/precommit/core.d/00-yetuslib.sh b/precommit/core.d/00-yetuslib.sh
index 1bd63b7..90ffa16 100755
--- a/precommit/core.d/00-yetuslib.sh
+++ b/precommit/core.d/00-yetuslib.sh
@@ -139,6 +139,7 @@ function yetus_add_header
 {
   declare text=$1
 
+  #shellcheck disable=SC2034
   YETUS_USAGE_HEADER="${text}"
 }
 
@@ -163,6 +164,7 @@ function yetus_add_option
 ## @replaceable  no
 function yetus_reset_usage
 {
+  # shellcheck disable=SC2034
   YETUS_OPTION_USAGE=()
   YETUS_OPTION_USAGE_COUNTER=0
 }

http://git-wip-us.apache.org/repos/asf/yetus/blob/14cae37c/precommit/smart-apply-patch.sh
----------------------------------------------------------------------
diff --git a/precommit/smart-apply-patch.sh b/precommit/smart-apply-patch.sh
index de0a643..463c343 100755
--- a/precommit/smart-apply-patch.sh
+++ b/precommit/smart-apply-patch.sh
@@ -16,7 +16,7 @@
 
 # Make sure that bash version meets the pre-requisite
 
-if [[ -z "${BASH_VERSINFO}" ]] \
+if [[ -z "${BASH_VERSINFO[0]}" ]] \
    || [[ "${BASH_VERSINFO[0]}" -lt 3 ]] \
    || [[ "${BASH_VERSINFO[0]}" -eq 3 && "${BASH_VERSINFO[1]}" -lt 2 ]]; then
   echo "bash v3.2+ is required. Sorry."

http://git-wip-us.apache.org/repos/asf/yetus/blob/14cae37c/precommit/test-patch.d/bugzilla.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch.d/bugzilla.sh b/precommit/test-patch.d/bugzilla.sh
index 885a752..9d04a04 100755
--- a/precommit/test-patch.d/bugzilla.sh
+++ b/precommit/test-patch.d/bugzilla.sh
@@ -40,8 +40,6 @@ function bugzilla_parse_args
 function bugzilla_determine_issue
 {
   declare input=$1
-  declare patchnamechunk
-  declare maybeissue
 
   if [[ ! "${input}" =~ ^BZ: ]]; then
     return 1

http://git-wip-us.apache.org/repos/asf/yetus/blob/14cae37c/precommit/test-patch.d/shellcheck.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch.d/shellcheck.sh b/precommit/test-patch.d/shellcheck.sh
index fd5109f..f3d8fbd 100755
--- a/precommit/test-patch.d/shellcheck.sh
+++ b/precommit/test-patch.d/shellcheck.sh
@@ -52,7 +52,7 @@ function shellcheck_private_findbash
   local value
   local list
 
-  while read line; do
+  while read -r line; do
     value=$(find "${line}" ! -name '*.cmd' -type f \
       | ${GREP} -E -v '(.orig$|.rej$)')
 

http://git-wip-us.apache.org/repos/asf/yetus/blob/14cae37c/precommit/test-patch.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch.sh b/precommit/test-patch.sh
index d840f32..0260c59 100755
--- a/precommit/test-patch.sh
+++ b/precommit/test-patch.sh
@@ -16,7 +16,7 @@
 
 # Make sure that bash version meets the pre-requisite
 
-if [[ -z "${BASH_VERSINFO}" ]] \
+if [[ -z "${BASH_VERSINFO[0]}" ]] \
    || [[ "${BASH_VERSINFO[0]}" -lt 3 ]] \
    || [[ "${BASH_VERSINFO[0]}" -eq 3 && "${BASH_VERSINFO[1]}" -lt 2 ]]; then
   echo "bash v3.2+ is required. Sorry."
@@ -933,14 +933,14 @@ function parse_args
   fi
 
   # we need absolute dir for ${BASEDIR}
-  cd "${STARTINGDIR}"
+  cd "${STARTINGDIR}" || cleanup_and_exit 1
   BASEDIR=$(yetus_abs "${BASEDIR}")
 
   if [[ -n ${USER_PATCH_DIR} ]]; then
     PATCH_DIR="${USER_PATCH_DIR}"
   fi
 
-  cd "${STARTINGDIR}"
+  cd "${STARTINGDIR}" || cleanup_and_exit 1
   if [[ ! -d ${PATCH_DIR} ]]; then
     mkdir -p "${PATCH_DIR}"
     if [[ $? == 0 ]] ; then
@@ -1177,7 +1177,7 @@ function git_checkout
 
   big_console_header "Confirming git environment"
 
-  cd "${BASEDIR}"
+  cd "${BASEDIR}" || cleanup_and_exit 1
   if [[ ! -d .git ]]; then
     yetus_error "ERROR: ${BASEDIR} is not a git repo."
     cleanup_and_exit 1
@@ -2515,7 +2515,9 @@ function generic_postlog_compare
     generic_logfilter "${testtype}" "${PATCH_DIR}/branch-${origlog}-${fn}.txt" "${PATCH_DIR}/branch-${origlog}-${testtype}-${fn}.txt"
     generic_logfilter "${testtype}" "${PATCH_DIR}/patch-${origlog}-${fn}.txt" "${PATCH_DIR}/patch-${origlog}-${testtype}-${fn}.txt"
 
+    # shellcheck disable=SC2016
     numbranch=$(wc -l "${PATCH_DIR}/branch-${origlog}-${testtype}-${fn}.txt" | ${AWK} '{print $1}')
+    # shellcheck disable=SC2016
     numpatch=$(wc -l "${PATCH_DIR}/patch-${origlog}-${testtype}-${fn}.txt" | ${AWK} '{print $1}')
 
     calcdiffs \


[22/23] yetus git commit: YETUS-352. hadoop and hbase personality changes for build driver

Posted by aw...@apache.org.
YETUS-352. hadoop and hbase personality changes for build driver

Signed-off-by: Allen Wittenauer <aw...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/yetus/repo
Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/102df111
Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/102df111
Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/102df111

Branch: refs/heads/YETUS-156
Commit: 102df11111d3d7f4270356b47a1103d58713741b
Parents: 885e928
Author: Allen Wittenauer <aw...@apache.org>
Authored: Tue Mar 29 17:33:14 2016 -0700
Committer: Allen Wittenauer <aw...@apache.org>
Committed: Sun Apr 17 10:14:34 2016 -0700

----------------------------------------------------------------------
 precommit/personality/hadoop.sh | 4 ++--
 precommit/personality/hbase.sh  | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/yetus/blob/102df111/precommit/personality/hadoop.sh
----------------------------------------------------------------------
diff --git a/precommit/personality/hadoop.sh b/precommit/personality/hadoop.sh
index 59dfd2c..d23b6be 100755
--- a/precommit/personality/hadoop.sh
+++ b/precommit/personality/hadoop.sh
@@ -205,7 +205,7 @@ function personality_modules
         ordering=.
       fi
 
-      if [[ ${repostatus} = patch ]]; then
+      if [[ "${repostatus}" = patch && "${BUILDMODE}" = patch ]]; then
         echo "javadoc pre-reqs:"
         for i in hadoop-project \
           hadoop-common-project/hadoop-annotations; do
@@ -226,7 +226,7 @@ function personality_modules
     ;;
     mvninstall)
       extra="-DskipTests"
-      if [[ ${repostatus} = branch ]]; then
+      if [[ "${repostatus}" = branch || "${BUILDMODE}" = full ]]; then
         ordering=.
       fi
     ;;

http://git-wip-us.apache.org/repos/asf/yetus/blob/102df111/precommit/personality/hbase.sh
----------------------------------------------------------------------
diff --git a/precommit/personality/hbase.sh b/precommit/personality/hbase.sh
index 352d2e3..e9e4ea8 100755
--- a/precommit/personality/hbase.sh
+++ b/precommit/personality/hbase.sh
@@ -53,7 +53,8 @@ function personality_modules
   extra="-DHBasePatchProcess"
 
   if [[ ${repostatus} == branch
-     && ${testtype} == mvninstall ]];then
+     && ${testtype} == mvninstall ]] ||
+     [[ "${BUILDMODE}" == full ]]; then
      personality_enqueue_module . ${extra}
      return
    fi


[06/23] yetus git commit: YETUS-359. shellcheck needs UTF-8 protection

Posted by aw...@apache.org.
YETUS-359. shellcheck needs UTF-8 protection

Signed-off-by: Sean Busbey <bu...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/yetus/repo
Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/dc63c866
Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/dc63c866
Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/dc63c866

Branch: refs/heads/YETUS-156
Commit: dc63c866b7a36d99307eee67b9d6c04e1d7aa10b
Parents: 14cae37
Author: Allen Wittenauer <aw...@apache.org>
Authored: Wed Apr 13 08:06:19 2016 -0700
Committer: Allen Wittenauer <aw...@apache.org>
Committed: Sun Apr 17 10:12:25 2016 -0700

----------------------------------------------------------------------
 precommit/test-patch.d/shellcheck.sh | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/yetus/blob/dc63c866/precommit/test-patch.d/shellcheck.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch.d/shellcheck.sh b/precommit/test-patch.d/shellcheck.sh
index f3d8fbd..e9a7e15 100755
--- a/precommit/test-patch.d/shellcheck.sh
+++ b/precommit/test-patch.d/shellcheck.sh
@@ -40,10 +40,38 @@ function shellcheck_filefilter
 
 function shellcheck_precheck
 {
+  declare langs
+
   if ! verify_command "shellcheck" "${SHELLCHECK}"; then
     add_vote_table 0 shellcheck "Shellcheck was not available."
     delete_test shellcheck
   fi
+
+  if [[ -z "${LANG}" ]]; then
+    langs=$(locale -a)
+    if [[ ${langs}  =~ C.UTF-8 ]]; then
+      yetus_error "WARNING: shellcheck needs UTF-8 locale support. Forcing C.UTF-8."
+      export LANG=C.UTF-8
+      export LC_ALL=C.UTF-8
+    elif [[ ${langs}  =~ en_US.UTF-8 ]]; then
+      yetus_error "WARNING: shellcheck needs UTF-8 locale support. Forcing en_US.UTF-8."
+      export LANG=en_US.UTF-8
+      export LC_ALL=en_US.UTF-8
+    else
+      for i in ${langs}; do
+        if [[ "${i}" =~ UTF-8 ]]; then
+          yetus_error "WARNING: shellcheck needs UTF-8 locale support. Forcing ${i}."
+          export LANG="${i}"
+          export LC_ALL="${i}"
+          break
+        fi
+      done
+    fi
+  fi
+
+  if [[ ! "${LANG}" =~ UTF-8 ]]; then
+    yetus_error "WARNING: shellcheck may fail without UTF-8 locale setting."
+  fi
 }
 
 function shellcheck_private_findbash


[18/23] yetus git commit: YETUS-371. build driver: speed up checkstyle

Posted by aw...@apache.org.
YETUS-371. build driver: speed up checkstyle

Signed-off-by: Allen Wittenauer <aw...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/yetus/repo
Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/1d628e0a
Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/1d628e0a
Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/1d628e0a

Branch: refs/heads/YETUS-156
Commit: 1d628e0a3d697cfb031297f1db9166049ce8b950
Parents: 24be6d3
Author: Allen Wittenauer <aw...@apache.org>
Authored: Tue Apr 12 08:53:04 2016 -0700
Committer: Allen Wittenauer <aw...@apache.org>
Committed: Sun Apr 17 10:14:34 2016 -0700

----------------------------------------------------------------------
 precommit/test-patch.d/checkstyle.sh | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/yetus/blob/1d628e0a/precommit/test-patch.d/checkstyle.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch.d/checkstyle.sh b/precommit/test-patch.d/checkstyle.sh
index bba3369..f0b3e57 100755
--- a/precommit/test-patch.d/checkstyle.sh
+++ b/precommit/test-patch.d/checkstyle.sh
@@ -341,12 +341,21 @@ function checkstyle_postapply
     module=${MODULE[$i]}
     fn=$(module_file_fragment "${module}")
 
-    # call calcdiffs to allow overrides
-    calcdiffs \
-      "${PATCH_DIR}/branch-checkstyle-${fn}.txt" \
-      "${PATCH_DIR}/patch-checkstyle-${fn}.txt" \
-      checkstyle \
-      > "${PATCH_DIR}/diff-checkstyle-${fn}.txt"
+    # if there is no comparison to be done,
+    # we can speed this up tremendously
+    if [[ "${BUILDMODE}" = full ]]; then
+      touch  "${PATCH_DIR}/branch-checkstyle-${fn}.txt"
+      cp -p "${PATCH_DIR}/patch-checkstyle-${fn}.txt" \
+        "${PATCH_DIR}/diff-checkstyle-${fn}.txt"
+    else
+
+      # call calcdiffs to allow overrides
+      calcdiffs \
+        "${PATCH_DIR}/branch-checkstyle-${fn}.txt" \
+        "${PATCH_DIR}/patch-checkstyle-${fn}.txt" \
+        checkstyle \
+        > "${PATCH_DIR}/diff-checkstyle-${fn}.txt"
+    fi
 
     #shellcheck disable=SC2016
     numbranch=$(wc -l "${PATCH_DIR}/branch-checkstyle-${fn}.txt" | ${AWK} '{print $1}')


[02/23] yetus git commit: YETUS-370. multiple compile test types confuse later runs

Posted by aw...@apache.org.
YETUS-370. multiple compile test types confuse later runs

Signed-off-by: Sean Busbey <bu...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/yetus/repo
Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/1652c31d
Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/1652c31d
Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/1652c31d

Branch: refs/heads/YETUS-156
Commit: 1652c31d42ee835e7444c6bce1df4f9689adf512
Parents: 4ea61e2
Author: Allen Wittenauer <aw...@apache.org>
Authored: Tue Apr 12 09:07:08 2016 -0700
Committer: Allen Wittenauer <aw...@apache.org>
Committed: Sun Apr 17 10:06:38 2016 -0700

----------------------------------------------------------------------
 precommit/test-patch.sh | 58 +++++++++++++++++++++++++++++++++++---------
 1 file changed, 46 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/yetus/blob/1652c31d/precommit/test-patch.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch.sh b/precommit/test-patch.sh
index ee96505..d840f32 100755
--- a/precommit/test-patch.sh
+++ b/precommit/test-patch.sh
@@ -38,12 +38,17 @@ declare -a TP_HEADER
 declare -a TP_VOTE_TABLE
 declare -a TP_TEST_TABLE
 declare -a TP_FOOTER_TABLE
+declare -a MODULE
+declare -a MODULE_BACKUP_STATUS
+declare -a MODULE_BACKUP_STATUS_TIMER
+declare -a MODULE_BACKUP_STATUS_MSG
+declare -a MODULE_BACKUP_STATUS_LOG
+declare -a MODULE_BACKUP_COMPILE_LOG
 declare -a MODULE_STATUS
 declare -a MODULE_STATUS_TIMER
 declare -a MODULE_STATUS_MSG
 declare -a MODULE_STATUS_LOG
 declare -a MODULE_COMPILE_LOG
-declare -a MODULE
 declare -a USER_MODULE_LIST
 
 TP_HEADER_COUNTER=0
@@ -1674,6 +1679,32 @@ function modules_reset
   MODULE_COMPILE_LOG=()
 }
 
+## @description  Backup the MODULE globals prior to loop processing
+## @audience     public
+## @stability    evolving
+## @replaceable  no
+function modules_backup
+{
+  MODULE_BACKUP_STATUS=("${MODULE_STATUS[@]}")
+  MODULE_BACKUP_STATUS_TIMER=("${MODULE_STATUS_TIMER[@]}")
+  MODULE_BACKUP_STATUS_MSG=("${MODULE_STATUS_MSG[@]}")
+  MODULE_BACKUP_STATUS_LOG=("${MODULE_STATUS_LOG[@]}")
+  MODULE_BACKUP_COMPILE_LOG=("${MODULE_COMPILE_LOG[@]}")
+}
+
+## @description  Restore the backup
+## @audience     public
+## @stability    evolving
+## @replaceable  no
+function modules_restore
+{
+  MODULE_STATUS=("${MODULE_BACKUP_STATUS[@]}")
+  MODULE_STATUS_TIMER=("${MODULE_BACKUP_STATUS_TIMER[@]}")
+  MODULE_STATUS_MSG=("${MODULE_BACKUP_STATUS_MSG[@]}")
+  MODULE_STATUS_LOG=("${MODULE_BACKUP_STATUS_LOG[@]}")
+  MODULE_COMPILE_LOG=("${MODULE_BACKUP_COMPILE_LOG[@]}")
+}
+
 ## @description  Utility to print standard module errors
 ## @audience     public
 ## @stability    evolving
@@ -1873,7 +1904,7 @@ function modules_workers
     # compile is special
     if [[ ${testtype} = compile ]]; then
       MODULE_COMPILE_LOG[${modindex}]="${PATCH_DIR}/${repostatus}-${testtype}-${fn}.txt"
-      yetus_debug "Comile log set to ${MODULE_COMPILE_LOG[${modindex}]}"
+      yetus_debug "Compile log set to ${MODULE_COMPILE_LOG[${modindex}]}"
     fi
 
     savestop=$(stop_clock)
@@ -2328,11 +2359,11 @@ function calcdiffs
 ## @return      errorstring
 function generic_calcdiff_status
 {
-  declare numbranch=$1
-  declare numpatch=$2
-  declare addpatch=$3
-  declare samepatch
-  declare fixedpatch
+  declare -i numbranch=$1
+  declare -i numpatch=$2
+  declare -i addpatch=$3
+  declare -i samepatch
+  declare -i fixedpatch
 
   ((samepatch=numpatch-addpatch))
   ((fixedpatch=numbranch-numpatch+addpatch))
@@ -2441,11 +2472,11 @@ function generic_postlog_compare
   declare fn
   declare jdk
   declare statusjdk
-  declare numbranch
-  declare numpatch
-  declare addpatch
-  declare samepatch
-  declare fixedpatch
+  declare -i numbranch=0
+  declare -i numpatch=0
+  declare -i addpatch=0
+  declare -i samepatch=0
+  declare -i fixedpatch=0
   declare summarize=true
 
   if [[ ${multijdk} == true ]]; then
@@ -2637,7 +2668,10 @@ function compile_nonjvm
   "${BUILDTOOL}_modules_worker" "${codebase}" compile
   modules_messages "${codebase}" compile true
 
+  modules_backup
+
   for plugin in ${TESTTYPES}; do
+    modules_restore
     verify_patchdir_still_exists
     if declare -f ${plugin}_compile >/dev/null 2>&1; then
       yetus_debug "Running ${plugin}_compile ${codebase} ${multijdkmode}"


[21/23] yetus git commit: YETUS-356. build driver: author plug-in still mentions patches

Posted by aw...@apache.org.
YETUS-356. build driver: author plug-in still mentions patches

Signed-off-by: Allen Wittenauer <aw...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/yetus/repo
Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/8ddaa2a2
Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/8ddaa2a2
Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/8ddaa2a2

Branch: refs/heads/YETUS-156
Commit: 8ddaa2a2241b218b7b515526ee0857ee0cc4b0ff
Parents: bcbeae5
Author: Allen Wittenauer <aw...@apache.org>
Authored: Tue Apr 12 13:55:17 2016 -0700
Committer: Allen Wittenauer <aw...@apache.org>
Committed: Sun Apr 17 10:14:34 2016 -0700

----------------------------------------------------------------------
 precommit/test-patch.d/author.sh | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/yetus/blob/8ddaa2a2/precommit/test-patch.d/author.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch.d/author.sh b/precommit/test-patch.d/author.sh
index 2e148d8..3d6e393 100755
--- a/precommit/test-patch.d/author.sh
+++ b/precommit/test-patch.d/author.sh
@@ -26,10 +26,17 @@ function author_generic
 {
   declare authortags
   declare i
+  declare msg
+
+  if [[ "${BUILDMODE}" = full ]]; then
+    msg="patch"
+  else
+    msg="source tree"
+  fi
 
   # shellcheck disable=SC2016
   authortags=$(wc -l "${PATCH_DIR}/author-tags.txt" | "${AWK}" '{print $1}')
-  echo "There appear to be ${authortags} @author tags in the patch."
+  echo "There appear to be ${authortags} @author tags in the ${msg}."
   if [[ ${authortags} != 0 ]] ; then
     add_vote_table -1 @author \
       "${BUILDMODEMSG} appears to contain ${authortags} @author tags which the" \


[20/23] yetus git commit: YETUS-356. build driver: author plug-in still mentions patches (addendum)

Posted by aw...@apache.org.
YETUS-356. build driver: author plug-in still mentions patches (addendum)

Signed-off-by: Allen Wittenauer <aw...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/yetus/repo
Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/491f4dbd
Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/491f4dbd
Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/491f4dbd

Branch: refs/heads/YETUS-156
Commit: 491f4dbd2a5c00e432dd83a1033d639d3458732b
Parents: 8ddaa2a
Author: Allen Wittenauer <aw...@apache.org>
Authored: Tue Apr 12 21:32:46 2016 -0700
Committer: Allen Wittenauer <aw...@apache.org>
Committed: Sun Apr 17 10:14:34 2016 -0700

----------------------------------------------------------------------
 precommit/test-patch.d/author.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/yetus/blob/491f4dbd/precommit/test-patch.d/author.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch.d/author.sh b/precommit/test-patch.d/author.sh
index 3d6e393..0e00c80 100755
--- a/precommit/test-patch.d/author.sh
+++ b/precommit/test-patch.d/author.sh
@@ -29,9 +29,9 @@ function author_generic
   declare msg
 
   if [[ "${BUILDMODE}" = full ]]; then
-    msg="patch"
-  else
     msg="source tree"
+  else
+    msg="patch"
   fi
 
   # shellcheck disable=SC2016


[09/23] yetus git commit: YETUS-372. build driver: unit tests still mentions patches

Posted by aw...@apache.org.
YETUS-372. build driver: unit tests still mentions patches

Signed-off-by: Allen Wittenauer <aw...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/yetus/repo
Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/ac9c62e2
Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/ac9c62e2
Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/ac9c62e2

Branch: refs/heads/YETUS-156
Commit: ac9c62e250691d857286d5b35d903d732f24bd73
Parents: 606f816
Author: Allen Wittenauer <aw...@apache.org>
Authored: Tue Apr 12 13:50:54 2016 -0700
Committer: Allen Wittenauer <aw...@apache.org>
Committed: Sun Apr 17 10:14:34 2016 -0700

----------------------------------------------------------------------
 precommit/test-patch.sh | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/yetus/blob/ac9c62e2/precommit/test-patch.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch.sh b/precommit/test-patch.sh
index f3dbc92..d4ee8ed 100755
--- a/precommit/test-patch.sh
+++ b/precommit/test-patch.sh
@@ -1780,10 +1780,10 @@ function modules_messages
   declare statusjdk
   declare multijdkmode=false
 
-  if [[ "${repostatus}" == branch ]]; then
-    repo=${PATCH_BRANCH}
-  elif [[ "${BUILDMODE}" == full ]]; then
+  if [[ "${BUILDMODE}" == full ]]; then
     repo="the source"
+  elif [[ "${repostatus}" == branch ]]; then
+    repo=${PATCH_BRANCH}
   else
     repo="the patch"
   fi
@@ -1899,7 +1899,9 @@ function modules_workers
   declare result=0
   declare argv
 
-  if [[ ${repostatus} == branch ]]; then
+  if [[ "${BUILDMODE}" = full ]]; then
+    repo="the source"
+  elif [[ ${repostatus} == branch ]]; then
     repo=${PATCH_BRANCH}
   else
     repo="the patch"


[08/23] yetus git commit: YETUS-374. need a way to ignore results from a list of tests

Posted by aw...@apache.org.
YETUS-374. need a way to ignore results from a list of tests

Signed-off-by: Allen Wittenauer <aw...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/yetus/repo
Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/a254ac9b
Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/a254ac9b
Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/a254ac9b

Branch: refs/heads/YETUS-156
Commit: a254ac9b2414a9ddc3a03decb54f16cd788208a6
Parents: 491f4db
Author: Allen Wittenauer <aw...@apache.org>
Authored: Tue Apr 12 14:35:26 2016 -0700
Committer: Allen Wittenauer <aw...@apache.org>
Committed: Sun Apr 17 10:14:34 2016 -0700

----------------------------------------------------------------------
 precommit/test-patch.sh | 32 +++++++++++++++++++++-----------
 1 file changed, 21 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/yetus/blob/a254ac9b/precommit/test-patch.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch.sh b/precommit/test-patch.sh
index d4ee8ed..6d36819 100755
--- a/precommit/test-patch.sh
+++ b/precommit/test-patch.sh
@@ -236,12 +236,15 @@ function add_header_line
 ## @return       Elapsed time display
 function add_vote_table
 {
-  local value=$1
-  local subsystem=$2
+  declare value=$1
+  declare subsystem=$2
   shift 2
 
-  local calctime
-  local -r elapsed=$(stop_clock)
+  declare calctime
+  # apparently shellcheck doesn't know about declare -r
+  #shellcheck disable=SC2155
+  declare -r elapsed=$(stop_clock)
+  declare filt
 
   yetus_debug "add_vote_table ${value} ${subsystem} ${*}"
 
@@ -251,6 +254,12 @@ function add_vote_table
     value="+1"
   fi
 
+  for filt in "${VOTE_FILTER[@]}"; do
+    if [[ "${subsystem}" = "${filt}" ]]; then
+      value=0
+    fi
+  done
+
   if [[ -z ${value} ]]; then
     # shellcheck disable=SC2034
     TP_VOTE_TABLE[${TP_VOTE_COUNTER}]="|  | ${subsystem} | | ${*:-} |"
@@ -259,6 +268,10 @@ function add_vote_table
     TP_VOTE_TABLE[${TP_VOTE_COUNTER}]="| ${value} | ${subsystem} | ${calctime} | $* |"
   fi
   ((TP_VOTE_COUNTER=TP_VOTE_COUNTER+1))
+
+  if [[ "${value}" = -1 ]]; then
+    ((RESULT = RESULT + 1))
+  fi
 }
 
 ## @description  Report the JVM version of the given directory
@@ -709,6 +722,7 @@ function yetus_usage
   yetus_add_option "--summarize=<bool>" "Allow tests to summarize results"
   yetus_add_option "--test-parallel=<bool>" "Run multiple tests in parallel (default false in developer mode, true in Jenkins mode)"
   yetus_add_option "--test-threads=<int>" "Number of tests to run in parallel (default defined in ${PROJECT_NAME} build)"
+  yetus_add_option "--tests-filter=<list>" "Lists of tests to turn failures into warnings"
   yetus_add_option "--user-plugins=<dir>" "A directory of user provided plugins. see test-patch.d for examples (default empty)"
   yetus_add_option "--version" "Print release version information and exit"
 
@@ -884,6 +898,9 @@ function parse_args
         # shellcheck disable=SC2034
         TEST_THREADS=${i#*=}
       ;;
+      --tests-filter=*)
+        yetus_comma_to_array VOTE_FILTER "${i#*=}"
+      ;;
       --tpglobaltimer=*)
         GLOBALTIMER=${i#*=}
       ;;
@@ -2272,8 +2289,6 @@ function runtests
 
     verify_patchdir_still_exists
     check_unittests
-
-    (( RESULT = RESULT + $? ))
   fi
 
   for plugin in ${TESTTYPES}; do
@@ -2283,7 +2298,6 @@ function runtests
       yetus_debug "Running ${plugin}_tests"
       #shellcheck disable=SC2086
       ${plugin}_tests
-      (( RESULT = RESULT + $? ))
     fi
   done
 }
@@ -3045,10 +3059,8 @@ prechecks
 
 if [[ "${BUILDMODE}" = patch ]]; then
   patchfiletests
-  ((RESULT=RESULT+$?))
 
   compile_cycle branch
-  ((RESULT=RESULT+$?))
 
   distclean
 
@@ -3058,10 +3070,8 @@ if [[ "${BUILDMODE}" = patch ]]; then
 fi
 
 compile_cycle patch
-((RESULT=RESULT+$?))
 
 runtests
-((RESULT=RESULT+$?))
 
 finish_vote_table
 


[19/23] yetus git commit: YETUS-373. build driver: maven install should be smarter

Posted by aw...@apache.org.
YETUS-373. build driver: maven install should be smarter

Signed-off-by: Allen Wittenauer <aw...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/yetus/repo
Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/bcbeae50
Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/bcbeae50
Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/bcbeae50

Branch: refs/heads/YETUS-156
Commit: bcbeae50678a7250d3cd9743548f742ab9ee0e03
Parents: ac9c62e
Author: Allen Wittenauer <aw...@apache.org>
Authored: Tue Apr 12 13:52:33 2016 -0700
Committer: Allen Wittenauer <aw...@apache.org>
Committed: Sun Apr 17 10:14:34 2016 -0700

----------------------------------------------------------------------
 precommit/test-patch.d/maven.sh | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/yetus/blob/bcbeae50/precommit/test-patch.d/maven.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch.d/maven.sh b/precommit/test-patch.d/maven.sh
index 77aab32..d65aeaa 100755
--- a/precommit/test-patch.d/maven.sh
+++ b/precommit/test-patch.d/maven.sh
@@ -523,7 +523,14 @@ function maven_precompile
   fi
 
   if verify_needed_test javac; then
-    need=true
+    # if we are in full build mode, then
+    # there is no need to do an initial install
+    # since we will be doing a full compile from basedir
+    # for projects like hadoop, this saves quite a bit
+    # of time
+    if [[ "${BUILDMODE}" = patch ]]; then
+      need=true
+    fi
   else
     # not everything needs a maven install
     # but quite a few do ...
@@ -542,10 +549,6 @@ function maven_precompile
    return 0
   fi
 
-  if [[ "${BUILDMODE}" = Full ]]; then
-    return 0
-  fi
-
   if [[ "${repostatus}" = branch ]]; then
     big_console_header "maven install: ${PATCH_BRANCH}"
   else


[23/23] yetus git commit: YETUS-376. add ability to write report to an HTML formatted file

Posted by aw...@apache.org.
YETUS-376. add ability to write report to an HTML formatted file

Signed-off-by: Allen Wittenauer <aw...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/yetus/repo
Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/cbd3406d
Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/cbd3406d
Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/cbd3406d

Branch: refs/heads/YETUS-156
Commit: cbd3406d2790190eb3cf4d80c840edb1e84558c4
Parents: 779945e
Author: Allen Wittenauer <aw...@apache.org>
Authored: Wed Apr 13 21:40:13 2016 -0700
Committer: Allen Wittenauer <aw...@apache.org>
Committed: Sun Apr 17 10:14:34 2016 -0700

----------------------------------------------------------------------
 .../in-progress/precommit-advanced.md           |   5 +
 precommit/test-patch.d/htmlout.sh               | 231 +++++++++++++++++++
 precommit/test-patch.sh                         |   9 +-
 3 files changed, 242 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/yetus/blob/cbd3406d/asf-site-src/source/documentation/in-progress/precommit-advanced.md
----------------------------------------------------------------------
diff --git a/asf-site-src/source/documentation/in-progress/precommit-advanced.md b/asf-site-src/source/documentation/in-progress/precommit-advanced.md
index d64392a..953b44e 100644
--- a/asf-site-src/source/documentation/in-progress/precommit-advanced.md
+++ b/asf-site-src/source/documentation/in-progress/precommit-advanced.md
@@ -80,6 +80,9 @@ Similarly, there are other functions that may be defined during the test-patch r
 * pluginname\_initialize
     - After argument parsing and prior to any other work, the initialize step allows a plug-in to do any precursor work, set internal defaults, etc.
 
+* pluginname\_docker\_support
+    - Perform any necessary setup to configure Docker support for the given plugin.  Typically this means adding parameters to the docker run command line via adding to the DOCKER\_EXTRAARGS array.
+
 * pluginname\_precheck
     - executed prior to the patch being applied but after the git repository is setup.  Returning a fail status here will exit test-patch.
 
@@ -253,6 +256,8 @@ There are a handful of extremely important system variables that make life easie
 
 * CHANGED\_MODULES[@] is an array of all modules that house all of the CHANGED\_FILES[@].  Be aware that the root of the source tree is reported as '.'.
 
+* DOCKER\_EXTRAARGS[@] is an array of command line arguments to apply to the `docker run` command.
+
 * GITHUB\_REPO is to help test-patch when talking to Github.  If test-patch is given just a number on the command line, it will default to using this repo to determine the pull request.
 
 * JIRA\_ISSUE\_RE is to help test-patch when talking to JIRA.  It helps determine if the given project is appropriate for the given JIRA issue.

http://git-wip-us.apache.org/repos/asf/yetus/blob/cbd3406d/precommit/test-patch.d/htmlout.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch.d/htmlout.sh b/precommit/test-patch.d/htmlout.sh
new file mode 100755
index 0000000..29af898
--- /dev/null
+++ b/precommit/test-patch.d/htmlout.sh
@@ -0,0 +1,231 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# This bug system provides github integration
+
+add_bugsystem htmlout
+
+## @description  Usage info for htmlout plugin
+## @audience     private
+## @stability    evolving
+## @replaceable  no
+function htmlout_usage
+{
+  yetus_add_option "--html-report-file=<file>" "Save the final report to an HTML-formated file"
+}
+
+## @description  Option parsing for htmlout plugin
+## @audience     private
+## @stability    evolving
+## @replaceable  no
+function htmlout_parse_args
+{
+  declare i
+  declare fn
+
+  for i in "$@"; do
+    case ${i} in
+      --html-report-file=*)
+        fn=${i#*=}
+      ;;
+    esac
+  done
+
+  if [[ -n "${fn}" ]]; then
+    touch "${fn}" 2>/dev/null
+    if [[ $? != 0 ]]; then
+      yetus_error "WARNING: cannot create ${fn}. Ignoring."
+    else
+      HTMLOUT_REPORTFILE=$(yetus_abs "${fn}")
+    fi
+  fi
+}
+
+## @description  Give access to the HTML report file in docker mode
+## @audience     private
+## @stability    evolving
+## @replaceable  no
+function htmlout_docker_support
+{
+  if [[ -n ${HTMLOUT_REPORTFILE} ]]; then
+    DOCKER_EXTRAARGS=("${DOCKER_EXTRAARGS[@]}" "-v" "${HTMLOUT_REPORTFILE}:${HTMLOUT_REPORTFILE}")
+  fi
+}
+
+
+## @description  Write out an HTML version of the final report to a file
+## @audience     private
+## @stability    evolving
+## @replaceable  no
+## @param        runresult
+function htmlout_finalreport
+{
+  declare result=$1
+  declare i
+  declare commentfile="${HTMLOUT_REPORTFILE}"
+  declare comment
+  declare vote
+  declare ourstring
+  declare ela
+  declare subs
+  declare color
+  declare comment
+
+  rm "${commentfile}" 2>/dev/null
+
+  if [[ -z "${HTMLOUT_REPORTFILE}" ]]; then
+    return
+  fi
+
+  big_console_header "Writing HTML to ${commentfile}"
+
+  {
+    echo "<table><tbody>"
+
+    if [[ ${result} == 0 ]]; then
+      echo "<tr><th><font color=\"green\">+1 overall</font></th></tr>"
+    else
+      echo "<tr><th><font color=\"red\">-1 overall</font></th></tr>"
+    fi
+    echo "</table></tbody>"
+    echo "<p></p>"
+  } >  "${commentfile}"
+
+  i=0
+  until [[ $i -eq ${#TP_HEADER[@]} ]]; do
+    ourstring=$(echo "${TP_HEADER[${i}]}" | tr -s ' ')
+    comment=$(echo "${ourstring}"  | cut -f2 -d\|)
+    printf "<tr><td>%s</td></tr>\n" "${comment}"
+    ((i=i+1))
+  done
+
+  {
+    echo "<table><tbody>"
+    echo "<tr>"
+    echo "<th>Vote</th>"
+    echo "<th>Subsystem</th>"
+    echo "<th>Runtime</th>"
+    echo "<th>Comment</th>"
+    echo "</tr>"
+  } >> "${commentfile}"
+
+  i=0
+  until [[ $i -eq ${#TP_VOTE_TABLE[@]} ]]; do
+    ourstring=$(echo "${TP_VOTE_TABLE[${i}]}" | tr -s ' ')
+    vote=$(echo "${ourstring}" | cut -f2 -d\| | tr -d ' ')
+    subs=$(echo "${ourstring}"  | cut -f3 -d\|)
+    ela=$(echo "${ourstring}" | cut -f4 -d\|)
+    comment=$(echo "${ourstring}"  | cut -f5 -d\|)
+
+    # summary line
+    if [[ -z ${vote}
+      && -n ${ela} ]]; then
+      color="black"
+    elif [[ -z ${vote} ]]; then
+      # keep same color
+      true
+    else
+      # new vote line
+      case ${vote} in
+        1|"+1")
+          color="green"
+        ;;
+        -1)
+          color="red"
+        ;;
+        0)
+          color="blue"
+        ;;
+        *)
+          color="black"
+        ;;
+      esac
+    fi
+
+    {
+      echo "<tr>"
+      printf "<td><font color=\"%s\">%s</font></td>" "${color}" "${vote}"
+      printf "<td><font color=\"%s\">%s</font></td>" "${color}" "${subs}"
+      printf "<td><font color=\"%s\">%s</font></td>" "${color}" "${ela}"
+      printf "<td><font color=\"%s\">%s</font></td>" "${color}" "${comment}"
+      echo "</tr>"
+    } >> "${commentfile}"
+    ((i=i+1))
+  done
+  {
+    echo "</tbody></table>"
+    echo "<p></p>"
+  } >> "${commentfile}"
+
+  if [[ ${#TP_TEST_TABLE[@]} -gt 0 ]]; then
+    {
+      echo "<table><tbody>"
+      echo "<tr>"
+      echo "<th>Reason</th>"
+      echo "<th>Tests</th>"
+      echo "</tr>"
+    } >> "${commentfile}"
+
+    i=0
+    until [[ $i -eq ${#TP_TEST_TABLE[@]} ]]; do
+      ourstring=$(echo "${TP_TEST_TABLE[${i}]}" | tr -s ' ')
+      subs=$(echo "${ourstring}"  | cut -f2 -d\|)
+      comment=$(echo "${ourstring}"  | cut -f3 -d\|)
+      {
+        echo "<tr>"
+        printf "<td><font color=\"%s\">%s</font></td>" "${color}" "${subs}"
+        printf "<td><font color=\"%s\">%s</font></td>" "${color}" "${comment}"
+        echo "</tr>"
+      } >> "${commentfile}"
+      ((i=i+1))
+    done
+
+    {
+      echo "</tbody></table>"
+      echo "<p></p>"
+    } >> "${commentfile}"
+  fi
+
+  {
+    echo "<table><tbody>"
+    echo "<tr>"
+    echo "<th>Subsystem</th>"
+    echo "<th>Report/Notes</th>"
+    echo "</tr>"
+  } >> "${commentfile}"
+
+  i=0
+  until [[ $i -eq ${#TP_FOOTER_TABLE[@]} ]]; do
+    ourstring=$(echo "${TP_FOOTER_TABLE[${i}]}" |
+              ${SED} -e "s,@@BASE@@,${BUILD_URL}${BUILD_URL_ARTIFACTS},g" |
+              tr -s ' ')
+    subs=$(echo "${ourstring}"  | cut -f2 -d\|)
+    comment=$(echo "${ourstring}"  | cut -f3 -d\|)
+    {
+      echo "<tr>"
+      printf "<td><font color=\"%s\">%s</font></td>" "${color}" "${subs}"
+      printf "<td><font color=\"%s\">%s</font></td>" "${color}" "${comment}"
+      echo "</tr>"
+    } >> "${commentfile}"
+    ((i=i+1))
+  done
+  {
+    echo "</tbody></table>"
+    echo "<p></p>"
+  } >> "${commentfile}"
+
+  printf "<p>This message was automatically generated.</p>" >> "${commentfile}"
+}

http://git-wip-us.apache.org/repos/asf/yetus/blob/cbd3406d/precommit/test-patch.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch.sh b/precommit/test-patch.sh
index 6d36819..05a075e 100755
--- a/precommit/test-patch.sh
+++ b/precommit/test-patch.sh
@@ -1633,6 +1633,7 @@ function check_reexec
   declare tpdir
   declare copy=false
   declare testdir
+  declare plugin
 
   if [[ ${REEXECED} == true ]]; then
     big_console_header "Re-exec mode detected. Continuing."
@@ -1693,9 +1694,11 @@ function check_reexec
     # if we are doing docker, then we re-exec, but underneath the
     # container
 
-    if declare -f ${BUILDTOOL}_docker_support >/dev/null; then
-      "${BUILDTOOL}_docker_support"
-    fi
+    for plugin in ${PROJECT_NAME} ${BUILDTOOL} ${BUGSYSTEMS} ${TESTTYPES} ${TESTFORMATS}; do
+      if declare -f ${plugin}_docker_support >/dev/null; then
+        "${plugin}_docker_support"
+      fi
+    done
 
     TESTPATCHMODE="${USER_PARAMS[*]}"
     if [[ -n "${BUILD_URL}" ]]; then


[07/23] yetus git commit: YETUS-347. change docker handler to use arrays

Posted by aw...@apache.org.
YETUS-347. change docker handler to use arrays

Signed-off-by: Allen Wittenauer <aw...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/yetus/repo
Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/dde4962a
Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/dde4962a
Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/dde4962a

Branch: refs/heads/YETUS-156
Commit: dde4962a04ec10f6349f33dd23fcb29db0517b98
Parents: dc63c86
Author: Allen Wittenauer <aw...@apache.org>
Authored: Tue Mar 29 13:17:19 2016 -0700
Committer: Allen Wittenauer <aw...@apache.org>
Committed: Sun Apr 17 10:13:31 2016 -0700

----------------------------------------------------------------------
 .../in-progress/precommit-buildtools.md         |  2 +-
 precommit/core.d/docker.sh                      | 21 ++++++++---------
 .../test-patch-docker/launch-test-patch.sh      | 24 ++++++++++++--------
 precommit/test-patch.d/ant.sh                   |  2 +-
 precommit/test-patch.d/gradle.sh                |  2 +-
 precommit/test-patch.d/maven.sh                 |  5 ++--
 6 files changed, 28 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/yetus/blob/dde4962a/asf-site-src/source/documentation/in-progress/precommit-buildtools.md
----------------------------------------------------------------------
diff --git a/asf-site-src/source/documentation/in-progress/precommit-buildtools.md b/asf-site-src/source/documentation/in-progress/precommit-buildtools.md
index e800135..bf530ba 100644
--- a/asf-site-src/source/documentation/in-progress/precommit-buildtools.md
+++ b/asf-site-src/source/documentation/in-progress/precommit-buildtools.md
@@ -102,7 +102,7 @@ For example, the gradle build tool does not have a standard way to execute check
 
 * pluginname\_docker\_support
 
-    - If this build tool requires extra settings on the `docker run` command line, this function should be defined and write those options into a file called `${PATCH_DIR}/buildtool-docker-params.txt`.  This is particularly useful for things like mounting volumes for repository caches.
+    - If this build tool requires extra settings on the `docker run` command line, this function should be defined and add those options into an array called `${DOCKER_EXTRAARGS[@]}`. This is particularly useful for things like mounting volumes for repository caches.
 
        **WARNING**: Be aware that directories that do not exist MAY be created by root by Docker itself under certain conditions.  It is HIGHLY recommend that `pluginname_initialize` be used to create the necessary directories prior to be used in the `docker run` command.
 

http://git-wip-us.apache.org/repos/asf/yetus/blob/dde4962a/precommit/core.d/docker.sh
----------------------------------------------------------------------
diff --git a/precommit/core.d/docker.sh b/precommit/core.d/docker.sh
index e0706a3..2d7f550 100755
--- a/precommit/core.d/docker.sh
+++ b/precommit/core.d/docker.sh
@@ -23,6 +23,8 @@ DOCKERFAIL="fallback,continue,fail"
 DOCKERSUPPORT=false
 DOCKER_ENABLE_PRIVILEGED=true
 
+declare -a DOCKER_EXTRAARGS
+
 ####
 #### IMPORTANT
 ####
@@ -531,7 +533,7 @@ function docker_run_image
     cleanup_and_exit 1
   fi
 
-  big_console_header "Building patch image: ${patchimagename}"
+  big_console_header "Building ${BUILDMODE} image: ${patchimagename}"
   start_clock
   # using the base image, make one that is patch specific
   dockercmd build \
@@ -564,14 +566,8 @@ PatchSpecificDocker
     cleanup_and_exit 1
   fi
 
-  if [[ -f "${PATCH_DIR}/buildtool-docker-params.txt" ]]; then
-    extraargs=$(cat "${PATCH_DIR}/buildtool-docker-params.txt")
-  else
-    extraargs=""
-  fi
-
   if [[ "${DOCKER_ENABLE_PRIVILEGED}" = true ]]; then
-    extraargs="${extraargs} --privileged "
+    DOCKER_EXTRAARGS=("--privileged" "${DOCKER_EXTRAARGS[@]}")
   fi
 
   client=$(docker_version Client)
@@ -579,9 +575,8 @@ PatchSpecificDocker
 
   dockerversion="Client=${client} Server=${server}"
   if [[ ${PATCH_DIR} =~ ^/ ]]; then
-    # shellcheck disable=SC2086
     exec "${DOCKERCMD}" run --rm=true -i \
-      ${extraargs} \
+      "${DOCKER_EXTRAARGS[@]}" \
       -v "${PWD}:/testptch/${PROJECT_NAME}" \
       -v "${PATCH_DIR}:/testptch/patchprocess" \
       -u "${USER_NAME}" \
@@ -596,9 +591,8 @@ PatchSpecificDocker
       --name "${containername}" \
       "${patchimagename}"
   else
-    # shellcheck disable=SC2086
     exec "${DOCKERCMD}" run --rm=true -i \
-      ${extraargs} \
+      "${DOCKER_EXTRAARGS[@]}" \
       -v "${PWD}:/testptch/${PROJECT_NAME}" \
       -u "${USER_NAME}" \
       -w "/testptch/${PROJECT_NAME}" \
@@ -612,6 +606,9 @@ PatchSpecificDocker
       --name "${containername}" \
       "${patchimagename}"
   fi
+
+  # this should never get reached, but we put it here just in case
+  cleanup_and_exit 1
 }
 
 ## @description  Switch over to a Docker container

http://git-wip-us.apache.org/repos/asf/yetus/blob/dde4962a/precommit/test-patch-docker/launch-test-patch.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch-docker/launch-test-patch.sh b/precommit/test-patch-docker/launch-test-patch.sh
index aac0d21..a7b040c 100755
--- a/precommit/test-patch-docker/launch-test-patch.sh
+++ b/precommit/test-patch-docker/launch-test-patch.sh
@@ -14,6 +14,11 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+declare -a OVERWRITEARGS=("--reexec")
+
+OVERWRITEARGS=("${OVERWRITEARGS[@]}" "--dockermode")
+OVERWRITEARGS=("${OVERWRITEARGS[@]}" "--basedir=${BASEDIR}")
+
 cd "${BASEDIR}"
 
 if [[ -n ${JAVA_HOME}
@@ -25,6 +30,10 @@ fi
 if [[ -z ${JAVA_HOME} ]]; then
   JAVA_HOME=$(find /usr/lib/jvm/ -name "java-*" -type d | tail -1)
   export JAVA_HOME
+  if [[ -n "${JAVA_HOME}" ]]; then
+    OVERWRITEARGS=("${OVERWRITEARGS[@]}" "--java-home=${JAVA_HOME}")
+    echo "Setting ${JAVA_HOME} as the JAVA_HOME."
+  fi
 fi
 
 # Avoid out of memory errors in builds
@@ -35,9 +44,9 @@ export MAVEN_OPTS
 TESTPATCHMODE=${TESTPATCHMODE/--docker }
 TESTPATCHMODE=${TESTPATCHMODE%--docker}
 
-
-cd "${BASEDIR}"
 PATCH_DIR=$(cd -P -- "${PATCH_DIR}" >/dev/null && pwd -P)
+OVERWRITEARGS=("${OVERWRITEARGS[@]}" "--patch-dir=${PATCH_DIR}")
+OVERWRITEARGS=("${OVERWRITEARGS[@]}" "--user-plugins=${PATCH_DIR}/precommit/user-plugins")
 
 # if patch system is generic, then it's either a local
 # patch file or was in some other way not pulled from a bug
@@ -45,16 +54,11 @@ PATCH_DIR=$(cd -P -- "${PATCH_DIR}" >/dev/null && pwd -P)
 # test-patch where to find it.
 if [[ "${PATCH_SYSTEM}" = generic ]]; then
   cp -p "${PATCH_DIR}/patch" /testptch/extras/patch
-  patchfile="/testptch/extras/patch"
+  OVERWRITEARGS=("${OVERWRITEARGS[@]}" "/testptch/extras/patch")
 fi
 
 cd "${PATCH_DIR}/precommit/"
 #shellcheck disable=SC2086
 "${PATCH_DIR}/precommit/test-patch.sh" \
-   --reexec \
-   --dockermode ${TESTPATCHMODE} \
-   --basedir="${BASEDIR}" \
-   --patch-dir="${PATCH_DIR}" \
-   --java-home="${JAVA_HOME}" \
-   --user-plugins="${PATCH_DIR}/precommit/user-plugins" \
-   ${patchfile}
+   ${TESTPATCHMODE} \
+  "${OVERWRITEARGS[@]}"

http://git-wip-us.apache.org/repos/asf/yetus/blob/dde4962a/precommit/test-patch.d/ant.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch.d/ant.sh b/precommit/test-patch.d/ant.sh
index 64c4067..61e13c9 100755
--- a/precommit/test-patch.d/ant.sh
+++ b/precommit/test-patch.d/ant.sh
@@ -200,5 +200,5 @@ function ant_builtin_personality_file_tests
 
 function ant_docker_support
 {
-  echo "-v ${HOME}/.ivy2:${HOME}/.ivy2" > "${PATCH_DIR}/buildtool-docker-params.txt"
+  DOCKER_EXTRAARGS=("${DOCKER_EXTRAARGS}" "-v" "${HOME}/.ivy2:${HOME}/.ivy2")
 }

http://git-wip-us.apache.org/repos/asf/yetus/blob/dde4962a/precommit/test-patch.d/gradle.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch.d/gradle.sh b/precommit/test-patch.d/gradle.sh
index 57e023d..1f971fa 100755
--- a/precommit/test-patch.d/gradle.sh
+++ b/precommit/test-patch.d/gradle.sh
@@ -277,5 +277,5 @@ function gradle_builtin_personality_file_tests
 
 function gradle_docker_support
 {
-  echo "-v ${HOME}/.gradle:${HOME}/.gradle" > "${PATCH_DIR}/buildtool-docker-params.txt"
+  DOCKER_EXTRAARGS=("${DOCKER_EXTRAARGS[@]}" "-v" "${HOME}/.gradle:${HOME}/.gradle")
 }

http://git-wip-us.apache.org/repos/asf/yetus/blob/dde4962a/precommit/test-patch.d/maven.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch.d/maven.sh b/precommit/test-patch.d/maven.sh
index 2e006c1..1a2a86b 100755
--- a/precommit/test-patch.d/maven.sh
+++ b/precommit/test-patch.d/maven.sh
@@ -554,11 +554,10 @@ function maven_precompile
 
 function maven_docker_support
 {
-  echo "-v ${HOME}/.m2:${HOME}/.m2" > "${PATCH_DIR}/buildtool-docker-params.txt"
+  DOCKER_EXTRAARGS=("${DOCKER_EXTRAARGS[@]}" "-v" "${HOME}/.m2:${HOME}/.m2")
 
   if [[ ${MAVEN_CUSTOM_REPOS} = true ]]; then
-    echo "-v ${MAVEN_CUSTOM_REPOS_DIR}:${MAVEN_CUSTOM_REPOS_DIR}" \
-      >> "${PATCH_DIR}/buildtool-docker-params.txt"
+    DOCKER_EXTRAARGS=("${DOCKER_EXTRAARGS[@]}" "-v" "${MAVEN_CUSTOM_REPOS_DIR}:${MAVEN_CUSTOM_REPOS_DIR}")
   fi
 }
 


[11/23] yetus git commit: YETUS-357. build driver for hadoop shouldn't union unit tests

Posted by aw...@apache.org.
YETUS-357. build driver for hadoop shouldn't union unit tests

Signed-off-by: Allen Wittenauer <aw...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/yetus/repo
Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/606f816c
Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/606f816c
Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/606f816c

Branch: refs/heads/YETUS-156
Commit: 606f816c02b26dc5f472696e629077bec8cd969e
Parents: 1d628e0
Author: Allen Wittenauer <aw...@apache.org>
Authored: Tue Apr 12 09:03:20 2016 -0700
Committer: Allen Wittenauer <aw...@apache.org>
Committed: Sun Apr 17 10:14:34 2016 -0700

----------------------------------------------------------------------
 precommit/personality/hadoop.sh | 10 ++++++++--
 precommit/test-patch.d/maven.sh | 10 ++++++++++
 2 files changed, 18 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/yetus/blob/606f816c/precommit/personality/hadoop.sh
----------------------------------------------------------------------
diff --git a/precommit/personality/hadoop.sh b/precommit/personality/hadoop.sh
index d23b6be..5b96994 100755
--- a/precommit/personality/hadoop.sh
+++ b/precommit/personality/hadoop.sh
@@ -46,8 +46,12 @@ function hadoop_order
 
   if [[ ${ordering} = normal ]]; then
     hadoopm="${CHANGED_MODULES[*]}"
-  elif  [[ ${ordering} = union ]]; then
+  elif [[ ${ordering} = union ]]; then
     hadoopm="${CHANGED_UNION_MODULES}"
+  elif [[ ${ordering} = mvnsrc ]]; then
+    hadoopm="${MAVEN_SRC_MODULES[*]}"
+  elif [[ ${ordering} = mvnsrctest ]]; then
+    hadoopm="${MAVEN_SRCTEST_MODULES[*]}"
   else
     hadoopm="${ordering}"
   fi
@@ -236,7 +240,9 @@ function personality_modules
       fi
     ;;
     unit)
-      if [[ "${CHANGED_MODULES[*]}" =~ \. ]]; then
+      if [[ "${BUILDMODE}" = full ]]; then
+        ordering=mvnsrc
+      elif [[ "${CHANGED_MODULES[*]}" =~ \. ]]; then
         ordering=.
       fi
 

http://git-wip-us.apache.org/repos/asf/yetus/blob/606f816c/precommit/test-patch.d/maven.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch.d/maven.sh b/precommit/test-patch.d/maven.sh
index 32f4b37..77aab32 100755
--- a/precommit/test-patch.d/maven.sh
+++ b/precommit/test-patch.d/maven.sh
@@ -685,6 +685,16 @@ function maven_reorder_modules
   yetus_debug "Maven: finish re-ordering modules"
   yetus_debug "Finished list: ${CHANGED_MODULES[*]}"
 
+  # build some utility module lists for maven modules
+  for index in "${CHANGED_MODULES[@]}"; do
+    if [[ -d "${index}/src" ]]; then
+      MAVEN_SRC_MODULES=("${MAVEN_SRC_MODULES[@]}" "${index}")
+      if [[ -d "${index}/src/test" ]]; then
+        MAVEN_SRCTEST_MODULES=("${MAVEN_SRCTEST_MODULES[@]}" "${index}")
+      fi
+    fi
+  done
+
   if [[ "${BUILDMODE}" = patch ]]; then
     add_vote_table 0 mvndep "Maven dependency ordering for ${repostatus}"
   else


[14/23] yetus git commit: YETUS-353. runtime wrapper for build driver

Posted by aw...@apache.org.
YETUS-353. runtime wrapper for build driver

Signed-off-by: Allen Wittenauer <aw...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/yetus/repo
Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/867bc9cb
Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/867bc9cb
Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/867bc9cb

Branch: refs/heads/YETUS-156
Commit: 867bc9cb166f3cab0c57b6439781adb745c27523
Parents: 882b1b7
Author: Allen Wittenauer <aw...@apache.org>
Authored: Tue Mar 29 17:12:43 2016 -0700
Committer: Allen Wittenauer <aw...@apache.org>
Committed: Sun Apr 17 10:14:34 2016 -0700

----------------------------------------------------------------------
 build.sh                | 4 +++-
 precommit/test-patch.sh | 8 +++++++-
 2 files changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/yetus/blob/867bc9cb/build.sh
----------------------------------------------------------------------
diff --git a/build.sh b/build.sh
index 8be3911..0eee9a3 100755
--- a/build.sh
+++ b/build.sh
@@ -167,11 +167,13 @@ cp -r shelldocs "${bin_tarball}/lib/"
 cp -r release-doc-maker "${bin_tarball}/lib/"
 
 cp -r precommit "${bin_tarball}/lib/"
+ln -s test-patch.sh "${bin_tarball}/lib/precommit/qbt.sh"
 
 mkdir -p "${bin_tarball}/bin"
 
 for utility in shelldocs/shelldocs.py release-doc-maker/releasedocmaker.py \
-               precommit/smart-apply-patch.sh precommit/test-patch.sh
+               precommit/smart-apply-patch.sh precommit/test-patch.sh \
+               precommit/qbt.sh
 do
   wrapper=${utility##*/}
   wrapper=${wrapper%.*}

http://git-wip-us.apache.org/repos/asf/yetus/blob/867bc9cb/precommit/test-patch.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch.sh b/precommit/test-patch.sh
index 23e7c3a..f3dbc92 100755
--- a/precommit/test-patch.sh
+++ b/precommit/test-patch.sh
@@ -25,6 +25,8 @@ fi
 
 this="${BASH_SOURCE-$0}"
 BINDIR=$(cd -P -- "$(dirname -- "${this}")" >/dev/null && pwd -P)
+BINNAME=${this##*/}
+BINNAME=${BINNAME%.sh}
 STARTINGDIR=$(pwd)
 USER_PARAMS=("$@")
 GLOBALTIMER=$(date +"%s")
@@ -3031,7 +3033,11 @@ function import_core
 
 import_core
 
-initialize "$@"
+if [[ "${BINNAME}" =~ qbt ]]; then
+  initialize --empty-patch "$@"
+else
+  initialize "$@"
+fi
 
 prechecks