Re: [BUG/WIP PATCH] unit-tests: use clean test environment

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 28, 2025 at 06:15:42AM -0800, Junio C Hamano wrote:
> Patrick Steinhardt <ps@xxxxxx> writes:
> > I suspect that most environment variables shouldn't matter (for now), so
> > overall the duplication may be acceptable:
> >
> >   - We need to unset a couple of variables, but we can probably reuse
> >     logic `git rev-parse --local-env-vars`.
> >
> >   - We need to ask Git to not read the configuration, which we can do by
> >     setting a couple of envvars. This should be manageable.
> 
> "Provide a controlled environment where Git pretends this is the
> $HOME and that is the $AUTHOR_NAME and so on" is much more
> preferrable than "Tell it not to read", no?

Maybe. I guess for unit tests it's a lot less clear cut as most of the
tests won't depend on such a controlled environment. So sanitizing the
environment would be a good enough first step for me, and if we see
demand for making specific information available to lots of tests we
could still start to expose those at a later point.

Of course, if the author already wants to do both steps right now I
won't complain :)

Patrick




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux