[PATCH 2/2] test: improve insert test reliability by checking message-id instead...
authorJani Nikula <jani@nikula.org>
Tue, 3 Sep 2013 05:19:03 +0000 (08:19 +0300)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:56:51 +0000 (09:56 -0800)
67/6df93c1844ce93250f20c13453530fd659cdb3 [new file with mode: 0644]

diff --git a/67/6df93c1844ce93250f20c13453530fd659cdb3 b/67/6df93c1844ce93250f20c13453530fd659cdb3
new file mode 100644 (file)
index 0000000..364091f
--- /dev/null
@@ -0,0 +1,110 @@
+Return-Path: <jani@nikula.org>\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 1923A431FDA\r
+       for <notmuch@notmuchmail.org>; Mon,  2 Sep 2013 22:19:18 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 bfXjYHtr0agA for <notmuch@notmuchmail.org>;\r
+       Mon,  2 Sep 2013 22:19:10 -0700 (PDT)\r
+Received: from mail-ee0-f42.google.com (mail-ee0-f42.google.com\r
+ [74.125.83.42])       (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
+ certificate requested)        by olra.theworths.org (Postfix) with ESMTPS id\r
+ 79063431FDB   for <notmuch@notmuchmail.org>; Mon,  2 Sep 2013 22:19:09 -0700\r
+ (PDT)\r
+Received: by mail-ee0-f42.google.com with SMTP id b45so2732535eek.29\r
+       for <notmuch@notmuchmail.org>; Mon, 02 Sep 2013 22:19:08 -0700 (PDT)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+       d=1e100.net; s=20130820;\r
+       h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\r
+       :references;\r
+       bh=2MVD0kfw/VpEHl2Bt7NOqEu9VwGCzas/tlONel/gNfE=;\r
+       b=BX+Eqwo9eucrpqSXfimSianj7FvUiT+V92Q3TVbDoZAxwcbDZ31eW/libHvTrNthH5\r
+       iVaCgji7edZXhwBJT0jhjdBxPcAzS6ib7YITamFowY1AkLAGNrBqBaihuE4mcD29dw50\r
+       zTaDqd+cTUoQsQPpperhTiD9RQr9kNbDapIY+Mx3GqhYbmJ9/xUeqbU6CmCdK6Ojh5CD\r
+       NgFbMmCsjuDmtUyKQoj0/uIKmbKWSQSXevC9CENnYeE0wCepBz4VUDjO0JJdfoJF8buD\r
+       RR6l6DQ7zvqTyrFH3rF0vGhhqdGQbX1I0OIQ/IjikGbmD489T0ivUEJ9V5SzG9l+Obv4\r
+       XgOQ==\r
+X-Gm-Message-State:\r
+ ALoCoQmEyt12CYxYE0/cI4N4axLCVde+9z9YTVMftqx/WkcpRaQRe+OtMlXrOH3h0WHkN9qtnBfG\r
+X-Received: by 10.14.3.9 with SMTP id 9mr319544eeg.72.1378185548250;\r
+       Mon, 02 Sep 2013 22:19:08 -0700 (PDT)\r
+Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi.\r
+       [88.195.111.91])\r
+       by mx.google.com with ESMTPSA id a1sm28245286eem.1.1969.12.31.16.00.00\r
+       (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+       Mon, 02 Sep 2013 22:19:07 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 2/2] test: improve insert test reliability by checking\r
+       message-id instead of count\r
+Date: Tue,  3 Sep 2013 08:19:03 +0300\r
+Message-Id: <1378185543-25271-2-git-send-email-jani@nikula.org>\r
+X-Mailer: git-send-email 1.8.4.rc3\r
+In-Reply-To: <1378185543-25271-1-git-send-email-jani@nikula.org>\r
+References: <1378170613-3584-1-git-send-email-david@tethera.net>\r
+       <1378185543-25271-1-git-send-email-jani@nikula.org>\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: Tue, 03 Sep 2013 05:19:18 -0000\r
+\r
+There isn't a reported issue this would fix. Spotted by reading the\r
+test.\r
+---\r
+ test/insert | 12 ++++++------\r
+ 1 file changed, 6 insertions(+), 6 deletions(-)\r
+\r
+diff --git a/test/insert b/test/insert\r
+index 9b448e5..550b413 100755\r
+--- a/test/insert\r
++++ b/test/insert\r
+@@ -68,14 +68,14 @@ test_expect_equal_json "$output" '["inbox", "unread"]'\r
+ test_begin_subtest "Insert message, add tag"\r
+ gen_insert_msg\r
+ notmuch insert +custom < "$gen_msg_filename"\r
+-output=$(notmuch count tag:custom)\r
+-test_expect_equal "$output" "1"\r
++output=$(notmuch search --output=messages tag:custom)\r
++test_expect_equal "$output" "id:$gen_msg_id"\r
\r
+ test_begin_subtest "Insert message, add/remove tags"\r
+ gen_insert_msg\r
+ notmuch insert +custom -unread < "$gen_msg_filename"\r
+-output=$(notmuch count tag:custom NOT tag:unread)\r
+-test_expect_equal "$output" "1"\r
++output=$(notmuch search --output=messages tag:custom NOT tag:unread)\r
++test_expect_equal "$output" "id:$gen_msg_id"\r
\r
+ test_begin_subtest "Insert message with default tags stays in new/"\r
+ gen_insert_msg\r
+@@ -123,8 +123,8 @@ test_expect_equal "$dirname" "$MAIL_DIR/Drafts/new"\r
+ test_begin_subtest "Insert message into folder, add/remove tags"\r
+ gen_insert_msg\r
+ notmuch insert --folder=Drafts +draft -unread < "$gen_msg_filename"\r
+-output=$(notmuch count folder:Drafts tag:draft NOT tag:unread)\r
+-test_expect_equal "$output" "1"\r
++output=$(notmuch search --output=messages folder:Drafts tag:draft NOT tag:unread)\r
++test_expect_equal "$output" "id:$gen_msg_id"\r
\r
+ gen_insert_msg\r
+ test_expect_code 1 "Insert message into non-existent folder" \\r
+-- \r
+1.8.4.rc3\r
+\r