From: Mark Walters Date: Fri, 6 Sep 2013 17:15:44 +0000 (+0100) Subject: Re: [PATCH 1/1] test: exit with nonzero value when not all tests completed successfully X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ab9d0ea427a3337c52f73fb91b0735027d141142;p=notmuch-archives.git Re: [PATCH 1/1] test: exit with nonzero value when not all tests completed successfully --- diff --git a/f0/472d3e08458ae4468ac7129fa56e8de12f9df3 b/f0/472d3e08458ae4468ac7129fa56e8de12f9df3 new file mode 100644 index 000000000..2a0606079 --- /dev/null +++ b/f0/472d3e08458ae4468ac7129fa56e8de12f9df3 @@ -0,0 +1,150 @@ +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 DEEBB431FB6 + for ; Fri, 6 Sep 2013 10:15:56 -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 WjUWa41RTL0u for ; + Fri, 6 Sep 2013 10:15:52 -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 31718431FAE + for ; Fri, 6 Sep 2013 10:15:52 -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 1VHzdJ-0001yB-UU; Fri, 06 Sep 2013 18:15:48 +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 1VHzdJ-0003NX-LU; Fri, 06 Sep 2013 18:15:45 +0100 +From: Mark Walters +To: Tomi Ollila , notmuch@notmuchmail.org +Subject: Re: [PATCH 1/1] test: exit with nonzero value when not all tests + completed successfully +In-Reply-To: <1378479935-26312-1-git-send-email-tomi.ollila@iki.fi> +References: <1378479935-26312-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: Fri, 06 Sep 2013 18:15:44 +0100 +Message-ID: <87d2olg9bz.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: f4844b81d397858306e470ad6d7b96c9 (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: Fri, 06 Sep 2013 17:15:57 -0000 + + +Hi + +On Fri, 06 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 obviously a good thing to do: my only query is whether having a +single line setting ev would be clearer. Something along the lines of + +if [ "$fixed" = "0 ] && [ "$failed" = "0 ] && [ "$broken" = "0 ] && ["$skipped" = "0 ]; then + ev=1 +else + ev=0 +fi + +But I am happy with it as is too. (I haven't actually tested it +currently). + +Best wishes + +Mark + + +> --- +> test/aggregate-results.sh | 5 +++++ +> test/notmuch-test | 3 +++ +> 2 files changed, 8 insertions(+) +> +> diff --git a/test/aggregate-results.sh b/test/aggregate-results.sh +> index 732d6ca..5193d7f 100755 +> --- a/test/aggregate-results.sh +> +++ b/test/aggregate-results.sh +> @@ -49,10 +49,12 @@ pluralize () { +> } +> +> echo "Notmuch test suite complete." +> +ev=1 +> if [ "$fixed" = "0" ] && [ "$failed" = "0" ]; then +> tests=$(pluralize "test" $total) +> printf "All $total $tests " +> if [ "$broken" = "0" ]; then +> + ev=0 +> echo "passed." +> else +> failures=$(pluralize "failure" $broken) +> @@ -76,6 +78,9 @@ fi +> +> skipped=$(($total - $fixed - $success - $failed - $broken)) +> if [ "$skipped" != "0" ]; then +> + ev=1 +> tests=$(pluralize "test" $skipped) +> echo "$skipped $tests skipped." +> fi +> + +> +exit $ev +> 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.7.10.4 +> +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch