[PATCH 2/2] test: add_email_corpus: exit early if notmuch new fails
authorTomi Ollila <tomi.ollila@iki.fi>
Wed, 13 Apr 2016 05:35:04 +0000 (08:35 +0300)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 23:21:37 +0000 (16:21 -0700)
fd/552c08c162abb3aa269d3b04ea042aabefd13f [new file with mode: 0644]

diff --git a/fd/552c08c162abb3aa269d3b04ea042aabefd13f b/fd/552c08c162abb3aa269d3b04ea042aabefd13f
new file mode 100644 (file)
index 0000000..9a90160
--- /dev/null
@@ -0,0 +1,69 @@
+Return-Path: <too@guru-group.fi>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id B8A2F6DE0222\r
+ for <notmuch@notmuchmail.org>; Tue, 12 Apr 2016 22:35:16 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.288\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.288 tagged_above=-999 required=5 tests=[AWL=0.297, \r
+ HEADER_FROM_DIFFERENT_DOMAINS=0.001, T_RP_MATCHES_RCVD=-0.01]\r
+ autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id iFVYYas_dbjh for <notmuch@notmuchmail.org>;\r
+ Tue, 12 Apr 2016 22:35:07 -0700 (PDT)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 255016DE01C2\r
+ for <notmuch@notmuchmail.org>; Tue, 12 Apr 2016 22:35:06 -0700 (PDT)\r
+Received: by guru.guru-group.fi (Postfix, from userid 501)\r
+ id 04E911001E4; Wed, 13 Apr 2016 08:35:07 +0300 (EEST)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: notmuch@notmuchmail.org\r
+Cc: tomi.ollila@iki.fi\r
+Subject: [PATCH 2/2] test: add_email_corpus: exit early if notmuch new fails\r
+Date: Wed, 13 Apr 2016 08:35:04 +0300\r
+Message-Id: <1460525704-15145-2-git-send-email-tomi.ollila@iki.fi>\r
+X-Mailer: git-send-email 2.6.4\r
+In-Reply-To: <1460525704-15145-1-git-send-email-tomi.ollila@iki.fi>\r
+References: <1460525704-15145-1-git-send-email-tomi.ollila@iki.fi>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.20\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <https://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: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 13 Apr 2016 05:35:16 -0000\r
+\r
+If notmuch new fails during email corpus addition the database is\r
+most probably inexistent or broken and the added corpus would be\r
+unusable while running single tests, giving misleading failures\r
+("only" full 'make test' cleans out old corpus).\r
+---\r
+ test/test-lib.sh | 2 +-\r
+ 1 file changed, 1 insertion(+), 1 deletion(-)\r
+\r
+diff --git a/test/test-lib.sh b/test/test-lib.sh\r
+index 5620b8cef553..668e4270135a 100644\r
+--- a/test/test-lib.sh\r
++++ b/test/test-lib.sh\r
+@@ -552,7 +552,7 @@ add_email_corpus ()\r
+       cp -a $TEST_DIRECTORY/corpus.mail ${MAIL_DIR}\r
+     else\r
+       cp -a $TEST_DIRECTORY/corpus ${MAIL_DIR}\r
+-      notmuch new >/dev/null\r
++      notmuch new >/dev/null || die "'notmuch new' failed while adding email corpus"\r
+       cp -a ${MAIL_DIR} $TEST_DIRECTORY/corpus.mail\r
+     fi\r
+ }\r
+-- \r
+2.6.4\r
+\r