1 Return-Path: <jani@nikula.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 CCD1F431FB6
\r
6 for <notmuch@notmuchmail.org>; Tue, 28 Oct 2014 10:29:44 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\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 gPp1BXbXPFtV for <notmuch@notmuchmail.org>;
\r
16 Tue, 28 Oct 2014 10:29:36 -0700 (PDT)
\r
17 Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com
\r
18 [209.85.212.174]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
19 (No client certificate requested)
\r
20 by olra.theworths.org (Postfix) with ESMTPS id B3B73431FAE
\r
21 for <notmuch@notmuchmail.org>; Tue, 28 Oct 2014 10:29:36 -0700 (PDT)
\r
22 Received: by mail-wi0-f174.google.com with SMTP id q5so10054073wiv.7
\r
23 for <notmuch@notmuchmail.org>; Tue, 28 Oct 2014 10:29:35 -0700 (PDT)
\r
24 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
\r
25 d=1e100.net; s=20130820;
\r
26 h=x-gm-message-state:from:to:subject:in-reply-to:references
\r
27 :user-agent:date:message-id:mime-version:content-type;
\r
28 bh=UGlu9o3WzLVa5twtdn1W0xdcNxMaLM2pnwBmcg/mAh0=;
\r
29 b=U+HZtQ/+n8QlxnS8DIrvD3yXDSk3am2kqBiFCmMUy+f4LqX0DF4lBa77MbTGNE5DX7
\r
30 ThNxmp+aqEa4jFWtcbE9cYWH8+jSejOCmET/JJlwUdB6erPvPimDviMv+COmQ5c+D4jA
\r
31 AcmxYIcsvbnjCSROwiOIIWsyEeskDzb0M2BIawDGqrJUtSHUqATgOjhy66gUFAhuvcxr
\r
32 zu9+f85xAG6y8OhHwszLMt7EPML0gXshDuX4a6Wn33PXUL048Wog8Bh6MH8XThGDAC5k
\r
33 xGllhiC5TsHXucHwdcCypQAbijvh7x1GX/rkg2tuRaqiAMXjpUgbnfX2pLTENc5JuH/A
\r
36 ALoCoQnaGGhTUvMZLrbNRBuBAnbgkrpANiW+7JJ3SFLKg5MQXLr4Iur+fEd+a84edrmZzP6nTrl5
\r
37 X-Received: by 10.194.143.7 with SMTP id sa7mr6176524wjb.110.1414517375318;
\r
38 Tue, 28 Oct 2014 10:29:35 -0700 (PDT)
\r
39 Received: from localhost (dsl-hkibrasgw2-58c36d-48.dhcp.inet.fi.
\r
41 by mx.google.com with ESMTPSA id vm6sm2544860wjc.16.2014.10.28.10.29.33
\r
42 for <multiple recipients>
\r
43 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
\r
44 Tue, 28 Oct 2014 10:29:34 -0700 (PDT)
\r
45 From: Jani Nikula <jani@nikula.org>
\r
46 To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org
\r
47 Subject: Re: [PATCH] test: add simple tests for post-insert hook
\r
48 In-Reply-To: <1413616955-27612-1-git-send-email-david@tethera.net>
\r
50 <27c7ada91f96deda6e51732e0397bffd2ef2ab42.1411914914.git.jani@nikula.org>
\r
51 <1413616955-27612-1-git-send-email-david@tethera.net>
\r
52 User-Agent: Notmuch/0.18.2+148~g0318cd3 (http://notmuchmail.org) Emacs/24.3.1
\r
53 (x86_64-pc-linux-gnu)
\r
54 Date: Tue, 28 Oct 2014 19:29:32 +0200
\r
55 Message-ID: <87ppdcnlvn.fsf@nikula.org>
\r
57 Content-Type: text/plain
\r
58 X-BeenThere: notmuch@notmuchmail.org
\r
59 X-Mailman-Version: 2.1.13
\r
61 List-Id: "Use and development of the notmuch mail system."
\r
62 <notmuch.notmuchmail.org>
\r
63 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
64 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
65 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
66 List-Post: <mailto:notmuch@notmuchmail.org>
\r
67 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
68 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
69 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
70 X-List-Received-Date: Tue, 28 Oct 2014 17:29:45 -0000
\r
72 On Sat, 18 Oct 2014, David Bremner <david@tethera.net> wrote:
\r
73 > Most of the existing tests for pre/post-new hook don't seem to apply.
\r
75 > test/T400-hooks.sh | 18 ++++++++++++++++++
\r
76 > 1 file changed, 18 insertions(+)
\r
78 > diff --git a/test/T400-hooks.sh b/test/T400-hooks.sh
\r
79 > index 77e8569..e741211 100755
\r
80 > --- a/test/T400-hooks.sh
\r
81 > +++ b/test/T400-hooks.sh
\r
82 > @@ -30,6 +30,8 @@ rm_hooks () {
\r
84 > # add a message to generate mail dir and database
\r
86 > +# create maildir structure for notmuch-insert
\r
87 > +mkdir -p "$MAIL_DIR"/{cur,new,tmp}
\r
89 > test_begin_subtest "pre-new is run"
\r
91 > @@ -45,6 +47,16 @@ create_echo_hook "post-new" expected output
\r
92 > notmuch new > /dev/null
\r
93 > test_expect_equal_file expected output
\r
95 > +test_begin_subtest "post-insert hook is run"
\r
98 > +create_echo_hook "post-insert" expected output
\r
99 > +echo $gen_msg_filename
\r
102 I presume the two lines above...
\r
104 > +notmuch insert < "$gen_msg_filename"
\r
107 ...and this line are leftover debug messages?
\r
109 Otherwise LGTM. I guess this could be expanded with a subtest checking
\r
110 that the hook does not get run on errors, and does get run with some
\r
111 errors that are ignored with --keep.
\r
116 > +test_expect_equal_file expected output
\r
118 > test_begin_subtest "pre-new is run before post-new"
\r
121 > @@ -82,6 +94,12 @@ test_expect_equal_file expected output
\r
122 > # depends on the previous subtest leaving broken hook behind
\r
123 > test_expect_code 1 "post-new non-zero exit status (notmuch status)" "notmuch new"
\r
126 > +generate_message
\r
127 > +create_failing_hook "post-insert"
\r
128 > +test_expect_success "post-insert hook does not affect insert status" \
\r
129 > + "notmuch insert < \"$gen_msg_filename\" > /dev/null"
\r
131 > # test_begin_subtest "hook without executable permissions"
\r
133 > mkdir -p ${HOOK_DIR}
\r
137 > _______________________________________________
\r
138 > notmuch mailing list
\r
139 > notmuch@notmuchmail.org
\r
140 > http://notmuchmail.org/mailman/listinfo/notmuch
\r