Re: [PATCH 1/1] test: exit with nonzero value when not all tests completed successfully
authorMark Walters <markwalters1009@gmail.com>
Fri, 6 Sep 2013 17:15:44 +0000 (18:15 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:56:59 +0000 (09:56 -0800)
f0/472d3e08458ae4468ac7129fa56e8de12f9df3 [new file with mode: 0644]

diff --git a/f0/472d3e08458ae4468ac7129fa56e8de12f9df3 b/f0/472d3e08458ae4468ac7129fa56e8de12f9df3
new file mode 100644 (file)
index 0000000..2a06060
--- /dev/null
@@ -0,0 +1,150 @@
+Return-Path: <m.walters@qmul.ac.uk>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id DEEBB431FB6\r
+       for <notmuch@notmuchmail.org>; Fri,  6 Sep 2013 10:15:56 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -1.098\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5\r
+       tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001,\r
+       NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id WjUWa41RTL0u for <notmuch@notmuchmail.org>;\r
+       Fri,  6 Sep 2013 10:15:52 -0700 (PDT)\r
+Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6])\r
+       (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 31718431FAE\r
+       for <notmuch@notmuchmail.org>; Fri,  6 Sep 2013 10:15:52 -0700 (PDT)\r
+Received: from smtp.qmul.ac.uk ([138.37.6.40])\r
+       by mail2.qmul.ac.uk with esmtp (Exim 4.71)\r
+       (envelope-from <m.walters@qmul.ac.uk>)\r
+       id 1VHzdJ-0001yB-UU; Fri, 06 Sep 2013 18:15:48 +0100\r
+Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost)\r
+       by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71)\r
+       (envelope-from <m.walters@qmul.ac.uk>)\r
+       id 1VHzdJ-0003NX-LU; Fri, 06 Sep 2013 18:15:45 +0100\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: Tomi Ollila <tomi.ollila@iki.fi>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH 1/1] test: exit with nonzero value when not all tests\r
+       completed successfully\r
+In-Reply-To: <1378479935-26312-1-git-send-email-tomi.ollila@iki.fi>\r
+References: <1378479935-26312-1-git-send-email-tomi.ollila@iki.fi>\r
+User-Agent: Notmuch/0.16 (http://notmuchmail.org) Emacs/23.4.1\r
+       (x86_64-pc-linux-gnu)\r
+Date: Fri, 06 Sep 2013 18:15:44 +0100\r
+Message-ID: <87d2olg9bz.fsf@qmul.ac.uk>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-Sender-Host-Address: 93.97.24.31\r
+X-QM-SPAM-Info: Sender has good ham record.  :)\r
+X-QM-Body-MD5: f4844b81d397858306e470ad6d7b96c9 (of first 20000 bytes)\r
+X-SpamAssassin-Score: 0.0\r
+X-SpamAssassin-SpamBar: /\r
+X-SpamAssassin-Report: The QM spam filters have analysed this message to\r
+       determine if it is\r
+       spam. We require at least 5.0 points to mark a message as spam.\r
+       This message scored 0.0 points. Summary of the scoring: \r
+       * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\r
+       provider *      (markwalters1009[at]gmail.com)\r
+       *  0.0 AWL AWL: From: address is in the auto white-list\r
+X-QM-Scan-Virus: ClamAV says the message is clean\r
+Cc: tomi.ollila@iki.fi\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Fri, 06 Sep 2013 17:15:57 -0000\r
+\r
+\r
+Hi\r
+\r
+On Fri, 06 Sep 2013, Tomi Ollila <tomi.ollila@iki.fi> wrote:\r
+> If any of the tests in our test system is not passing the execution\r
+> of the test suite completes with nonzero exit value.\r
+>\r
+> It is better to rely on the exit value of the test system instead\r
+> of some arbitrary strings in test output (or use both).\r
+\r
+This is obviously a good thing to do: my only query is whether having a\r
+single line setting ev would be clearer. Something along the lines of\r
+\r
+if [ "$fixed" = "0 ] && [ "$failed" = "0 ] && [ "$broken" = "0 ] && ["$skipped" = "0 ]; then\r
+ ev=1\r
+else \r
+ ev=0\r
+fi\r
+\r
+But I am happy with it as is too. (I haven't actually tested it\r
+currently).\r
+\r
+Best wishes\r
+\r
+Mark\r
+\r
+\r
+> ---\r
+>  test/aggregate-results.sh |    5 +++++\r
+>  test/notmuch-test         |    3 +++\r
+>  2 files changed, 8 insertions(+)\r
+>\r
+> diff --git a/test/aggregate-results.sh b/test/aggregate-results.sh\r
+> index 732d6ca..5193d7f 100755\r
+> --- a/test/aggregate-results.sh\r
+> +++ b/test/aggregate-results.sh\r
+> @@ -49,10 +49,12 @@ pluralize () {\r
+>  }\r
+>  \r
+>  echo "Notmuch test suite complete."\r
+> +ev=1\r
+>  if [ "$fixed" = "0" ] && [ "$failed" = "0" ]; then\r
+>      tests=$(pluralize "test" $total)\r
+>      printf "All $total $tests "\r
+>      if [ "$broken" = "0" ]; then\r
+> +    ev=0\r
+>      echo "passed."\r
+>      else\r
+>      failures=$(pluralize "failure" $broken)\r
+> @@ -76,6 +78,9 @@ fi\r
+>  \r
+>  skipped=$(($total - $fixed - $success - $failed - $broken))\r
+>  if [ "$skipped" != "0" ]; then\r
+> +    ev=1\r
+>      tests=$(pluralize "test" $skipped)\r
+>      echo "$skipped $tests skipped."\r
+>  fi\r
+> +\r
+> +exit $ev\r
+> diff --git a/test/notmuch-test b/test/notmuch-test\r
+> index 6db7979..aa28bb0 100755\r
+> --- a/test/notmuch-test\r
+> +++ b/test/notmuch-test\r
+> @@ -97,6 +97,9 @@ trap - HUP INT TERM\r
+>  \r
+>  # Report results\r
+>  ./aggregate-results.sh test-results/*\r
+> +ev=$?\r
+>  \r
+>  # Clean up\r
+>  rm -rf test-results corpus.mail\r
+> +\r
+> +exit $ev\r
+> -- \r
+> 1.7.10.4\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r