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