From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id E619A6DE023B for ; Thu, 30 Aug 2018 04:30:03 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.251 X-Spam-Level: X-Spam-Status: No, score=0.251 tagged_above=-999 required=5 tests=[AWL=-0.238, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, URI_NOVOWEL=0.5] 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 KwUu-b-5p6ew for ; Thu, 30 Aug 2018 04:30:03 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 97C706DE0355 for ; Thu, 30 Aug 2018 04:29:48 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.89) (envelope-from ) id 1fvL91-0007Gz-Nt; Thu, 30 Aug 2018 07:29:47 -0400 Received: (nullmailer pid 12117 invoked by uid 1000); Thu, 30 Aug 2018 11:29:32 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: [PATCH 03/15] test: add known broken tests for "ghost roots" Date: Thu, 30 Aug 2018 08:29:03 -0300 Message-Id: <20180830112915.11761-4-david@tethera.net> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180830112915.11761-1-david@tethera.net> References: <20180830112915.11761-1-david@tethera.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.26 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: Thu, 30 Aug 2018 11:30:04 -0000 This documents the bug discussed at id:87efgmmysi.fsf@len.workgroup The underlying issue is that the reply to a ghost (missing) message is falsely classified as a root message in _resolve_thread_relationships. There are two pairs of tests; in each case the the first test is simpler / more robust, but also easier to fool. --- test/T510-thread-replies.sh | 48 +++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/test/T510-thread-replies.sh b/test/T510-thread-replies.sh index 6837ff17..753c7ae1 100755 --- a/test/T510-thread-replies.sh +++ b/test/T510-thread-replies.sh @@ -164,5 +164,53 @@ expected='[[[{"id": "XXXXX", "match": true, "excluded": false, expected=`echo "$expected" | notmuch_json_show_sanitize` test_expect_equal_json "$output" "$expected" +add_email_corpus threading + +test_begin_subtest "reply to ghost" +test_subtest_known_broken +notmuch show --entire-thread=true id:000-real-root@example.org | grep ^Subject: | head -1 > OUTPUT +cat < EXPECTED +Subject: root message +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "reply to ghost (tree view)" +test_subtest_known_broken +test_emacs '(notmuch-tree "id:000-real-root@example.org") + (notmuch-test-wait) + (test-output) + (delete-other-windows)' +cat < EXPECTED + 2016-06-17 Alice ┬►root message (inbox unread) + 2016-06-18 Alice ╰┬►child message (inbox unread) + 2016-06-17 Mallory ├─►fake root message (inbox unread) + 2016-06-18 Alice ├┬►grand-child message (inbox unread) + 2016-06-18 Alice │╰─►great grand-child message (inbox unread) + 2016-06-18 Daniel ╰─►grand-child message 2 (inbox unread) +End of search results. +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "reply to ghost (RT)" +test_subtest_known_broken +notmuch show --entire-thread=true id:87bmc6lp3h.fsf@len.workgroup | grep ^Subject: | head -1 > OUTPUT +cat < EXPECTED +Subject: FYI: xxxx xxxxxxx xxxxxxxxxxxx xxx +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "reply to ghost (RT/tree view)" +test_subtest_known_broken +test_emacs '(notmuch-tree "id:87bmc6lp3h.fsf@len.workgroup") + (notmuch-test-wait) + (test-output) + (delete-other-windows)' +cat < EXPECTED + 2016-06-19 Gregor Zattler ┬┬►FYI: xxxx xxxxxxx xxxxxxxxxxxx xxx (inbox unread) + 2016-06-19 via RT │╰─►[support.xxxxxxxxxxx-xxxxxxxxx-xxxxxxxxx.de #33575] AutoReply: FYI: xxxx xxxxxxx xxxxxxxxxxxx xxx (inbox unread) + 2016-06-26 via RT ╰─►[support.xxxxxxxxxxx-xxxxxxxxx-xxxxxxxxx.de #33575] Resolved: FYI: xxxx xxxxxxx xxxxxxxxxxxx xxx (inbox unread) +End of search results. +EOF +test_expect_equal_file EXPECTED OUTPUT test_done -- 2.18.0