Re: [PATCH 2/2] tests(gpg): increase verbosity to allow debugging
- From
Jeff King <peff@peff.net>
- Date
- Mar 23, 2020, 21:31 UTC
- Message-ID
- <20200323213109.GA44297@coredump.intra.peff.net>
- In-Reply-To
- <xmqqzhc63gmd.fsf@gitster.c.googlers.com>
On Mon, Mar 23, 2020 at 02:28:58PM -0700, Junio C Hamano wrote:
Show 12 quoted lines
> Jeff King <peff@peff.net> writes: > > > Here's what I came up with that I think is suitable for applying (though > > if you find the GNUPGHOME thing below too gross, I can rework it as > > indicated): > > I actually think it is perfectly fine to mkdir and set the > environment even outside test_expect_success; that way, even > GIT_SKIP_TESTS cannot omit the necessary initialization. And as you > said, leaving the environment pointing into the trash repository's > working tree should be fine when we fail the GPG prereq. We > shouldn't be running GPG at all in such a case.
I have a slight preference to do it in an expect_success block, because then we'd notice the error more readily (and it gets the benefit verbosity and tracing, too!).
The thing I was more worried about is that it's technically a behavior change to set up GNUPGHOME when we're not going to use it (as well as create the directory). But I find it hard to imagine a test that would be affected where my suggested solution wouldn't be "fix the test".
-Peff