hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject hadoop git commit: HADOOP-12248. Add native support for TAP (aw)
Date Mon, 10 Aug 2015 18:10:44 GMT
Repository: hadoop
Updated Branches:
  refs/heads/HADOOP-12111 3d888ecc5 -> 872606974


HADOOP-12248. Add native support for TAP (aw)


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

Branch: refs/heads/HADOOP-12111
Commit: 872606974bdfa494fb4f165d682718db2a85bca6
Parents: 3d888ec
Author: Allen Wittenauer <aw@apache.org>
Authored: Mon Aug 10 11:10:36 2015 -0700
Committer: Allen Wittenauer <aw@apache.org>
Committed: Mon Aug 10 11:10:36 2015 -0700

----------------------------------------------------------------------
 dev-support/personality/hadoop.sh               | 74 ++++++++++++++++++++
 dev-support/test-patch.d/builtin-personality.sh | 22 +++---
 dev-support/test-patch.d/shellcheck.sh          |  2 +-
 dev-support/test-patch.sh                       | 40 +++++++++--
 4 files changed, 122 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/87260697/dev-support/personality/hadoop.sh
----------------------------------------------------------------------
diff --git a/dev-support/personality/hadoop.sh b/dev-support/personality/hadoop.sh
index 60dbb3d..1243a17 100755
--- a/dev-support/personality/hadoop.sh
+++ b/dev-support/personality/hadoop.sh
@@ -253,6 +253,26 @@ function personality_modules
       #fi
       needflags=true
       hadoop_unittest_prereqs
+
+      verify_needed_test javac
+      if [[ $? == 0 ]]; then
+        yetus_debug "hadoop: javac not requested"
+        verify_needed_test native
+        if [[ $? == 0 ]]; then
+          yetus_debug "hadoop: native not requested"
+          yetus_debug "hadoop: adding -DskipTests to unit test"
+          extra="-DskipTests"
+        fi
+      fi
+
+      verify_needed_test shellcheck
+      if [[ $? == 0
+          && ! ${CHANGED_FILES} =~ \.bats ]]; then
+        yetus_debug "hadoop: NO shell code change detected; disabling shelltest profile"
+        extra="${extra} -P!shelltest"
+      else
+        extra="${extra} -Pshelltest"
+      fi
     ;;
     *)
       extra="-DskipTests"
@@ -272,3 +292,57 @@ function personality_modules
   done
 }
 
+function personality_file_tests
+{
+  local filename=$1
+
+  yetus_debug "Using Hadoop-specific personality_file_tests"
+
+  if [[ ${filename} =~ src/main/webapp ]]; then
+    yetus_debug "tests/webapp: ${filename}"
+  elif [[ ${filename} =~ \.sh
+       || ${filename} =~ \.cmd
+       || ${filename} =~ src/scripts
+       || ${filename} =~ src/test/scripts
+       ]]; then
+    yetus_debug "tests/shell: ${filename}"
+    add_test unit
+  elif [[ ${filename} =~ \.md$
+       || ${filename} =~ \.md\.vm$
+       || ${filename} =~ src/site
+       ]]; then
+    yetus_debug "tests/site: ${filename}"
+    add_test site
+  elif [[ ${filename} =~ \.c$
+       || ${filename} =~ \.cc$
+       || ${filename} =~ \.h$
+       || ${filename} =~ \.hh$
+       || ${filename} =~ \.proto$
+       || ${filename} =~ \.cmake$
+       || ${filename} =~ CMakeLists.txt
+       ]]; then
+    yetus_debug "tests/units: ${filename}"
+    add_test cc
+    add_test unit
+    add_test javac
+  elif [[ ${filename} =~ build.xml$
+       || ${filename} =~ pom.xml$
+       || ${filename} =~ \.java$
+       || ${filename} =~ src/main
+       ]]; then
+      yetus_debug "tests/javadoc+units: ${filename}"
+      add_test javac
+      add_test javadoc
+      add_test mvninstall
+      add_test unit
+  fi
+
+  if [[ ${filename} =~ src/test ]]; then
+    yetus_debug "tests"
+    add_test unit
+  fi
+
+  if [[ ${filename} =~ \.java$ ]]; then
+    add_test findbugs
+  fi
+}

http://git-wip-us.apache.org/repos/asf/hadoop/blob/87260697/dev-support/test-patch.d/builtin-personality.sh
----------------------------------------------------------------------
diff --git a/dev-support/test-patch.d/builtin-personality.sh b/dev-support/test-patch.d/builtin-personality.sh
index dc944e4..4be3bfa 100755
--- a/dev-support/test-patch.d/builtin-personality.sh
+++ b/dev-support/test-patch.d/builtin-personality.sh
@@ -55,6 +55,8 @@ function builtin_mvn_personality_file_tests
     yetus_debug "tests/webapp: ${filename}"
   elif [[ ${filename} =~ \.sh
        || ${filename} =~ \.cmd
+       || ${filename} =~ src/main/scripts
+       || ${filename} =~ src/test/scripts
        ]]; then
     yetus_debug "tests/shell: ${filename}"
   elif [[ ${filename} =~ \.md$
@@ -69,29 +71,31 @@ function builtin_mvn_personality_file_tests
        || ${filename} =~ \.h$
        || ${filename} =~ \.hh$
        || ${filename} =~ \.proto$
-       || ${filename} =~ src/test
        || ${filename} =~ \.cmake$
        || ${filename} =~ CMakeLists.txt
        ]]; then
     yetus_debug "tests/units: ${filename}"
+    add_test cc
+    add_test unit
+  elif [[ ${filename} =~ \.scala$ ]]; then
     add_test javac
-    add_test mvninstall
     add_test unit
-  elif [[ ${filename} =~ pom.xml$
+    add_test mvninstall
+  elif [[ ${filename} =~ build.xml$
+       || ${filename} =~ pom.xml$
        || ${filename} =~ \.java$
-       || ${filename} =~ \.scala$
        || ${filename} =~ src/main
        ]]; then
-    if [[ ${filename} =~ src/main/bin
-       || ${filename} =~ src/main/sbin ]]; then
-      yetus_debug "tests/shell: ${filename}"
-    else
       yetus_debug "tests/javadoc+units: ${filename}"
       add_test javac
       add_test javadoc
       add_test mvninstall
       add_test unit
-    fi
+  fi
+
+  if [[ ${filename} =~ src/test ]]; then
+    yetus_debug "tests"
+    add_test unit
   fi
 
   if [[ ${filename} =~ \.java$ ]]; then

http://git-wip-us.apache.org/repos/asf/hadoop/blob/87260697/dev-support/test-patch.d/shellcheck.sh
----------------------------------------------------------------------
diff --git a/dev-support/test-patch.d/shellcheck.sh b/dev-support/test-patch.d/shellcheck.sh
index 14d1d18..4d17768 100755
--- a/dev-support/test-patch.d/shellcheck.sh
+++ b/dev-support/test-patch.d/shellcheck.sh
@@ -56,7 +56,7 @@ function shellcheck_private_findbash
       fi
       list="${list} ${i}"
     done
-  done < <(find . -type d -name bin -o -type d -name sbin -o -type d -name libexec
-o -type d -name shellprofile.d)
+  done < <(find . -type d -name bin -o -type d -name sbin -o -type d -name scripts
-o -type d -name libexec -o -type d -name shellprofile.d)
   # shellcheck disable=SC2086
   echo ${list} ${SHELLCHECK_SPECIFICFILES} | tr ' ' '\n' | sort -u
 }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/87260697/dev-support/test-patch.sh
----------------------------------------------------------------------
diff --git a/dev-support/test-patch.sh b/dev-support/test-patch.sh
index 446d5cf..4dd15e6 100755
--- a/dev-support/test-patch.sh
+++ b/dev-support/test-patch.sh
@@ -30,6 +30,8 @@ BINDIR=$(cd -P -- "$(dirname -- "${this}")" >/dev/null && pwd
-P)
 STARTINGDIR=$(pwd)
 USER_PARAMS=("$@")
 GLOBALTIMER=$(date +"%s")
+#shellcheck disable=SC2034
+QATESTMODE=false
 
 # global arrays
 declare -a MAVEN_ARGS=("--batch-mode")
@@ -1177,6 +1179,7 @@ function find_changed_modules
   #shellcheck disable=SC2086,SC2116
   CHANGED_UNFILTERED_MODULES=$(echo ${CHANGED_UNFILTERED_MODULES})
 
+
   if [[ ${BUILDTOOL} = maven ]]; then
     # Filter out modules without code
     for module in ${builddirs}; do
@@ -1786,7 +1789,7 @@ function copytpbits
 
   # if we've already copied, then don't bother doing it again
   if [[ ${STARTDIR} == ${PATCH_DIR}/precommit ]]; then
-    hadoop_debug "Skipping copytpbits; already copied once"
+    yetus_debug "Skipping copytpbits; already copied once"
     return
   fi
 
@@ -2942,6 +2945,7 @@ function populate_test_table
 function check_unittests
 {
   local i
+  local testsys
   local test_logfile
   local result=0
   local -r savejavahome=${JAVA_HOME}
@@ -2949,6 +2953,9 @@ function check_unittests
   local jdk=""
   local jdkindex=0
   local statusjdk
+  local formatresult=0
+  local needlog
+  local unitlogs
 
   big_console_header "Running unit tests"
 
@@ -2976,7 +2983,7 @@ function check_unittests
     personality_modules patch unit
     case ${BUILDTOOL} in
       maven)
-        modules_workers patch unit clean install -fae
+        modules_workers patch unit clean test -fae
       ;;
       ant)
         modules_workers patch unit
@@ -3002,13 +3009,23 @@ function check_unittests
 
       pushd "${MODULE[${i}]}" >/dev/null
 
-      for j in ${TESTSYSTEMS}; do
-        if declare -f ${j}_process_tests; then
-          "${j}_process_tests" "${module}" "${test_logfile}"
-          ((results=results+$?))
+      needlog=0
+      for testsys in ${TESTFORMATS}; do
+        if declare -f ${testsys}_process_tests >/dev/null; then
+          yetus_debug "Calling ${testsys}_process_tests"
+          "${testsys}_process_tests" "${module}" "${test_logfile}" "${fn}"
+          formatresult=$?
+          ((results=results+formatresult))
+          if [[ "${formatresult}" != 0 ]]; then
+            needlog=1
+          fi
         fi
       done
 
+      if [[ ${needlog} == 1 ]]; then
+        unitlogs="${unitlogs} @@BASE@@/patch-unit-${fn}.txt"
+      fi
+
       popd >/dev/null
 
       ((i=i+1))
@@ -3017,10 +3034,21 @@ function check_unittests
   done
   JAVA_HOME=${savejavahome}
 
+  if [[ -n "${unitlogs}" ]]; then
+    add_footer_table "unit test logs" "${unitlogs}"
+  fi
+
   if [[ ${JENKINS} == true ]]; then
     add_footer_table "${statusjdk} Test Results" "${BUILD_URL}testReport/"
   fi
 
+  for testsys in ${TESTFORMATS}; do
+    if declare -f ${testsys}_finalize_results >/dev/null; then
+      yetus_debug "Calling ${testsys}_finalize_results"
+      "${testsys}_finalize_results" "${statusjdk}"
+    fi
+  done
+
   if [[ ${result} -gt 0 ]]; then
     return 1
   fi


Mime
View raw message