unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* fix for failing tests with gmime 2.6.19
@ 2013-11-10 16:21 David Bremner
  2013-11-10 16:21 ` [PATCH 1/2] test: add optional workaround for gmime bug David Bremner
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: David Bremner @ 2013-11-10 16:21 UTC (permalink / raw)
  To: notmuch

Although Jeffrey Stedfast fixed gmime bug 711305 amazingly quickly, it
looks like many people still have to live with a buggy version of
gmime for a while yet. Here is an opt-in fix that stops the test suite
from failing; this is a simple fix for e.g. the debian build process.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 1/2] test: add optional workaround for gmime bug.
  2013-11-10 16:21 fix for failing tests with gmime 2.6.19 David Bremner
@ 2013-11-10 16:21 ` David Bremner
  2013-11-10 16:21 ` [PATCH 2/2] test: work around gmime bug using notmuch_reply_sanitize David Bremner
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 13+ messages in thread
From: David Bremner @ 2013-11-10 16:21 UTC (permalink / raw)
  To: notmuch

A new variable NOTMUCH_TEST_SLOPPY is introduced, which enables this
workaround.  It could be used in the future for similar things.
---
 test/README      | 7 +++++++
 test/test-lib.sh | 9 +++++++++
 2 files changed, 16 insertions(+)

diff --git a/test/README b/test/README
index d12cff2..eb1a2e6 100644
--- a/test/README
+++ b/test/README
@@ -96,6 +96,13 @@ Note that some tests in the existing test suite rely on previous test
 items, so you cannot arbitrarily skip any test and expect the
 remaining tests to be unaffected.
 
+Working around some bugs
+------------------------
+
+The test suite contains some workarounds for known (minor) problems in
+external dependencies. You can enable these workarounds by setting the
+environment variable NOTMUCH_TEST_SLOPPY to a non-null value.
+
 Writing Tests
 -------------
 The test script is written as a shell script.  It should start with
diff --git a/test/test-lib.sh b/test/test-lib.sh
index 2aa4dfc..c71bd4e 100644
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -628,6 +628,15 @@ notmuch_json_show_sanitize ()
 	-e 's|"filename": "/[^"]*",|"filename": "YYYYY",|g'
 }
 
+notmuch_reply_sanitize ()
+{
+    if test -n "$NOTMUCH_TEST_SLOPPY"; then
+	# work around GMIME bug #711305
+	sed -e 's/^References:  */References: /'
+    else
+	cat
+    fi
+}
 # End of notmuch helper functions
 
 # Use test_set_prereq to tell that a particular prerequisite is available.
-- 
1.8.4.2

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 2/2] test: work around gmime bug using notmuch_reply_sanitize
  2013-11-10 16:21 fix for failing tests with gmime 2.6.19 David Bremner
  2013-11-10 16:21 ` [PATCH 1/2] test: add optional workaround for gmime bug David Bremner
@ 2013-11-10 16:21 ` David Bremner
  2013-11-11  3:15   ` [Patch v2 1/2] test: add optional workaround for gmime bug David Bremner
  2013-11-11  3:47 ` fix for failing tests with gmime 2.6.19 Daniel Kahn Gillmor
  2013-11-18 17:54 ` Tomi Ollila
  3 siblings, 1 reply; 13+ messages in thread
From: David Bremner @ 2013-11-10 16:21 UTC (permalink / raw)
  To: notmuch

The user still has to set NOTMUCH_TEST_SLOPPY
---
 test/from-guessing   | 22 +++++++++++-----------
 test/multipart       |  2 +-
 test/reply           | 24 ++++++++++++------------
 test/reply-to-sender | 24 ++++++++++++------------
 4 files changed, 36 insertions(+), 36 deletions(-)

diff --git a/test/from-guessing b/test/from-guessing
index 6dfaa40..bdda13b 100755
--- a/test/from-guessing
+++ b/test/from-guessing
@@ -9,7 +9,7 @@ add_message '[from]="Sender <sender@example.com>"' \
 	    '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
 	    '[body]="from guessing test"'
 
-output=$(notmuch reply id:${gen_msg_id})
+output=$(notmuch reply id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <sender@example.com>, mailinglist@notmuchmail.org
@@ -27,7 +27,7 @@ add_message '[from]="Sender <sender@example.com>"' \
 	    '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
 	    '[body]="from guessing test"'
 
-output=$(notmuch reply id:${gen_msg_id})
+output=$(notmuch reply id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite_other@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <sender@example.com>, mailinglist@notmuchmail.org
@@ -45,7 +45,7 @@ add_message '[from]="Sender <sender@example.com>"' \
 	    '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
 	    '[body]="from guessing test"'
 
-output=$(notmuch reply id:${gen_msg_id})
+output=$(notmuch reply id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite_other@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <sender@example.com>, mailinglist@notmuchmail.org
@@ -65,7 +65,7 @@ add_message '[from]="Sender <sender@example.com>"' \
 	    '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
 	    '[body]="from guessing test"'
 
-output=$(notmuch reply id:${gen_msg_id})
+output=$(notmuch reply id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite_other@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <sender@example.com>, mailinglist@notmuchmail.org
@@ -85,7 +85,7 @@ add_message '[from]="Sender <sender@example.com>"' \
 	    '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
 	    '[body]="from guessing test"'
 
-output=$(notmuch reply id:${gen_msg_id})
+output=$(notmuch reply id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@otherdomain.org>
 Subject: Re: notmuch-reply-test
 To: Sender <sender@example.com>, mailinglist@notmuchmail.org
@@ -107,7 +107,7 @@ Received: from extraneous.example.com (extraneous.example.com [1.1.1.1])\"" \
 	    '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
 	    '[body]="from guessing test"'
 
-output="$(notmuch reply id:${gen_msg_id})"
+output="$(notmuch reply id:${gen_msg_id} | notmuch_reply_sanitize)"
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite_other@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <sender@example.com>, mailinglist@notmuchmail.org
@@ -128,7 +128,7 @@ add_message '[from]="Sender <sender@example.com>"' \
 	    '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
 	    '[body]="from guessing test"'
 
-output=$(notmuch reply id:${gen_msg_id})
+output=$(notmuch reply id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <sender@example.com>, mailinglist@notmuchmail.org
@@ -146,7 +146,7 @@ add_message '[from]="Sender <sender@example.com>"' \
 	    '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
 	    '[body]="from guessing test"'
 
-output=$(notmuch reply id:${gen_msg_id})
+output=$(notmuch reply id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <sender@example.com>, mailinglist@notmuchmail.org
@@ -164,7 +164,7 @@ add_message '[from]="Sender <sender@example.com>"' \
 	    '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
 	    '[body]="from guessing test"'
 
-output=$(notmuch reply id:${gen_msg_id})
+output=$(notmuch reply id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <sender@example.com>, mailinglist@notmuchmail.org
@@ -184,7 +184,7 @@ add_message '[from]="Sender <sender@example.com>"' \
 	    '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
 	    '[body]="from guessing test"'
 
-output=$(notmuch reply id:${gen_msg_id})
+output=$(notmuch reply id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <sender@example.com>, mailinglist@notmuchmail.org
@@ -204,7 +204,7 @@ add_message '[from]="Sender <sender@example.com>"' \
 	    '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
 	    '[body]="from guessing test"'
 
-output=$(notmuch reply id:${gen_msg_id})
+output=$(notmuch reply id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <sender@example.com>, mailinglist@notmuchmail.org
diff --git a/test/multipart b/test/multipart
index b40fa2c..05a5f1d 100755
--- a/test/multipart
+++ b/test/multipart
@@ -569,7 +569,7 @@ test_expect_success \
     "! notmuch show --format=mbox --part=1 'id:87liy5ap00.fsf@yoom.home.cworth.org'"
 
 test_begin_subtest "'notmuch reply' to a multipart message"
-notmuch reply 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT
+notmuch reply 'id:87liy5ap00.fsf@yoom.home.cworth.org' | notmuch_reply_sanitize >OUTPUT
 cat <<EOF >EXPECTED
 From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: Multipart message
diff --git a/test/reply b/test/reply
index b0d854a..8929de0 100755
--- a/test/reply
+++ b/test/reply
@@ -9,7 +9,7 @@ add_message '[from]="Sender <sender@example.com>"' \
 	    '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
 	    '[body]="basic reply test"'
 
-output=$(notmuch reply id:${gen_msg_id})
+output=$(notmuch reply id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <sender@example.com>
@@ -26,7 +26,7 @@ add_message '[from]="Sender <sender@example.com>"' \
 	    '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
 	    '[body]="Multiple recipients"'
 
-output=$(notmuch reply id:${gen_msg_id})
+output=$(notmuch reply id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <sender@example.com>, Someone Else <someone@example.com>
@@ -44,7 +44,7 @@ add_message '[from]="Sender <sender@example.com>"' \
 	    '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
 	    '[body]="reply with CC"'
 
-output=$(notmuch reply id:${gen_msg_id})
+output=$(notmuch reply id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <sender@example.com>
@@ -62,7 +62,7 @@ add_message '[from]="Sender <sender@example.com>"' \
 	    '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
 	    '[body]="reply from alternate address"'
 
-output=$(notmuch reply id:${gen_msg_id})
+output=$(notmuch reply id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite_other@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <sender@example.com>
@@ -80,7 +80,7 @@ add_message '[from]="Sender <sender@example.com>"' \
             '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
             '[body]="Reply from address in named group list"'
 
-output=$(notmuch reply id:${gen_msg_id})
+output=$(notmuch reply id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <sender@example.com>, someone@example.com
@@ -98,7 +98,7 @@ add_message '[from]="Sender <sender@example.com>"' \
 	    '[body]="support for reply-to"' \
 	    '[reply-to]="Sender <elsewhere@example.com>"'
 
-output=$(notmuch reply id:${gen_msg_id})
+output=$(notmuch reply id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <elsewhere@example.com>
@@ -116,7 +116,7 @@ add_message '[from]="Sender <sender@example.com>"' \
 	    '[body]="Un-munging Reply-To"' \
 	    '[reply-to]="Evil Munging List <list@example.com>"'
 
-output=$(notmuch reply id:${gen_msg_id})
+output=$(notmuch reply id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <sender@example.com>, Some List <list@example.com>
@@ -130,7 +130,7 @@ test_begin_subtest "Message with header of exactly 200 bytes"
 add_message '[subject]="This subject is exactly 200 bytes in length. Other than its length there is not much of note here. Note that the length of 200 bytes includes the Subject: and Re: prefixes with two spaces"' \
 	    '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
 	    '[body]="200-byte header"'
-output=$(notmuch reply id:${gen_msg_id})
+output=$(notmuch reply id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: This subject is exactly 200 bytes in length. Other than its
  length there is not much of note here. Note that the length of 200 bytes
@@ -149,7 +149,7 @@ add_message '[from]="Sender <sender@example.com>"' \
 	    '[body]="From guessing"' \
 	    '[header]="Envelope-To: test_suite_other@notmuchmail.org"'
 
-output=$(notmuch reply id:${gen_msg_id})
+output=$(notmuch reply id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite_other@notmuchmail.org>
 Subject: Re: From guessing
 To: Sender <sender@example.com>, Recipient <recipient@example.com>
@@ -167,7 +167,7 @@ add_message '[from]="Sender <sender@example.com>"' \
 	    '[body]="From guessing"' \
 	    '[header]="X-Original-To: test_suite@otherdomain.org"'
 
-output=$(notmuch reply id:${gen_msg_id})
+output=$(notmuch reply id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@otherdomain.org>
 Subject: Re: From guessing
 To: Sender <sender@example.com>, Recipient <recipient@example.com>
@@ -185,7 +185,7 @@ add_message '[from]="Sender <sender@example.com>"' \
 	    '[body]="From guessing"' \
 	    '[header]="Delivered-To: test_suite_other@notmuchmail.org"'
 
-output=$(notmuch reply id:${gen_msg_id})
+output=$(notmuch reply id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite_other@notmuchmail.org>
 Subject: Re: From guessing
 To: Sender <sender@example.com>, Recipient <recipient@example.com>
@@ -204,7 +204,7 @@ add_message '[subject]="=?iso-8859-1?q?=e0=df=e7?="' \
 # GMime happens to change from Q- to B-encoding.  We canonicalize the
 # case of the encoding and charset because different versions of GMime
 # capitalize the encoding differently.
-output=$(notmuch reply id:${gen_msg_id} | perl -pe 's/=\?[^?]+\?[bB]\?/lc($&)/ge')
+output=$(notmuch reply id:${gen_msg_id} | perl -pe 's/=\?[^?]+\?[bB]\?/lc($&)/ge' | notmuch_reply_sanitize)
 test_expect_equal "$output" "\
 From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: =?iso-8859-1?b?4N/n?=
diff --git a/test/reply-to-sender b/test/reply-to-sender
index 30e5e38..194b2ae 100755
--- a/test/reply-to-sender
+++ b/test/reply-to-sender
@@ -9,7 +9,7 @@ add_message '[from]="Sender <sender@example.com>"' \
             '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
             '[body]="basic reply-to-sender test"'
 
-output=$(notmuch reply --reply-to=sender id:${gen_msg_id})
+output=$(notmuch reply --reply-to=sender id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <sender@example.com>
@@ -26,7 +26,7 @@ add_message '[from]="Notmuch Test Suite <test_suite@notmuchmail.org>"' \
             '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
             '[body]="basic reply-to-from-us test"'
 
-output=$(notmuch reply --reply-to=sender id:${gen_msg_id})
+output=$(notmuch reply --reply-to=sender id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Recipient <recipient@example.com>
@@ -43,7 +43,7 @@ add_message '[from]="Sender <sender@example.com>"' \
             '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
             '[body]="Multiple recipients"'
 
-output=$(notmuch reply  --reply-to=sender  id:${gen_msg_id})
+output=$(notmuch reply --reply-to=sender id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <sender@example.com>
@@ -60,7 +60,7 @@ add_message '[from]="Notmuch Test Suite <test_suite@notmuchmail.org>"' \
             '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
             '[body]="From Us, Multiple TO recipients"'
 
-output=$(notmuch reply  --reply-to=sender  id:${gen_msg_id})
+output=$(notmuch reply --reply-to=sender id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Recipient <recipient@example.com>, Someone Else <someone@example.com>
@@ -78,7 +78,7 @@ add_message '[from]="Sender <sender@example.com>"' \
             '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
             '[body]="reply with CC"'
 
-output=$(notmuch reply  --reply-to=sender id:${gen_msg_id})
+output=$(notmuch reply --reply-to=sender id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <sender@example.com>
@@ -96,7 +96,7 @@ add_message '[from]="Notmuch Test Suite <test_suite@notmuchmail.org>"' \
             '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
             '[body]="reply with CC"'
 
-output=$(notmuch reply  --reply-to=sender id:${gen_msg_id})
+output=$(notmuch reply --reply-to=sender id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Recipient <recipient@example.com>
@@ -113,7 +113,7 @@ add_message '[from]="Notmuch Test Suite <test_suite@notmuchmail.org>"' \
             '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
             '[body]="reply with CC"'
 
-output=$(notmuch reply  --reply-to=sender id:${gen_msg_id})
+output=$(notmuch reply --reply-to=sender id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 Cc: Other Parties <cc@example.com>
@@ -130,7 +130,7 @@ add_message '[from]="Sender <sender@example.com>"' \
             '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
             '[body]="reply from alternate address"'
 
-output=$(notmuch reply  --reply-to=sender id:${gen_msg_id})
+output=$(notmuch reply --reply-to=sender id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite_other@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <sender@example.com>
@@ -148,7 +148,7 @@ add_message '[from]="Sender <sender@example.com>"' \
             '[body]="support for reply-to"' \
             '[reply-to]="Sender <elsewhere@example.com>"'
 
-output=$(notmuch reply  --reply-to=sender id:${gen_msg_id})
+output=$(notmuch reply --reply-to=sender id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <elsewhere@example.com>
@@ -166,7 +166,7 @@ add_message '[from]="Sender <sender@example.com>"' \
             '[body]="support for reply-to with multiple recipients"' \
             '[reply-to]="Sender <elsewhere@example.com>"'
 
-output=$(notmuch reply  --reply-to=sender id:${gen_msg_id})
+output=$(notmuch reply --reply-to=sender id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <elsewhere@example.com>
@@ -184,7 +184,7 @@ add_message '[from]="Sender <sender@example.com>"' \
             '[body]="Un-munging Reply-To"' \
             '[reply-to]="Evil Munging List <list@example.com>"'
 
-output=$(notmuch reply  --reply-to=sender id:${gen_msg_id})
+output=$(notmuch reply --reply-to=sender id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <sender@example.com>
@@ -198,7 +198,7 @@ test_begin_subtest "Message with header of exactly 200 bytes"
 add_message '[subject]="This subject is exactly 200 bytes in length. Other than its length there is not much of note here. Note that the length of 200 bytes includes the Subject: and Re: prefixes with two spaces"' \
             '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
             '[body]="200-byte header"'
-output=$(notmuch reply  --reply-to=sender id:${gen_msg_id})
+output=$(notmuch reply --reply-to=sender id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: This subject is exactly 200 bytes in length. Other than its
  length there is not much of note here. Note that the length of 200 bytes
-- 
1.8.4.2

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Patch v2 1/2] test: add optional workaround for gmime bug.
  2013-11-10 16:21 ` [PATCH 2/2] test: work around gmime bug using notmuch_reply_sanitize David Bremner
@ 2013-11-11  3:15   ` David Bremner
  2013-11-11  3:15     ` [Patch v2 2/2] test: work around gmime bug using notmuch_reply_sanitize David Bremner
  0 siblings, 1 reply; 13+ messages in thread
From: David Bremner @ 2013-11-11  3:15 UTC (permalink / raw)
  To: notmuch

A new variable NOTMUCH_TEST_WORKAROUNDS is introduced, which enables this
workaround.  It could be used in the future for similar things.
---
 test/README      | 7 +++++++
 test/test-lib.sh | 9 +++++++++
 2 files changed, 16 insertions(+)

diff --git a/test/README b/test/README
index d12cff2..f132860 100644
--- a/test/README
+++ b/test/README
@@ -96,6 +96,13 @@ Note that some tests in the existing test suite rely on previous test
 items, so you cannot arbitrarily skip any test and expect the
 remaining tests to be unaffected.
 
+Working around some bugs
+------------------------
+
+The test suite contains some workarounds for known (minor) problems in
+external dependencies. You can enable these workarounds by setting the
+environment variable NOTMUCH_TEST_WORKAROUNDS to a non-null value.
+
 Writing Tests
 -------------
 The test script is written as a shell script.  It should start with
diff --git a/test/test-lib.sh b/test/test-lib.sh
index 2aa4dfc..4554d5e 100644
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -628,6 +628,15 @@ notmuch_json_show_sanitize ()
 	-e 's|"filename": "/[^"]*",|"filename": "YYYYY",|g'
 }
 
+notmuch_reply_sanitize ()
+{
+    if test -n "$NOTMUCH_TEST_WORKAROUNDS"; then
+	# work around GMIME bug #711305
+	sed -e 's/^References:  /References: /'
+    else
+	cat
+    fi
+}
 # End of notmuch helper functions
 
 # Use test_set_prereq to tell that a particular prerequisite is available.
-- 
1.8.4.2

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Patch v2 2/2] test: work around gmime bug using notmuch_reply_sanitize
  2013-11-11  3:15   ` [Patch v2 1/2] test: add optional workaround for gmime bug David Bremner
@ 2013-11-11  3:15     ` David Bremner
  0 siblings, 0 replies; 13+ messages in thread
From: David Bremner @ 2013-11-11  3:15 UTC (permalink / raw)
  To: notmuch

The user still has to set NOTMUCH_TEST_WORKAROUNDS
---
 test/from-guessing   | 22 +++++++++++-----------
 test/multipart       |  2 +-
 test/reply           | 24 ++++++++++++------------
 test/reply-to-sender | 24 ++++++++++++------------
 4 files changed, 36 insertions(+), 36 deletions(-)

diff --git a/test/from-guessing b/test/from-guessing
index 6dfaa40..bdda13b 100755
--- a/test/from-guessing
+++ b/test/from-guessing
@@ -9,7 +9,7 @@ add_message '[from]="Sender <sender@example.com>"' \
 	    '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
 	    '[body]="from guessing test"'
 
-output=$(notmuch reply id:${gen_msg_id})
+output=$(notmuch reply id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <sender@example.com>, mailinglist@notmuchmail.org
@@ -27,7 +27,7 @@ add_message '[from]="Sender <sender@example.com>"' \
 	    '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
 	    '[body]="from guessing test"'
 
-output=$(notmuch reply id:${gen_msg_id})
+output=$(notmuch reply id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite_other@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <sender@example.com>, mailinglist@notmuchmail.org
@@ -45,7 +45,7 @@ add_message '[from]="Sender <sender@example.com>"' \
 	    '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
 	    '[body]="from guessing test"'
 
-output=$(notmuch reply id:${gen_msg_id})
+output=$(notmuch reply id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite_other@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <sender@example.com>, mailinglist@notmuchmail.org
@@ -65,7 +65,7 @@ add_message '[from]="Sender <sender@example.com>"' \
 	    '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
 	    '[body]="from guessing test"'
 
-output=$(notmuch reply id:${gen_msg_id})
+output=$(notmuch reply id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite_other@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <sender@example.com>, mailinglist@notmuchmail.org
@@ -85,7 +85,7 @@ add_message '[from]="Sender <sender@example.com>"' \
 	    '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
 	    '[body]="from guessing test"'
 
-output=$(notmuch reply id:${gen_msg_id})
+output=$(notmuch reply id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@otherdomain.org>
 Subject: Re: notmuch-reply-test
 To: Sender <sender@example.com>, mailinglist@notmuchmail.org
@@ -107,7 +107,7 @@ Received: from extraneous.example.com (extraneous.example.com [1.1.1.1])\"" \
 	    '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
 	    '[body]="from guessing test"'
 
-output="$(notmuch reply id:${gen_msg_id})"
+output="$(notmuch reply id:${gen_msg_id} | notmuch_reply_sanitize)"
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite_other@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <sender@example.com>, mailinglist@notmuchmail.org
@@ -128,7 +128,7 @@ add_message '[from]="Sender <sender@example.com>"' \
 	    '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
 	    '[body]="from guessing test"'
 
-output=$(notmuch reply id:${gen_msg_id})
+output=$(notmuch reply id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <sender@example.com>, mailinglist@notmuchmail.org
@@ -146,7 +146,7 @@ add_message '[from]="Sender <sender@example.com>"' \
 	    '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
 	    '[body]="from guessing test"'
 
-output=$(notmuch reply id:${gen_msg_id})
+output=$(notmuch reply id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <sender@example.com>, mailinglist@notmuchmail.org
@@ -164,7 +164,7 @@ add_message '[from]="Sender <sender@example.com>"' \
 	    '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
 	    '[body]="from guessing test"'
 
-output=$(notmuch reply id:${gen_msg_id})
+output=$(notmuch reply id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <sender@example.com>, mailinglist@notmuchmail.org
@@ -184,7 +184,7 @@ add_message '[from]="Sender <sender@example.com>"' \
 	    '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
 	    '[body]="from guessing test"'
 
-output=$(notmuch reply id:${gen_msg_id})
+output=$(notmuch reply id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <sender@example.com>, mailinglist@notmuchmail.org
@@ -204,7 +204,7 @@ add_message '[from]="Sender <sender@example.com>"' \
 	    '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
 	    '[body]="from guessing test"'
 
-output=$(notmuch reply id:${gen_msg_id})
+output=$(notmuch reply id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <sender@example.com>, mailinglist@notmuchmail.org
diff --git a/test/multipart b/test/multipart
index b40fa2c..05a5f1d 100755
--- a/test/multipart
+++ b/test/multipart
@@ -569,7 +569,7 @@ test_expect_success \
     "! notmuch show --format=mbox --part=1 'id:87liy5ap00.fsf@yoom.home.cworth.org'"
 
 test_begin_subtest "'notmuch reply' to a multipart message"
-notmuch reply 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT
+notmuch reply 'id:87liy5ap00.fsf@yoom.home.cworth.org' | notmuch_reply_sanitize >OUTPUT
 cat <<EOF >EXPECTED
 From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: Multipart message
diff --git a/test/reply b/test/reply
index b0d854a..8929de0 100755
--- a/test/reply
+++ b/test/reply
@@ -9,7 +9,7 @@ add_message '[from]="Sender <sender@example.com>"' \
 	    '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
 	    '[body]="basic reply test"'
 
-output=$(notmuch reply id:${gen_msg_id})
+output=$(notmuch reply id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <sender@example.com>
@@ -26,7 +26,7 @@ add_message '[from]="Sender <sender@example.com>"' \
 	    '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
 	    '[body]="Multiple recipients"'
 
-output=$(notmuch reply id:${gen_msg_id})
+output=$(notmuch reply id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <sender@example.com>, Someone Else <someone@example.com>
@@ -44,7 +44,7 @@ add_message '[from]="Sender <sender@example.com>"' \
 	    '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
 	    '[body]="reply with CC"'
 
-output=$(notmuch reply id:${gen_msg_id})
+output=$(notmuch reply id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <sender@example.com>
@@ -62,7 +62,7 @@ add_message '[from]="Sender <sender@example.com>"' \
 	    '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
 	    '[body]="reply from alternate address"'
 
-output=$(notmuch reply id:${gen_msg_id})
+output=$(notmuch reply id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite_other@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <sender@example.com>
@@ -80,7 +80,7 @@ add_message '[from]="Sender <sender@example.com>"' \
             '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
             '[body]="Reply from address in named group list"'
 
-output=$(notmuch reply id:${gen_msg_id})
+output=$(notmuch reply id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <sender@example.com>, someone@example.com
@@ -98,7 +98,7 @@ add_message '[from]="Sender <sender@example.com>"' \
 	    '[body]="support for reply-to"' \
 	    '[reply-to]="Sender <elsewhere@example.com>"'
 
-output=$(notmuch reply id:${gen_msg_id})
+output=$(notmuch reply id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <elsewhere@example.com>
@@ -116,7 +116,7 @@ add_message '[from]="Sender <sender@example.com>"' \
 	    '[body]="Un-munging Reply-To"' \
 	    '[reply-to]="Evil Munging List <list@example.com>"'
 
-output=$(notmuch reply id:${gen_msg_id})
+output=$(notmuch reply id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <sender@example.com>, Some List <list@example.com>
@@ -130,7 +130,7 @@ test_begin_subtest "Message with header of exactly 200 bytes"
 add_message '[subject]="This subject is exactly 200 bytes in length. Other than its length there is not much of note here. Note that the length of 200 bytes includes the Subject: and Re: prefixes with two spaces"' \
 	    '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
 	    '[body]="200-byte header"'
-output=$(notmuch reply id:${gen_msg_id})
+output=$(notmuch reply id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: This subject is exactly 200 bytes in length. Other than its
  length there is not much of note here. Note that the length of 200 bytes
@@ -149,7 +149,7 @@ add_message '[from]="Sender <sender@example.com>"' \
 	    '[body]="From guessing"' \
 	    '[header]="Envelope-To: test_suite_other@notmuchmail.org"'
 
-output=$(notmuch reply id:${gen_msg_id})
+output=$(notmuch reply id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite_other@notmuchmail.org>
 Subject: Re: From guessing
 To: Sender <sender@example.com>, Recipient <recipient@example.com>
@@ -167,7 +167,7 @@ add_message '[from]="Sender <sender@example.com>"' \
 	    '[body]="From guessing"' \
 	    '[header]="X-Original-To: test_suite@otherdomain.org"'
 
-output=$(notmuch reply id:${gen_msg_id})
+output=$(notmuch reply id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@otherdomain.org>
 Subject: Re: From guessing
 To: Sender <sender@example.com>, Recipient <recipient@example.com>
@@ -185,7 +185,7 @@ add_message '[from]="Sender <sender@example.com>"' \
 	    '[body]="From guessing"' \
 	    '[header]="Delivered-To: test_suite_other@notmuchmail.org"'
 
-output=$(notmuch reply id:${gen_msg_id})
+output=$(notmuch reply id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite_other@notmuchmail.org>
 Subject: Re: From guessing
 To: Sender <sender@example.com>, Recipient <recipient@example.com>
@@ -204,7 +204,7 @@ add_message '[subject]="=?iso-8859-1?q?=e0=df=e7?="' \
 # GMime happens to change from Q- to B-encoding.  We canonicalize the
 # case of the encoding and charset because different versions of GMime
 # capitalize the encoding differently.
-output=$(notmuch reply id:${gen_msg_id} | perl -pe 's/=\?[^?]+\?[bB]\?/lc($&)/ge')
+output=$(notmuch reply id:${gen_msg_id} | perl -pe 's/=\?[^?]+\?[bB]\?/lc($&)/ge' | notmuch_reply_sanitize)
 test_expect_equal "$output" "\
 From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: =?iso-8859-1?b?4N/n?=
diff --git a/test/reply-to-sender b/test/reply-to-sender
index 30e5e38..194b2ae 100755
--- a/test/reply-to-sender
+++ b/test/reply-to-sender
@@ -9,7 +9,7 @@ add_message '[from]="Sender <sender@example.com>"' \
             '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
             '[body]="basic reply-to-sender test"'
 
-output=$(notmuch reply --reply-to=sender id:${gen_msg_id})
+output=$(notmuch reply --reply-to=sender id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <sender@example.com>
@@ -26,7 +26,7 @@ add_message '[from]="Notmuch Test Suite <test_suite@notmuchmail.org>"' \
             '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
             '[body]="basic reply-to-from-us test"'
 
-output=$(notmuch reply --reply-to=sender id:${gen_msg_id})
+output=$(notmuch reply --reply-to=sender id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Recipient <recipient@example.com>
@@ -43,7 +43,7 @@ add_message '[from]="Sender <sender@example.com>"' \
             '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
             '[body]="Multiple recipients"'
 
-output=$(notmuch reply  --reply-to=sender  id:${gen_msg_id})
+output=$(notmuch reply --reply-to=sender id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <sender@example.com>
@@ -60,7 +60,7 @@ add_message '[from]="Notmuch Test Suite <test_suite@notmuchmail.org>"' \
             '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
             '[body]="From Us, Multiple TO recipients"'
 
-output=$(notmuch reply  --reply-to=sender  id:${gen_msg_id})
+output=$(notmuch reply --reply-to=sender id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Recipient <recipient@example.com>, Someone Else <someone@example.com>
@@ -78,7 +78,7 @@ add_message '[from]="Sender <sender@example.com>"' \
             '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
             '[body]="reply with CC"'
 
-output=$(notmuch reply  --reply-to=sender id:${gen_msg_id})
+output=$(notmuch reply --reply-to=sender id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <sender@example.com>
@@ -96,7 +96,7 @@ add_message '[from]="Notmuch Test Suite <test_suite@notmuchmail.org>"' \
             '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
             '[body]="reply with CC"'
 
-output=$(notmuch reply  --reply-to=sender id:${gen_msg_id})
+output=$(notmuch reply --reply-to=sender id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Recipient <recipient@example.com>
@@ -113,7 +113,7 @@ add_message '[from]="Notmuch Test Suite <test_suite@notmuchmail.org>"' \
             '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
             '[body]="reply with CC"'
 
-output=$(notmuch reply  --reply-to=sender id:${gen_msg_id})
+output=$(notmuch reply --reply-to=sender id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 Cc: Other Parties <cc@example.com>
@@ -130,7 +130,7 @@ add_message '[from]="Sender <sender@example.com>"' \
             '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
             '[body]="reply from alternate address"'
 
-output=$(notmuch reply  --reply-to=sender id:${gen_msg_id})
+output=$(notmuch reply --reply-to=sender id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite_other@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <sender@example.com>
@@ -148,7 +148,7 @@ add_message '[from]="Sender <sender@example.com>"' \
             '[body]="support for reply-to"' \
             '[reply-to]="Sender <elsewhere@example.com>"'
 
-output=$(notmuch reply  --reply-to=sender id:${gen_msg_id})
+output=$(notmuch reply --reply-to=sender id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <elsewhere@example.com>
@@ -166,7 +166,7 @@ add_message '[from]="Sender <sender@example.com>"' \
             '[body]="support for reply-to with multiple recipients"' \
             '[reply-to]="Sender <elsewhere@example.com>"'
 
-output=$(notmuch reply  --reply-to=sender id:${gen_msg_id})
+output=$(notmuch reply --reply-to=sender id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <elsewhere@example.com>
@@ -184,7 +184,7 @@ add_message '[from]="Sender <sender@example.com>"' \
             '[body]="Un-munging Reply-To"' \
             '[reply-to]="Evil Munging List <list@example.com>"'
 
-output=$(notmuch reply  --reply-to=sender id:${gen_msg_id})
+output=$(notmuch reply --reply-to=sender id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: notmuch-reply-test
 To: Sender <sender@example.com>
@@ -198,7 +198,7 @@ test_begin_subtest "Message with header of exactly 200 bytes"
 add_message '[subject]="This subject is exactly 200 bytes in length. Other than its length there is not much of note here. Note that the length of 200 bytes includes the Subject: and Re: prefixes with two spaces"' \
             '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
             '[body]="200-byte header"'
-output=$(notmuch reply  --reply-to=sender id:${gen_msg_id})
+output=$(notmuch reply --reply-to=sender id:${gen_msg_id} | notmuch_reply_sanitize)
 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
 Subject: Re: This subject is exactly 200 bytes in length. Other than its
  length there is not much of note here. Note that the length of 200 bytes
-- 
1.8.4.2

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: fix for failing tests with gmime 2.6.19
  2013-11-10 16:21 fix for failing tests with gmime 2.6.19 David Bremner
  2013-11-10 16:21 ` [PATCH 1/2] test: add optional workaround for gmime bug David Bremner
  2013-11-10 16:21 ` [PATCH 2/2] test: work around gmime bug using notmuch_reply_sanitize David Bremner
@ 2013-11-11  3:47 ` Daniel Kahn Gillmor
  2013-11-11 11:57   ` David Bremner
  2013-11-18 17:54 ` Tomi Ollila
  3 siblings, 1 reply; 13+ messages in thread
From: Daniel Kahn Gillmor @ 2013-11-11  3:47 UTC (permalink / raw)
  To: notmuch

On 11/10/2013 11:21 AM, David Bremner wrote:
> Although Jeffrey Stedfast fixed gmime bug 711305 amazingly quickly, it
> looks like many people still have to live with a buggy version of
> gmime for a while yet. Here is an opt-in fix that stops the test suite
> from failing; this is a simple fix for e.g. the debian build process.

I think you're referring to:

https://bugzilla.gnome.org/show_bug.cgi?id=711305

Please don't introduce this cruft into the notmuch codebase.  It should
be fixed in gmime, not worked-around notmuch.

I've just uploaded gmime 2.6.19-2 to unstable to address this issue.

	--dkg

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: fix for failing tests with gmime 2.6.19
  2013-11-11  3:47 ` fix for failing tests with gmime 2.6.19 Daniel Kahn Gillmor
@ 2013-11-11 11:57   ` David Bremner
  2013-11-11 13:42     ` David Bremner
  2013-11-11 14:59     ` Tomi Ollila
  0 siblings, 2 replies; 13+ messages in thread
From: David Bremner @ 2013-11-11 11:57 UTC (permalink / raw)
  To: Daniel Kahn Gillmor, notmuch

Daniel Kahn Gillmor <dkg@fifthhorseman.net> writes:

>
> Please don't introduce this cruft into the notmuch codebase.  It should
> be fixed in gmime, not worked-around notmuch.
>
> I've just uploaded gmime 2.6.19-2 to unstable to address this issue.
>

Hi Daniel;

Thanks a lot for that. 

What I (still) wonder about is all the people not running Debian, in the
interval between the release of notmuch 0.17 and the next upstream
release of gmime (and propagation to various distros).  Even on Debian,
building on testing and backports complicates things a bit.

d

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: fix for failing tests with gmime 2.6.19
  2013-11-11 11:57   ` David Bremner
@ 2013-11-11 13:42     ` David Bremner
  2013-11-16 20:16       ` Jameson Graef Rollins
  2013-11-11 14:59     ` Tomi Ollila
  1 sibling, 1 reply; 13+ messages in thread
From: David Bremner @ 2013-11-11 13:42 UTC (permalink / raw)
  To: Daniel Kahn Gillmor, notmuch

David Bremner <david@tethera.net> writes:

> Daniel Kahn Gillmor <dkg@fifthhorseman.net> writes:
>
>>
>> Please don't introduce this cruft into the notmuch codebase.  It should
>> be fixed in gmime, not worked-around notmuch.
>>
>> I've just uploaded gmime 2.6.19-2 to unstable to address this issue.
>>
>
> Hi Daniel;
>
> Thanks a lot for that. 
>
> What I (still) wonder about is all the people not running Debian, in the
> interval between the release of notmuch 0.17 and the next upstream
> release of gmime (and propagation to various distros).  Even on Debian,
> building on testing and backports complicates things a bit.

An alternative approach would be to fix 

 NOTMUCH_SKIP_TESTS="reply reply-to-sender multipart.37 from-guessing" ./notmuch-test

to return exist status 0, and ideally to print the correct number of
tests skipped.

I think the former just requires patching line 85 of
aggregate-results.sh.  I don't see an easy way to do the latter.

This is arguably less crufty, or at least uses existing cruft. On the
other hand, it doesn't distinguish between a test printing an extra
space, and complete garbage.

d

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: fix for failing tests with gmime 2.6.19
  2013-11-11 11:57   ` David Bremner
  2013-11-11 13:42     ` David Bremner
@ 2013-11-11 14:59     ` Tomi Ollila
  2013-11-11 16:01       ` Jani Nikula
  1 sibling, 1 reply; 13+ messages in thread
From: Tomi Ollila @ 2013-11-11 14:59 UTC (permalink / raw)
  To: David Bremner, Daniel Kahn Gillmor, notmuch

On Mon, Nov 11 2013, David Bremner <david@tethera.net> wrote:

> Daniel Kahn Gillmor <dkg@fifthhorseman.net> writes:
>
>>
>> Please don't introduce this cruft into the notmuch codebase.  It should
>> be fixed in gmime, not worked-around notmuch.
>>
>> I've just uploaded gmime 2.6.19-2 to unstable to address this issue.
>>
>
> Hi Daniel;
>
> Thanks a lot for that. 
>
> What I (still) wonder about is all the people not running Debian, in the
> interval between the release of notmuch 0.17 and the next upstream
> release of gmime (and propagation to various distros).  Even on Debian,
> building on testing and backports complicates things a bit.

Something like this could also be used...

diff --git a/notmuch-reply.c b/notmuch-reply.c
index 9d6f843..2ab0f6e 100644
--- a/notmuch-reply.c
+++ b/notmuch-reply.c
@@ -26,6 +26,7 @@
 static void
 show_reply_headers (GMimeMessage *message)
 {
+#if ! GMIME_CHECK_VERSION(2,6,19)
     GMimeStream *stream_stdout = NULL;
 
     stream_stdout = g_mime_stream_file_new (stdout);
@@ -35,6 +36,17 @@ show_reply_headers (GMimeMessage *message)
 	g_mime_object_write_to_stream (GMIME_OBJECT(message), stream_stdout);
 	g_object_unref(stream_stdout);
     }
+#else
+    char * msg = g_mime_object_to_string (GMIME_OBJECT(message));
+    char * rp = strstr (msg, "References:  ");
+    if (rp) {
+	fwrite (msg, 1, rp - msg + 12, stdout); // Up to 'References: '
+	fputs (rp + 13, stdout);
+    }
+    else {
+	fputs (msg, stdout);
+    }
+#endif
 }
 
 static void


>
> d

Tomi

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: fix for failing tests with gmime 2.6.19
  2013-11-11 14:59     ` Tomi Ollila
@ 2013-11-11 16:01       ` Jani Nikula
  0 siblings, 0 replies; 13+ messages in thread
From: Jani Nikula @ 2013-11-11 16:01 UTC (permalink / raw)
  To: Tomi Ollila; +Cc: Notmuch Mail, Daniel Kahn Gillmor

[-- Attachment #1: Type: text/plain, Size: 2019 bytes --]

Gmime doesn't do anything standards incompliant, so I'd prefer patching the
test suite. Which is also why I'd like to work around this in notmuch.
On Nov 11, 2013 4:59 PM, "Tomi Ollila" <tomi.ollila@iki.fi> wrote:

> On Mon, Nov 11 2013, David Bremner <david@tethera.net> wrote:
>
> > Daniel Kahn Gillmor <dkg@fifthhorseman.net> writes:
> >
> >>
> >> Please don't introduce this cruft into the notmuch codebase.  It should
> >> be fixed in gmime, not worked-around notmuch.
> >>
> >> I've just uploaded gmime 2.6.19-2 to unstable to address this issue.
> >>
> >
> > Hi Daniel;
> >
> > Thanks a lot for that.
> >
> > What I (still) wonder about is all the people not running Debian, in the
> > interval between the release of notmuch 0.17 and the next upstream
> > release of gmime (and propagation to various distros).  Even on Debian,
> > building on testing and backports complicates things a bit.
>
> Something like this could also be used...
>
> diff --git a/notmuch-reply.c b/notmuch-reply.c
> index 9d6f843..2ab0f6e 100644
> --- a/notmuch-reply.c
> +++ b/notmuch-reply.c
> @@ -26,6 +26,7 @@
>  static void
>  show_reply_headers (GMimeMessage *message)
>  {
> +#if ! GMIME_CHECK_VERSION(2,6,19)
>      GMimeStream *stream_stdout = NULL;
>
>      stream_stdout = g_mime_stream_file_new (stdout);
> @@ -35,6 +36,17 @@ show_reply_headers (GMimeMessage *message)
>         g_mime_object_write_to_stream (GMIME_OBJECT(message),
> stream_stdout);
>         g_object_unref(stream_stdout);
>      }
> +#else
> +    char * msg = g_mime_object_to_string (GMIME_OBJECT(message));
> +    char * rp = strstr (msg, "References:  ");
> +    if (rp) {
> +       fwrite (msg, 1, rp - msg + 12, stdout); // Up to 'References: '
> +       fputs (rp + 13, stdout);
> +    }
> +    else {
> +       fputs (msg, stdout);
> +    }
> +#endif
>  }
>
>  static void
>
>
> >
> > d
>
> Tomi
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch
>

[-- Attachment #2: Type: text/html, Size: 2830 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: fix for failing tests with gmime 2.6.19
  2013-11-11 13:42     ` David Bremner
@ 2013-11-16 20:16       ` Jameson Graef Rollins
  2013-11-16 23:00         ` David Bremner
  0 siblings, 1 reply; 13+ messages in thread
From: Jameson Graef Rollins @ 2013-11-16 20:16 UTC (permalink / raw)
  To: David Bremner, Daniel Kahn Gillmor, notmuch

[-- Attachment #1: Type: text/plain, Size: 1673 bytes --]

On Mon, Nov 11 2013, David Bremner <david@tethera.net> wrote:
> David Bremner <david@tethera.net> writes:
>
>> Daniel Kahn Gillmor <dkg@fifthhorseman.net> writes:
>>
>>>
>>> Please don't introduce this cruft into the notmuch codebase.  It should
>>> be fixed in gmime, not worked-around notmuch.
>>>
>>> I've just uploaded gmime 2.6.19-2 to unstable to address this issue.
>>>
>>
>> Hi Daniel;
>>
>> Thanks a lot for that. 
>>
>> What I (still) wonder about is all the people not running Debian, in the
>> interval between the release of notmuch 0.17 and the next upstream
>> release of gmime (and propagation to various distros).  Even on Debian,
>> building on testing and backports complicates things a bit.
>
> An alternative approach would be to fix 
>
>  NOTMUCH_SKIP_TESTS="reply reply-to-sender multipart.37 from-guessing" ./notmuch-test
>
> to return exist status 0, and ideally to print the correct number of
> tests skipped.
>
> I think the former just requires patching line 85 of
> aggregate-results.sh.  I don't see an easy way to do the latter.
>
> This is arguably less crufty, or at least uses existing cruft. On the
> other hand, it doesn't distinguish between a test printing an extra
> space, and complete garbage.

I agree with Daniel that the original series adds a whole lot of
undesirable cruft to the test suite to get around one transient issue in
one of the notmuch dependencies.  That doesn't seem like the best thing
to do imho.  I would vote for this option instead, which doesn't modify
the test suite and just skips the affected tests until the new gmime
versions falls through everywhere.

jamie.

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: fix for failing tests with gmime 2.6.19
  2013-11-16 20:16       ` Jameson Graef Rollins
@ 2013-11-16 23:00         ` David Bremner
  0 siblings, 0 replies; 13+ messages in thread
From: David Bremner @ 2013-11-16 23:00 UTC (permalink / raw)
  To: Jameson Graef Rollins, Daniel Kahn Gillmor, notmuch

Jameson Graef Rollins <jrollins@finestructure.net> writes:

> I agree with Daniel that the original series adds a whole lot of
> undesirable cruft to the test suite to get around one transient issue in
> one of the notmuch dependencies.  That doesn't seem like the best thing
> to do imho.  I would vote for this option instead, which doesn't modify
> the test suite and just skips the affected tests until the new gmime
> versions falls through everywhere.

FWIW, it does modify the test suite. The
patch-which-no-one-wrote-yet-but-probably-isn't-that-hard would have to
change the test suite to not treat skipped tests as errors.  I'm not
sure whether that's a harmless change or not. Missing prerequisites also
cause tests to be skipped, so in a sense this a change with more
repercussions.

d

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: fix for failing tests with gmime 2.6.19
  2013-11-10 16:21 fix for failing tests with gmime 2.6.19 David Bremner
                   ` (2 preceding siblings ...)
  2013-11-11  3:47 ` fix for failing tests with gmime 2.6.19 Daniel Kahn Gillmor
@ 2013-11-18 17:54 ` Tomi Ollila
  3 siblings, 0 replies; 13+ messages in thread
From: Tomi Ollila @ 2013-11-18 17:54 UTC (permalink / raw)
  To: David Bremner, notmuch

On Sun, Nov 10 2013, David Bremner <david@tethera.net> wrote:

> Although Jeffrey Stedfast fixed gmime bug 711305 amazingly quickly, it
> looks like many people still have to live with a buggy version of
> gmime for a while yet. Here is an opt-in fix that stops the test suite
> from failing; this is a simple fix for e.g. the debian build process.

After looking throught all the comments and thinking about the options
I see the following 2 options

1) Keep things as those currently are. Anyone who runs tests when 
   gmime 2.6.19 is in use will see some tests fail (and some may not have
   a clue what's going on). We could mention this first thing in the NEWS
   so that the "professional" users who run test *and* reads NEWS will
   get the clue. 

2) Push the current patches to release branch *only* (maybe the test
   could be changed to if [ pkg-config --exact-version=2.6.19 gmime-2.6 ] (*)
   instead of checking the WORKAROUNDS flag so that users would not have
   to bother (and some may not have a clue what's going on)). During merge
   to master (as it has been done in the past) these changes would probably
   be dropped.

2b) Merge to master, release 0.17, follow gmime deployments, revert
    patches.


IMHO for temporary problems there could be temporary cruft (which would
not be cruft if the problem wasn't temporary). The test system must
be as strict as it can be to ensure best failure coverage.

Tomi


(*) The fastest (& most cruftiest) implementation:

notmuch_reply_sanitize ()
{
   if pkg-config --exact-version=2.6.19 gmime-2.6 >/dev/null
   then
        notmuch_reply_sanitize () {
	   # work around GMIME bug #711305
	    sed -e 's/^References:  /References: /'
        }
   else     
        notmuch_reply_sanitize () {
	    cat
        }
   fi
   notmuch_reply_sanitize # call just rewritten version of this function
}

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2013-11-18 17:55 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-10 16:21 fix for failing tests with gmime 2.6.19 David Bremner
2013-11-10 16:21 ` [PATCH 1/2] test: add optional workaround for gmime bug David Bremner
2013-11-10 16:21 ` [PATCH 2/2] test: work around gmime bug using notmuch_reply_sanitize David Bremner
2013-11-11  3:15   ` [Patch v2 1/2] test: add optional workaround for gmime bug David Bremner
2013-11-11  3:15     ` [Patch v2 2/2] test: work around gmime bug using notmuch_reply_sanitize David Bremner
2013-11-11  3:47 ` fix for failing tests with gmime 2.6.19 Daniel Kahn Gillmor
2013-11-11 11:57   ` David Bremner
2013-11-11 13:42     ` David Bremner
2013-11-16 20:16       ` Jameson Graef Rollins
2013-11-16 23:00         ` David Bremner
2013-11-11 14:59     ` Tomi Ollila
2013-11-11 16:01       ` Jani Nikula
2013-11-18 17:54 ` Tomi Ollila

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).