Subject: Re: [PATCH v2 2/5] lib-gpg: allow tests with GPGSM or GPGSSH prereq first

From: Todd Zullinger <[email-masked]>
Date: Fri, 10 Oct 2025 10:09:55 -0400

Patrick Steinhardt wrote:
> On Thu, Oct 09, 2025 at 02:24:54PM +0200, Christian Couder wrote:
>> diff --git a/t/lib-gpg.sh b/t/lib-gpg.sh
>> index 937b876bd0..b99ae39a06 100644
>> --- a/t/lib-gpg.sh
>> +++ b/t/lib-gpg.sh
>> @@ -9,6 +9,16 @@
>> @@ -63,6 +72,14 @@ test_lazy_prereq GPG2 '
>>  		;;
>>  	*)
>>  		(gpgconf --kill all || : ) &&
>> +
>> +		# NEEDSWORK: prepare_gnupghome() should definitely be
>> +		# called here, but it looks like it exposes a
>> +		# pre-existing, hidden bug by allowing some tests in
>> +		# t1016-compatObjectFormat.sh to run instead of being
>> +		# skipped. See:
>> +		# https://lore.kernel.org/git/[email-masked]/
>> +
>>  		gpg --homedir "${GNUPGHOME}" --import \
>>  			"$TEST_DIRECTORY"/lib-gpg/keyring.gpg &&
>>  		gpg --homedir "${GNUPGHOME}" --import-ownertrust \
> 
> Interesting. So I assume that these gpg commands here fail because the
> GPG home doesn't exist, and thus we disable the prereq? Too bad, but I
> agree that this doesn't necessarily have to be fixed by this patch
> series.

I agree.  But it is ugly that any tests we have which rely
on the GPG2 prereq simply never run.  That should be fixed
and, if it were me, I'd do so by dropping the flaky tests in
t1016 initially.  Someone who cares about those tests
running could debug it more and hopefully fix the problem.

As it stands, this breakage blocks tests in t1461-refs-list,
t6300-for-each-ref, and t7510-signed-commit.  Anyone adding
a test with a GPG2 prereq should be aware that thoses tests
just won't be run.

The t1016-compatObjectFormat tests have been flaky since
they were added and no one really noticed.  That's at least
partly a failure of our CI output, which hides these sort of
skipped tests that we just presume are running.  I don't
have any good suggestions for fixing that, unfortunately.

-- 
Todd