1 Return-Path: <bremner@tesseract.cs.unb.ca>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by arlo.cworth.org (Postfix) with ESMTP id 37C056DE1502
\r
6 for <notmuch@notmuchmail.org>; Mon, 3 Aug 2015 23:50:44 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org
\r
11 X-Spam-Status: No, score=0.147 tagged_above=-999 required=5 tests=[AWL=0.137,
\r
12 T_HEADER_FROM_DIFFERENT_DOMAINS=0.01] autolearn=disabled
\r
13 Received: from arlo.cworth.org ([127.0.0.1])
\r
14 by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id cP2gJ-PAncDV for <notmuch@notmuchmail.org>;
\r
16 Mon, 3 Aug 2015 23:50:42 -0700 (PDT)
\r
17 Received: from gitolite.debian.net (gitolite.debian.net [87.98.215.224])
\r
18 by arlo.cworth.org (Postfix) with ESMTPS id 3767E6DE13A8
\r
19 for <notmuch@notmuchmail.org>; Mon, 3 Aug 2015 23:50:42 -0700 (PDT)
\r
20 Received: from remotemail by gitolite.debian.net with local (Exim 4.80)
\r
21 (envelope-from <bremner@tesseract.cs.unb.ca>)
\r
22 id 1ZMW2X-0000QU-Ci; Tue, 04 Aug 2015 06:49:33 +0000
\r
23 Received: (nullmailer pid 17858 invoked by uid 1000); Tue, 04 Aug 2015
\r
25 From: David Bremner <david@tethera.net>
\r
26 To: Tomi Ollila <tomi.ollila@iki.fi>, David Bremner <david@tethera.net>
\r
27 Subject: [PATCH 3/3] test: add debugging output to notmuch-new tests, mark 5
\r
29 Date: Tue, 4 Aug 2015 08:48:34 +0200
\r
30 Message-Id: <1438670914-17203-4-git-send-email-david@tethera.net>
\r
31 X-Mailer: git-send-email 2.1.4
\r
32 In-Reply-To: <1438670914-17203-1-git-send-email-david@tethera.net>
\r
33 References: <m2a8ua2gm9.fsf@guru.guru-group.fi>
\r
34 <1438670914-17203-1-git-send-email-david@tethera.net>
\r
35 Cc: notmuch@notmuchmail.org
\r
36 X-BeenThere: notmuch@notmuchmail.org
\r
37 X-Mailman-Version: 2.1.18
\r
39 List-Id: "Use and development of the notmuch mail system."
\r
40 <notmuch.notmuchmail.org>
\r
41 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
42 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
43 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>
\r
44 List-Post: <mailto:notmuch@notmuchmail.org>
\r
45 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
46 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
47 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
48 X-List-Received-Date: Tue, 04 Aug 2015 06:50:44 -0000
\r
50 I marked the tests where I really couldn't understand the output as
\r
51 broken. It could also be that I don't understand how directory removal
\r
52 is supposed to work.
\r
54 test/T050-new.sh | 62 ++++++++++++++++++++++++++++++++------------------------
\r
55 1 file changed, 35 insertions(+), 27 deletions(-)
\r
57 diff --git a/test/T050-new.sh b/test/T050-new.sh
\r
58 index ab15ca1..ff1c354 100755
\r
59 --- a/test/T050-new.sh
\r
60 +++ b/test/T050-new.sh
\r
61 @@ -3,25 +3,25 @@ test_description='"notmuch new" in several variations'
\r
64 test_begin_subtest "No new messages"
\r
65 -output=$(NOTMUCH_NEW)
\r
66 +output=$(NOTMUCH_NEW --debug)
\r
67 test_expect_equal "$output" "No new mail."
\r
70 test_begin_subtest "Single new message"
\r
72 -output=$(NOTMUCH_NEW)
\r
73 +output=$(NOTMUCH_NEW --debug)
\r
74 test_expect_equal "$output" "Added 1 new message to the database."
\r
77 test_begin_subtest "Multiple new messages"
\r
80 -output=$(NOTMUCH_NEW)
\r
81 +output=$(NOTMUCH_NEW --debug)
\r
82 test_expect_equal "$output" "Added 2 new messages to the database."
\r
85 test_begin_subtest "No new messages (non-empty DB)"
\r
86 -output=$(NOTMUCH_NEW)
\r
87 +output=$(NOTMUCH_NEW --debug)
\r
88 test_expect_equal "$output" "No new mail."
\r
91 @@ -31,7 +31,7 @@ mkdir "${MAIL_DIR}"/def
\r
92 mkdir "${MAIL_DIR}"/ghi
\r
93 generate_message [dir]=def
\r
95 -output=$(NOTMUCH_NEW)
\r
96 +output=$(NOTMUCH_NEW --debug)
\r
97 test_expect_equal "$output" "Added 1 new message to the database."
\r
100 @@ -42,7 +42,7 @@ mv "${MAIL_DIR}"/ghi "${MAIL_DIR}"/abc
\r
101 rm "${MAIL_DIR}"/def/*
\r
102 generate_message [dir]=abc
\r
104 -output=$(NOTMUCH_NEW)
\r
105 +output=$(NOTMUCH_NEW --debug)
\r
106 test_expect_equal "$output" "Added 1 new message to the database."
\r
109 @@ -54,7 +54,7 @@ mkdir -p "$(dirname "$tmp_msg_filename")"
\r
110 mv "$gen_msg_filename" "$tmp_msg_filename"
\r
111 notmuch new > /dev/null
\r
112 mv "$tmp_msg_filename" "$gen_msg_filename"
\r
113 -output=$(NOTMUCH_NEW)
\r
114 +output=$(NOTMUCH_NEW --debug)
\r
115 test_expect_equal "$output" "Added 1 new message to the database."
\r
118 @@ -87,34 +87,39 @@ notmuch new > /dev/null
\r
120 mv "${MAIL_DIR}"/dir "${MAIL_DIR}"/dir-renamed
\r
122 -output=$(NOTMUCH_NEW)
\r
123 -test_expect_equal "$output" "No new mail. Detected 3 file renames."
\r
124 +output=$(NOTMUCH_NEW --debug)
\r
125 +test_expect_equal "$output" "(D) add_files_recursive, pass 2: queuing passed directory ${MAIL_DIR}/dir for deletion from database
\r
126 +No new mail. Detected 3 file renames."
\r
129 test_begin_subtest "Deleted directory"
\r
131 +test_subtest_known_broken
\r
132 rm -rf "${MAIL_DIR}"/dir-renamed
\r
134 -output=$(NOTMUCH_NEW)
\r
135 -test_expect_equal "$output" "No new mail. Removed 3 messages."
\r
136 +output=$(NOTMUCH_NEW --debug)
\r
137 +test_expect_equal "$output" "(D) add_files_recursive, pass 2: queuing passed directory ${MAIL_DIR}/dir-renamed for deletion from database
\r
138 +No new mail. Removed 3 messages."
\r
141 test_begin_subtest "New directory (at end of list)"
\r
142 +test_subtest_known_broken
\r
144 generate_message [dir]=zzz
\r
145 generate_message [dir]=zzz
\r
146 generate_message [dir]=zzz
\r
148 -output=$(NOTMUCH_NEW)
\r
149 +output=$(NOTMUCH_NEW --debug)
\r
150 test_expect_equal "$output" "Added 3 new messages to the database."
\r
153 test_begin_subtest "Deleted directory (end of list)"
\r
155 +test_subtest_known_broken
\r
156 rm -rf "${MAIL_DIR}"/zzz
\r
158 -output=$(NOTMUCH_NEW)
\r
159 -test_expect_equal "$output" "No new mail. Removed 3 messages."
\r
160 +output=$(NOTMUCH_NEW --debug)
\r
161 +test_expect_equal "$output" "(D) add_files_recursive, pass 3: queuing leftover directory ${MAIL_DIR}/zzz for deletion from database
\r
162 +No new mail. Removed 3 messages."
\r
165 test_begin_subtest "New symlink to directory"
\r
166 @@ -125,7 +130,7 @@ mv "${MAIL_DIR}" "${TMP_DIRECTORY}"/actual_maildir
\r
167 mkdir "${MAIL_DIR}"
\r
168 ln -s "${TMP_DIRECTORY}"/actual_maildir "${MAIL_DIR}"/symlink
\r
170 -output=$(NOTMUCH_NEW)
\r
171 +output=$(NOTMUCH_NEW --debug)
\r
172 test_expect_equal "$output" "Added 1 new message to the database."
\r
175 @@ -135,13 +140,13 @@ external_msg_filename="${TMP_DIRECTORY}"/external/"$(basename "$gen_msg_filename
\r
176 mkdir -p "$(dirname "$external_msg_filename")"
\r
177 mv "$gen_msg_filename" "$external_msg_filename"
\r
178 ln -s "$external_msg_filename" "$gen_msg_filename"
\r
179 -output=$(NOTMUCH_NEW)
\r
180 +output=$(NOTMUCH_NEW --debug)
\r
181 test_expect_equal "$output" "Added 1 new message to the database."
\r
184 test_begin_subtest "Broken symlink aborts"
\r
185 ln -s does-not-exist "${MAIL_DIR}/broken"
\r
186 -output=$(NOTMUCH_NEW 2>&1)
\r
187 +output=$(NOTMUCH_NEW --debug 2>&1)
\r
188 test_expect_equal "$output" \
\r
189 "Error reading file ${MAIL_DIR}/broken: No such file or directory
\r
190 Note: A fatal error was encountered: Something went wrong trying to read or write a file
\r
191 @@ -155,7 +160,7 @@ generate_message [dir]=two/levels
\r
192 generate_message [dir]=two/levels
\r
193 generate_message [dir]=two/levels
\r
195 -output=$(NOTMUCH_NEW)
\r
196 +output=$(NOTMUCH_NEW --debug)
\r
197 test_expect_equal "$output" "Added 3 new messages to the database."
\r
200 @@ -163,10 +168,12 @@ test_begin_subtest "Deleted two-level directory"
\r
202 rm -rf "${MAIL_DIR}"/two
\r
204 -output=$(NOTMUCH_NEW)
\r
205 -test_expect_equal "$output" "No new mail. Removed 3 messages."
\r
206 +output=$(NOTMUCH_NEW --debug)
\r
207 +test_expect_equal "$output" "(D) add_files_recursive, pass 3: queuing leftover directory ${MAIL_DIR}/two for deletion from database
\r
208 +No new mail. Removed 3 messages."
\r
210 test_begin_subtest "Support single-message mbox"
\r
211 +test_subtest_known_broken
\r
212 cat > "${MAIL_DIR}"/mbox_file1 <<EOF
\r
213 From test_suite@notmuchmail.org Fri Jan 5 15:43:57 2001
\r
214 From: Notmuch Test Suite <test_suite@notmuchmail.org>
\r
215 @@ -175,11 +182,12 @@ Subject: Test mbox message 1
\r
219 -output=$(NOTMUCH_NEW 2>&1)
\r
220 +output=$(NOTMUCH_NEW --debug 2>&1)
\r
221 test_expect_equal "$output" "Added 1 new message to the database."
\r
223 # This test requires that notmuch new has been run at least once.
\r
224 test_begin_subtest "Skip and report non-mail files"
\r
225 +test_subtest_known_broken
\r
227 mkdir -p "${MAIL_DIR}"/.git && touch "${MAIL_DIR}"/.git/config
\r
228 touch "${MAIL_DIR}"/ignored_file
\r
229 @@ -199,7 +207,7 @@ Subject: Test mbox message 2
\r
233 -output=$(NOTMUCH_NEW 2>&1)
\r
234 +output=$(NOTMUCH_NEW --debug 2>&1)
\r
235 test_expect_equal "$output" \
\r
236 "Note: Ignoring non-mail file: ${MAIL_DIR}/.git/config
\r
237 Note: Ignoring non-mail file: ${MAIL_DIR}/.ignored_hidden_file
\r
238 @@ -267,23 +275,23 @@ OLDCONFIG=$(notmuch config get new.tags)
\r
240 test_begin_subtest "Empty tags in new.tags are forbidden"
\r
241 notmuch config set new.tags "foo;;bar"
\r
242 -output=$(NOTMUCH_NEW 2>&1)
\r
243 +output=$(NOTMUCH_NEW --debug 2>&1)
\r
244 test_expect_equal "$output" "Error: tag '' in new.tags: empty tag forbidden"
\r
246 test_begin_subtest "Tags starting with '-' in new.tags are forbidden"
\r
247 notmuch config set new.tags "-foo;bar"
\r
248 -output=$(NOTMUCH_NEW 2>&1)
\r
249 +output=$(NOTMUCH_NEW --debug 2>&1)
\r
250 test_expect_equal "$output" "Error: tag '-foo' in new.tags: tag starting with '-' forbidden"
\r
252 test_expect_code 1 "Invalid tags set exit code" \
\r
253 - "NOTMUCH_NEW 2>&1"
\r
254 + "NOTMUCH_NEW --debug 2>&1"
\r
256 notmuch config set new.tags $OLDCONFIG
\r
259 test_begin_subtest "Xapian exception: read only files"
\r
260 chmod u-w ${MAIL_DIR}/.notmuch/xapian/*.DB
\r
261 -output=$(NOTMUCH_NEW 2>&1 | sed 's/: .*$//' )
\r
262 +output=$(NOTMUCH_NEW --debug 2>&1 | sed 's/: .*$//' )
\r
263 chmod u+w ${MAIL_DIR}/.notmuch/xapian/*.DB
\r
264 test_expect_equal "$output" "A Xapian exception occurred opening database"
\r