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 Tue, 11 Aug 2015 14:49:23 GMT
Repository: hadoop
Updated Branches:
  refs/heads/HADOOP-12111 16e792cf7 -> 96f27450c


 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/96f27450
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/96f27450
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/96f27450

Branch: refs/heads/HADOOP-12111
Commit: 96f27450cc603053e4af54a7a2eec30bae3d6fc5
Parents: 16e792c
Author: Allen Wittenauer <aw@apache.org>
Authored: Tue Aug 11 07:49:15 2015 -0700
Committer: Allen Wittenauer <aw@apache.org>
Committed: Tue Aug 11 07:49:15 2015 -0700

----------------------------------------------------------------------
 dev-support/test-patch.d/tap.sh | 80 ++++++++++++++++++++++++++++++++++++
 1 file changed, 80 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/96f27450/dev-support/test-patch.d/tap.sh
----------------------------------------------------------------------
diff --git a/dev-support/test-patch.d/tap.sh b/dev-support/test-patch.d/tap.sh
new file mode 100755
index 0000000..c6796a8
--- /dev/null
+++ b/dev-support/test-patch.d/tap.sh
@@ -0,0 +1,80 @@
+#!/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.
+
+add_test_format tap
+
+TAP_FAILED_TESTS=""
+TAP_LOG_DIR="target/tap"
+
+function tap_process_args
+{
+  declare i
+
+  for i in "$@"; do
+    case ${i} in
+      --tap-log-dir=*)
+        TAP_LOG_DIR=${i#=*}
+      ;;
+    esac
+  done
+}
+
+function tap_usage
+{
+  echo "TAP Options:"
+  echo "--tap-log-dir=<dir>    Directory relative to the module for tap output (default:
\"target/tap\")"
+}
+
+function tap_process_tests
+{
+  # shellcheck disable=SC2034
+  declare module=$1
+  # shellcheck disable=SC2034
+  declare buildlogfile=$2
+  declare filefrag=$3
+  declare result=0
+  declare module_failed_tests
+  declare filenames
+
+  filenames=$(find "${TAP_LOG_DIR}" -type f -exec "${GREP}" -l -E "not ok " {} \;)
+
+  if [[ -n "${filenames}" ]]; then
+    module_failed_tests=$(echo "${filenames}" \
+      | sed -e "s,${TAP_LOG_DIR},,g" -e s,^/,,g )
+    # shellcheck disable=SC2086
+    cat ${filenames} >> "${PATCH_DIR}/patch-${filefrag}.tap"
+    TAP_LOGS="${TAP_LOGS} @@BASE@@/patch-${filefrag}.tap"
+    TAP_FAILED_TESTS="${TAP_FAILED_TESTS} ${module_failed_tests}"
+    ((result=result+1))
+  fi
+
+  if [[ ${result} -gt 0 ]]; then
+    return 1
+  fi
+  return 0
+}
+
+function tap_finalize_results
+{
+  declare jdk=$1
+
+  if [[ -n "${TAP_FAILED_TESTS}" ]] ; then
+    # shellcheck disable=SC2086
+    populate_test_table "${jdk}Failed junit tests" ${TAP_FAILED_TESTS}
+    TAP_FAILED_TESTS=""
+    add_footer_table "TAP logs" "${TAP_LOGS}"
+  fi
+}


Mime
View raw message