From 9d3800aeb5d9eb621aac61b0828f676710996d9f Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Sun, 8 Sep 2013 18:38:20 +0100 Subject: [PATCH] Re: [PATCH v2] test: exit with nonzero value when not all tests completed successfully --- 3a/d33a717cd5dc1ef2c82dc174e1c247313bbdb2 | 137 ++++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 3a/d33a717cd5dc1ef2c82dc174e1c247313bbdb2 diff --git a/3a/d33a717cd5dc1ef2c82dc174e1c247313bbdb2 b/3a/d33a717cd5dc1ef2c82dc174e1c247313bbdb2 new file mode 100644 index 000000000..5535fe162 --- /dev/null +++ b/3a/d33a717cd5dc1ef2c82dc174e1c247313bbdb2 @@ -0,0 +1,137 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 4CEDD431FB6 + for ; Sun, 8 Sep 2013 10:38:42 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -1.098 +X-Spam-Level: +X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5 + tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001, + NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id gZvDs8sE1tVM for ; + Sun, 8 Sep 2013 10:38:34 -0700 (PDT) +Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id F292F431FAE + for ; Sun, 8 Sep 2013 10:38:33 -0700 (PDT) +Received: from smtp.qmul.ac.uk ([138.37.6.40]) + by mail2.qmul.ac.uk with esmtp (Exim 4.71) + (envelope-from ) + id 1VIiwH-0006FF-Un; Sun, 08 Sep 2013 18:38:24 +0100 +Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost) + by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71) + (envelope-from ) + id 1VIiwH-0005AM-KM; Sun, 08 Sep 2013 18:38:21 +0100 +From: Mark Walters +To: Tomi Ollila , notmuch@notmuchmail.org +Subject: Re: [PATCH v2] test: exit with nonzero value when not all tests + completed successfully +In-Reply-To: <1378655610-21497-1-git-send-email-tomi.ollila@iki.fi> +References: <1378655610-21497-1-git-send-email-tomi.ollila@iki.fi> +User-Agent: Notmuch/0.16 (http://notmuchmail.org) Emacs/23.4.1 + (x86_64-pc-linux-gnu) +Date: Sun, 08 Sep 2013 18:38:20 +0100 +Message-ID: <8738pf8b8z.fsf@qmul.ac.uk> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Sender-Host-Address: 93.97.24.31 +X-QM-SPAM-Info: Sender has good ham record. :) +X-QM-Body-MD5: 376fdc25dea9a4a20d214dc8c001e771 (of first 20000 bytes) +X-SpamAssassin-Score: 0.0 +X-SpamAssassin-SpamBar: / +X-SpamAssassin-Report: The QM spam filters have analysed this message to + determine if it is + spam. We require at least 5.0 points to mark a message as spam. + This message scored 0.0 points. Summary of the scoring: + * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail + provider * (markwalters1009[at]gmail.com) + * 0.0 AWL AWL: From: address is in the auto white-list +X-QM-Scan-Virus: ClamAV says the message is clean +Cc: tomi.ollila@iki.fi +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sun, 08 Sep 2013 17:38:42 -0000 + + +LGTM +1 + +Mark + +On Sun, 08 Sep 2013, Tomi Ollila wrote: +> If any of the tests in our test system is not passing the execution +> of the test suite completes with nonzero exit value. +> +> It is better to rely on the exit value of the test system instead +> of some arbitrary strings in test output (or use both). +> --- +> +> This is v2 of id:1378479935-26312-1-git-send-email-tomi.ollila@iki.fi +> thanks to Mark's observation in id:87d2olg9bz.fsf@qmul.ac.uk +> which widened my thought region :D +> +> Tomi +> +> test/aggregate-results.sh | 9 +++++++++ +> test/notmuch-test | 3 +++ +> 2 files changed, 12 insertions(+) +> +> diff --git a/test/aggregate-results.sh b/test/aggregate-results.sh +> index 732d6ca..b016edb 100755 +> --- a/test/aggregate-results.sh +> +++ b/test/aggregate-results.sh +> @@ -1,5 +1,7 @@ +> #!/usr/bin/env bash +> +> +set -eu +> + +> fixed=0 +> success=0 +> failed=0 +> @@ -79,3 +81,10 @@ if [ "$skipped" != "0" ]; then +> tests=$(pluralize "test" $skipped) +> echo "$skipped $tests skipped." +> fi +> + +> +if [ $success -gt 0 -a $fixed -eq 0 -a $failed -eq 0 -a $skipped -eq 0 ] +> +then +> + exit 0 +> +else +> + exit 1 +> +fi +> diff --git a/test/notmuch-test b/test/notmuch-test +> index 6db7979..aa28bb0 100755 +> --- a/test/notmuch-test +> +++ b/test/notmuch-test +> @@ -97,6 +97,9 @@ trap - HUP INT TERM +> +> # Report results +> ./aggregate-results.sh test-results/* +> +ev=$? +> +> # Clean up +> rm -rf test-results corpus.mail +> + +> +exit $ev +> -- +> 1.8.0 +> +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch -- 2.26.2