Re: [PATCH v4 2/5] t1517: test commands that are designed to be run outside repository
- From
Patrick Steinhardt <ps@pks.im>
- Date
- May 15, 2024, 14:25 UTC
- Message-ID
- <ZkTFvVihZAY184Gm@tanuki>
- In-Reply-To
- <xmqq4jaz2may.fsf@gitster.g>
On Wed, May 15, 2024 at 07:15:49AM -0700, Junio C Hamano wrote:
Show 21 quoted lines
> Patrick Steinhardt <ps@pks.im> writes: > > > On Tue, May 14, 2024 at 08:08:19AM -0700, Junio C Hamano wrote: > >> Patrick Steinhardt <ps@pks.im> writes: > >> > >> > Is there a specific reason why this needs a whole patch suite, as > >> > opposed to adding the tests to the respective test suites of the > >> > commands? > >> > >> Yes, testing out-of-repository operations needs certain trick and > >> people forget to write such tests using the GIT_CEILING_DIRECTORIES > >> mechanism. Having one place where we have an enumeration of > >> commands that are designed to be usable outside repository is a > >> handy way to make sure that we have enough test coverage. It would > >> make it easy to control how GIT_DEFAULT_HASH environment is set > >> during these tests to have them in all one place. > > > > We already have the "nogit" command that neatly encapsulates all of this > > logic, so the trickery is contained in a single spot in practice. > > Heh, you asked for "a" specific reason, and I listed three.
Hm. I guess I got thrown off a bit as this was written in a single paragraph, so my mind didn't process it as different reasons :)
> The tests that are spread across many scripts make it harder to see if > we have enough coverage for the out-of-repository operations,
Put this way I in fact agree with you.
> and the use of "nongit" helper does not change the equation, does it?
No, it doesn't really.
Thanks!
Patrick