RE: [Spam-verdenking][english 100%] RE: Reply all - issue
[notmuch-archives.git] / 97 / c5420f4d60b75f595ac3d3a9bdc32804e96059
1 Return-Path: <pieter@praet.org>\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 olra.theworths.org (Postfix) with ESMTP id D2CD9431E64\r
6         for <notmuch@notmuchmail.org>; Wed,  1 Feb 2012 05:46:54 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id qyFW4JxyT1FK for <notmuch@notmuchmail.org>;\r
16         Wed,  1 Feb 2012 05:46:52 -0800 (PST)\r
17 Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com\r
18  [74.125.82.45])        (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
19  certificate requested) by olra.theworths.org (Postfix) with ESMTPS id\r
20  77EC9431FAF    for <notmuch@notmuchmail.org>; Wed,  1 Feb 2012 05:46:52 -0800\r
21  (PST)\r
22 Received: by wgbdt12 with SMTP id dt12so1140242wgb.2\r
23         for <notmuch@notmuchmail.org>; Wed, 01 Feb 2012 05:46:49 -0800 (PST)\r
24 Received: by 10.180.90.194 with SMTP id by2mr18635007wib.5.1328104009682;\r
25         Wed, 01 Feb 2012 05:46:49 -0800 (PST)\r
26 Received: from localhost ([109.131.39.11])\r
27         by mx.google.com with ESMTPS id y1sm22197586wiw.6.2012.02.01.05.46.48\r
28         (version=TLSv1/SSLv3 cipher=OTHER);\r
29         Wed, 01 Feb 2012 05:46:48 -0800 (PST)\r
30 From: Pieter Praet <pieter@praet.org>\r
31 To: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
32 Subject: Re: [PATCH v4] test: emacs: add test for `notmuch-search-operate-all'\r
33 In-Reply-To: <87y5spober.fsf@gmail.com>\r
34 References: <1327599289-16865-1-git-send-email-dmitry.kurochkin@gmail.com>\r
35         <1327909550-6788-1-git-send-email-pieter@praet.org>\r
36         <87y5spober.fsf@gmail.com>\r
37 User-Agent: Notmuch/0.11+132~ga81001f (http://notmuchmail.org) Emacs/23.3.1\r
38         (x86_64-unknown-linux-gnu)\r
39 Date: Wed, 01 Feb 2012 14:44:48 +0100\r
40 Message-ID: <877h067jn3.fsf@praet.org>\r
41 MIME-Version: 1.0\r
42 Content-Type: text/plain; charset=us-ascii\r
43 Cc: Notmuch Mail <notmuch@notmuchmail.org>\r
44 X-BeenThere: notmuch@notmuchmail.org\r
45 X-Mailman-Version: 2.1.13\r
46 Precedence: list\r
47 List-Id: "Use and development of the notmuch mail system."\r
48         <notmuch.notmuchmail.org>\r
49 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
50         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
51 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
52 List-Post: <mailto:notmuch@notmuchmail.org>\r
53 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
54 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
55         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
56 X-List-Received-Date: Wed, 01 Feb 2012 13:46:55 -0000\r
57 \r
58 On Mon, 30 Jan 2012 12:13:48 +0400, Dmitry Kurochkin <dmitry.kurochkin@gmail.com> wrote:\r
59 > Hi Pieter.\r
60\r
61 > On Mon, 30 Jan 2012 08:45:50 +0100, Pieter Praet <pieter@praet.org> wrote:\r
62 > > `notmuch-search-operate-all' (bound to "*") adds and removes tags\r
63 > > to/from all messages which match the query used to populate the\r
64 > > current search buffer.\r
65 > > \r
66 > > ---\r
67 > > \r
68 > > Rebased to current master.\r
69 > > \r
70 > > Previous versions (chronologically):\r
71 > > - id:"1309450108-2793-1-git-send-email-pieter@praet.org"\r
72 > > - id:"1309762318-4530-5-git-send-email-pieter@praet.org"\r
73 > > - id:"1310313335-4159-5-git-send-email-pieter@praet.org"\r
74 > > \r
75\r
76 > This looks like a useful patch series.  We definitely need more tests\r
77 > for tagging operations in the Emacs UI.  Do you plan to revive it?\r
78\r
79 \r
80 Absolutely.  In fact, it's still alive and kicking on a local branch :)\r
81 \r
82 \r
83 > Note that not so long ago I posted a bunch of tagging-related patches\r
84 > [1] that would conflict with this patch at least because of\r
85 > `notmuch-search-operate-all' being renamed to `notmuch-search-tag-all'.\r
86\r
87 \r
88 Nice series!  Will probably be pushed in the next few days,\r
89 so I'll hold off on resubmitting the tests until then.\r
90 \r
91 \r
92 > > \r
93 > >  test/emacs |   19 +++++++++++++++++++\r
94 > >  1 files changed, 19 insertions(+), 0 deletions(-)\r
95 > > \r
96 > > diff --git a/test/emacs b/test/emacs\r
97 > > index 8ca4c8a..e94ad94 100755\r
98 > > --- a/test/emacs\r
99 > > +++ b/test/emacs\r
100 > > @@ -124,6 +124,25 @@ test_emacs "(notmuch-show \"$os_x_darwin_thread\")\r
101 > >  output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize)\r
102 > >  test_expect_equal "$output" "thread:XXX   2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox unread)"\r
103 > >  \r
104 > > +test_begin_subtest "Add/remove tags to/from all matching messages."\r
105 > > +test_emacs '(notmuch-search "tag:inbox AND tags")\r
106 > > +       (notmuch-test-wait)\r
107 > > +       (notmuch-search-operate-all "+matching" "-inbox")\r
108 > > +       (notmuch-search "tag:matching AND NOT tag:inbox")\r
109 > > +       (notmuch-test-wait)\r
110 > > +       (test-output)'\r
111 > > +cat <<EOF >EXPECTED\r
112 > > +  2009-11-18 [3/3]   Adrian Perez de Castro, Keith Packard, Carl Worth  [notmuch] Introducing myself (matching signed unread)\r
113 > > +  2009-11-18 [1/3]   Carl Worth, Israel Herraiz, Keith Packard       [notmuch] New to the list (inbox matching unread)\r
114 > > +  2009-11-18 [2/2]   Keith Packard, Carl Worth    [notmuch] [PATCH] Make notmuch-show 'X' (and 'x') commands remove inbox (and unread) tags (matching unread)\r
115 > > +  2009-11-18 [1/2]   Keith Packard, Alexander Botero-Lowry    [notmuch] [PATCH] Create a default notmuch-show-hook that highlights URLs and uses word-wrap (inbox matching unread)\r
116 > > +  2009-11-18 [1/1]   Jan Janak            [notmuch] [PATCH] notmuch new: Support for conversion of spool subdirectories into tags (matching unread)\r
117 > > +  2009-11-18 [1/1]   Stewart Smith        [notmuch] [PATCH] Fix linking with gcc to use g++ to link in C++ libs. (matching unread)\r
118 > > +  2009-11-17 [1/2]   Ingmar Vanhassel, Carl Worth  [notmuch] [PATCH] Typsos (inbox matching unread)\r
119 > > +End of search results.\r
120 > > +EOF\r
121 > > +test_expect_equal_file OUTPUT EXPECTED\r
122\r
123 > I am worried that this test would break because of changes in other\r
124 > tests.  E.g. if a new test adds a new message which matches "tag:inbox\r
125 > AND tags", this test would have to be updated.  I think we should avoid\r
126 > this.  I see the following options here:\r
127\r
128 > * Search for messages which are less likely to change, e.g. "from:carl".\r
129\r
130 > * Rework the test to avoid using any fixed expected results, e.g.:\r
131\r
132 >   - count all messages with tag:inbox\r
133\r
134 >   - remove inbox tag, add some other distinct tag for all messages with\r
135 >     tag:inbox\r
136\r
137 >   - count all messages with tag:inbox again, check that it is 0\r
138\r
139 >   - add the inbox tag back, remove the previously added tag, check the\r
140 >     message count\r
141\r
142 > I like the latter approach because it does not compare Emacs UI output\r
143 > and hence would not break when that output changes.  What do you think?\r
144\r
145 > Also, we should leave notmuch db in the same state as it was before the\r
146 > test if possible.\r
147\r
148 \r
149 Good point(s)!\r
150 \r
151 How about this:\r
152 \r
153   #+begin_src sh\r
154     test_begin_subtest "Add/remove tags to/from all matching messages."\r
155     expected=$(notmuch count from:cworth AND tag:inbox)\r
156     test "${expected}" == "0" && expected="Need more matches!" # prevent false positives\r
157     test_emacs "(notmuch-search \"from:cworth AND tag:inbox\")\r
158             (notmuch-test-wait)\r
159             (notmuch-search-operate-all \"+matching\" \"-inbox\")"\r
160     output=$(notmuch count from:cworth AND tag:matching AND NOT tag:inbox)\r
161     notmuch tag -matching +inbox -- from:cworth AND tag:matching AND NOT tag:inbox # restore db state!\r
162     test_expect_equal "$output" "$expected"\r
163   #+end_src\r
164 \r
165 \r
166 > Regards,\r
167 >   Dmitry\r
168\r
169 > [1] id:"1327901644-15799-1-git-send-email-dmitry.kurochkin@gmail.com"\r
170\r
171 > > +\r
172 > >  test_begin_subtest "Message with .. in Message-Id:"\r
173 > >  add_message [id]=123..456@example '[subject]="Message with .. in Message-Id"'\r
174 > >  test_emacs '(notmuch-search "id:\"123..456@example\"")\r
175 > > -- \r
176 > > 1.7.8.1\r
177 > > \r
178 > _______________________________________________\r
179 > notmuch mailing list\r
180 > notmuch@notmuchmail.org\r
181 > http://notmuchmail.org/mailman/listinfo/notmuch\r
182 \r
183 \r
184 Peace\r
185 \r
186 -- \r
187 Pieter\r