Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id D8D0B200CF3 for ; Wed, 13 Sep 2017 22:03:16 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id D5BB61609CA; Wed, 13 Sep 2017 20:03:16 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 277B71609C3 for ; Wed, 13 Sep 2017 22:03:16 +0200 (CEST) Received: (qmail 64893 invoked by uid 500); 13 Sep 2017 20:03:15 -0000 Mailing-List: contact commits-help@yetus.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@yetus.apache.org Delivered-To: mailing list commits@yetus.apache.org Received: (qmail 64884 invoked by uid 99); 13 Sep 2017 20:03:15 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Sep 2017 20:03:15 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 0B2D7F5697; Wed, 13 Sep 2017 20:03:15 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: busbey@apache.org To: commits@yetus.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: yetus git commit: YETUS-543 Add shaded client related ITs to Hadoop exemplar personality Date: Wed, 13 Sep 2017 20:03:15 +0000 (UTC) archived-at: Wed, 13 Sep 2017 20:03:17 -0000 Repository: yetus Updated Branches: refs/heads/master 3f250f01e -> 4315582d4 YETUS-543 Add shaded client related ITs to Hadoop exemplar personality Signed-off-by: Andrew Wang Project: http://git-wip-us.apache.org/repos/asf/yetus/repo Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/4315582d Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/4315582d Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/4315582d Branch: refs/heads/master Commit: 4315582d495c8b7cc9de4c10b5649863b89e4149 Parents: 3f250f0 Author: Sean Busbey Authored: Sat Sep 9 01:59:46 2017 -0500 Committer: Sean Busbey Committed: Wed Sep 13 14:12:26 2017 -0500 ---------------------------------------------------------------------- precommit/personality/hadoop.sh | 72 ++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/yetus/blob/4315582d/precommit/personality/hadoop.sh ---------------------------------------------------------------------- diff --git a/precommit/personality/hadoop.sh b/precommit/personality/hadoop.sh index 1d7d696..ea52e40 100755 --- a/precommit/personality/hadoop.sh +++ b/precommit/personality/hadoop.sh @@ -38,6 +38,7 @@ function personality_globals GITHUB_REPO="apache/hadoop" #shellcheck disable=SC2034 PYLINT_OPTIONS="--indent-string=' '" + CLIENT_TESTS=() HADOOP_HOMEBREW_DIR=${HADOOP_HOMEBREW_DIR:-$(brew --prefix 2>/dev/null)} if [[ -z "${HADOOP_HOMEBREW_DIR}" ]]; then @@ -458,3 +459,74 @@ function hadoop_console_success printf "ICAgICAgIHwgICBvICAgfCAgCiAgICAgICAgfCB8ICAgfCB8ICAKICAgICAg"; printf "ICB8bXwgICB8bXwgIAo" } + +################################################### +# Hadoop project specific check of IT for shaded artifacts + +add_test_type shadedclient + +## @description check for test modules and add test/plugins as needed +## @audience private +## @stability evolving +function shadedclient_initialize +{ + declare -a modules=() + declare module + + yetus_debug "hadoop personality: initializing client artifacts checks." + for module in hadoop-client-modules/hadoop-client-check-invariants \ + hadoop-client-modules/hadoop-client-check-test-invariants \ + hadoop-client-modules/hadoop-client-integration-tests; do + if [ -d "${module}" ]; then + yetus_debug "hadoop personality: test module '${module}' is present." + modules=( ${modules[@]} -pl ${module} ) + fi + done + if [ ${#modules[@]} -gt 0 ]; then + CLIENT_TESTS=( "${modules[@]}" ) + maven_add_install shadedclient + add_test shadedclient + fi +} + +## @description remove files created by the rebuild function +## @audience private +## @stability evolving +function shadedclient_clean +{ + if [ ${#CLIENT_TESTS[@]} -gt 0 ]; then + yetus_debug "hadoop personality: cleaning up test modules." + "${MAVEN}" "${MAVEN_ARGS[@]}" clean -fae -am "${CLIENT_TESTS[@]}" + fi +} + +## @description build client facing shaded artifacts and test them +## @audience private +## @stability evolving +## @param repostatus +function shadedclient_rebuild +{ + local repostatus=$1 + local logfile="${PATCH_DIR}/${repostatus}-shadedclient.txt" + + if [ ${#CLIENT_TESTS[@]} -eq 0 ]; then + yetus_debug "hadoop personality: no test modules present, skipping." + return 0 + fi + + big_console_header "Checking client artifacts on ${repostatus}" + + echo_and_redirect "${logfile}" \ + "${MAVEN}" "${MAVEN_ARGS[@]}" clean verify -fae --batch-mode -am \ + "${CLIENT_TESTS[@]}" \ + -Dtest=NoUnitTests -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dfindbugs.skip=true + + count=$(${GREP} -c '\[ERROR\]' "${logfile}") + if [[ ${count} -gt 0 ]]; then + add_vote_table -1 shadedclient "${repostatus} has errors when building and testing our client artifacts." + return 1 + fi + + add_vote_table +1 shadedclient "${repostatus} has no errors when building and testing our client artifacts." + return 0 +}