Re: [PATCH 1/2] Ensure that "notmuch reply" succeeds during testing.

Subject: Re: [PATCH 1/2] Ensure that "notmuch reply" succeeds during testing.

Date: Fri, 14 Jul 2017 15:04:30 -0300

To: Daniel Kahn Gillmor, Notmuch Mail

Cc:

From: David Bremner


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

> On Fri 2017-07-14 11:42:43 -0300, David Bremner wrote:
>> Daniel Kahn Gillmor <dkg@fifthhorseman.net> writes:
>>> -output=$(notmuch reply id:${gen_msg_id})
>>> +output=$(notmuch reply id:${gen_msg_id} || echo failed)
>>
>> I wonder if we're going to touch this code if we should DTRT™ and switch
>> to redirecting stdin and stderr to a file. Then when we have failures we
>> will at least have a little bit more information, especially in user bug
>> reports.
>
> redirecting stdin as well?  i'm not sure what you'd do with stdin.
> makes sense for for stderr, though i don't know the test suite well
> enough to instrument it The Right Way™.  I'm happy to be pointed to an
> example, though.

err. stdout.

I guess I was thinking something like the test "List all items" in
T030-config.sh.

Alternatively, it's simpler to add 2>&1 (see e.g. T050-new.sh) inside
the $().

Maybe something like (untested)

output=$(notmuch reply  id:${gen_msg_id} 2>&1 && echo OK)

to have postive confirmation of the exit value, as well as any stderr
output.

d

Thread: