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 082A3200D29 for ; Thu, 26 Oct 2017 17:02:01 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 06C66160BF2; Thu, 26 Oct 2017 15:02:01 +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 4D1BE1609E8 for ; Thu, 26 Oct 2017 17:02:00 +0200 (CEST) Received: (qmail 32335 invoked by uid 500); 26 Oct 2017 15:01:59 -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 32326 invoked by uid 99); 26 Oct 2017 15:01:59 -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; Thu, 26 Oct 2017 15:01:59 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 84A35DFC00; Thu, 26 Oct 2017 15:01:56 +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-553 Add configuration options for junit plugin Date: Thu, 26 Oct 2017 15:01:56 +0000 (UTC) archived-at: Thu, 26 Oct 2017 15:02:01 -0000 Repository: yetus Updated Branches: refs/heads/master 2ce16aa2e -> 7e7dcbe65 YETUS-553 Add configuration options for junit plugin Signed-off-by: Sean Busbey Project: http://git-wip-us.apache.org/repos/asf/yetus/repo Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/7e7dcbe6 Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/7e7dcbe6 Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/7e7dcbe6 Branch: refs/heads/master Commit: 7e7dcbe6561a478488330673ec534b6fb6ce33c4 Parents: 2ce16aa Author: Mano Kovacs Authored: Mon Oct 2 20:28:28 2017 +0200 Committer: Sean Busbey Committed: Sun Oct 22 01:05:34 2017 -0500 ---------------------------------------------------------------------- precommit/test-patch.d/junit.sh | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/yetus/blob/7e7dcbe6/precommit/test-patch.d/junit.sh ---------------------------------------------------------------------- diff --git a/precommit/test-patch.d/junit.sh b/precommit/test-patch.d/junit.sh index 4393511..0bbe23e 100755 --- a/precommit/test-patch.d/junit.sh +++ b/precommit/test-patch.d/junit.sh @@ -19,6 +19,31 @@ add_test_format junit JUNIT_TEST_TIMEOUTS="" JUNIT_FAILED_TESTS="" +JUNIT_TEST_OUTPUT_DIR="." +JUNIT_TEST_PREFIX="org.apache." + +function junit_usage +{ + yetus_add_option "--junit-test-output=" "Directory to search for the test output TEST-*.xml files, relative to the module directory (default:'${JUNIT_TEST_OUTPUT_DIR}')" + yetus_add_option "--junit-test-prefix=" "Prefix of test names to be be removed. Used to shorten test names by removing common package name. (default:'${JUNIT_TEST_PREFIX}')" +} + +function junit_parse_args +{ + declare i + + for i in "$@"; do + case ${i} in + --junit-test-output=*) + JUNIT_TEST_OUTPUT_DIR=${i#*=} + ;; + --junit-test-prefix=*) + JUNIT_TEST_PREFIX=${i#*=} + ;; + esac + done +} + function junit_process_tests { # shellcheck disable=SC2034 @@ -36,10 +61,9 @@ function junit_process_tests fi #shellcheck disable=SC2026,SC2038,SC2016 - module_failed_tests=$(find . -name 'TEST*.xml'\ + module_failed_tests=$(find "${JUNIT_TEST_OUTPUT_DIR}" -name 'TEST*.xml'\ | xargs "${GREP}" -l -E "