unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Austin Clements <aclements@csail.mit.edu>
To: notmuch@notmuchmail.org
Cc: Austin Clements <aclements@csail.mit.edu>
Subject: [PATCH v2 11/12] test: Test upgrade to ghost messages feature
Date: Mon,  6 Oct 2014 17:17:17 -0600	[thread overview]
Message-ID: <1412637438-4821-12-git-send-email-aclements@csail.mit.edu> (raw)
In-Reply-To: <1412637438-4821-1-git-send-email-aclements@csail.mit.edu>

---
 test/T530-upgrade.sh | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/test/T530-upgrade.sh b/test/T530-upgrade.sh
index c4c4ac8..6b42a69 100755
--- a/test/T530-upgrade.sh
+++ b/test/T530-upgrade.sh
@@ -116,4 +116,25 @@ MAIL_DIR/bar/new/21:2,
 MAIL_DIR/bar/new/22:2,
 MAIL_DIR/cur/51:2,"
 
+# Ghost messages are difficult to test since they're nearly invisible.
+# However, if the upgrade works correctly, the ghost message should
+# retain the right thread ID even if all of the original messages in
+# the thread are deleted.  That's what we test.  This won't detect if
+# the upgrade just plain didn't happen, but it should detect if
+# something went wrong.
+test_begin_subtest "ghost message retains thread ID"
+# Upgrade database
+notmuch new
+# Get thread ID of real message
+thread=$(notmuch search --output=threads id:4EFC743A.3060609@april.org)
+# Delete all real messages in that thread
+rm $(notmuch search --output=files $thread)
+notmuch new
+# "Deliver" ghost message
+add_message '[subject]=Ghost' '[id]=4EFC3931.6030007@april.org'
+# If the ghost upgrade worked, the new message should be attached to
+# the existing thread ID.
+nthread=$(notmuch search --output=threads id:4EFC3931.6030007@april.org)
+test_expect_equal "$thread" "$nthread"
+
 test_done
-- 
2.1.0

  parent reply	other threads:[~2014-10-06 23:18 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-06 23:17 [PATCH 00/12] Add ghost messages and fix thread linking Austin Clements
2014-10-06 23:17 ` [PATCH v2 01/12] lib: Move message ID compression to _notmuch_message_create_for_message_id Austin Clements
2014-10-06 23:17 ` [PATCH v2 02/12] lib: Refactor _notmuch_database_link_message Austin Clements
2014-10-06 23:17 ` [PATCH v2 03/12] lib: Handle empty date value Austin Clements
2014-10-11  5:12   ` David Bremner
2014-10-06 23:17 ` [PATCH v2 04/12] lib: Add a ghost messages database feature Austin Clements
2014-10-06 23:17 ` [PATCH v2 05/12] lib: Update database schema doc for ghost messages Austin Clements
2014-10-06 23:17 ` [PATCH v2 06/12] lib: Introduce macros for bit operations Austin Clements
2014-10-06 23:17 ` [PATCH v2 07/12] lib: Internal support for querying and creating ghost messages Austin Clements
2014-10-21 23:05   ` Mark Walters
2014-10-22  1:33     ` Austin Clements
2014-10-06 23:17 ` [PATCH v2 08/12] lib: Implement ghost-based thread linking Austin Clements
2014-10-21 23:10   ` Mark Walters
2014-10-22  1:49     ` Austin Clements
2014-10-06 23:17 ` [PATCH v2 09/12] lib: Implement upgrade to ghost messages feature Austin Clements
2014-10-06 23:17 ` [PATCH v2 10/12] lib: Enable " Austin Clements
2014-10-06 23:17 ` Austin Clements [this message]
2014-10-06 23:17 ` [PATCH v2 12/12] lib: Remove unnecessary thread linking steps when using ghost messages Austin Clements
2014-10-21 23:17   ` Mark Walters
2014-10-22  1:51     ` Austin Clements
2014-10-21 23:32 ` [PATCH 00/12] Add ghost messages and fix thread linking Mark Walters

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1412637438-4821-12-git-send-email-aclements@csail.mit.edu \
    --to=aclements@csail.mit.edu \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).