Re: [PATCH v3 1/3] t: document regression git safe.directory when using sudo
From: Phillip Wood <hidden>
Date: 2022-05-05 14:34:47
Hi Dscho On 05/05/2022 14:44, Johannes Schindelin wrote:
quoted
A new SUDO prerequisite is provided that does some sanity checking to make sure the sudo command that will be used allows for passwordless execution as root and doesn't mess with git execution paths, but otherwise additional work will be required to ensure additional commands behave as expected and that will be addressed in a later patch. Most of those characteristics make this test mostly suitable only for CI, but it could be executed locally if special care is taken to provide for some of them in the local configuration and maybe making use of the sudo credential cache by first invoking sudo, entering your password if needed, and then invoking the test by doing: $ IKNOWWHATIAMDOING=YES ./t0034-root-safe-directory.shHmm. I would like to suggest that we can side-step all of these issues (and the ones I outline below) by considering a similar approach to the one Stolee took in t0033: use one or more `GIT_TEST_*` environment variables to pretend the exact scenario we want to test for.
That's an excellent suggestion. Trying to use sudo in the tests leads to all sorts of issues, if we can use a GIT_TEST_* approach instead that would be much better. Best Wishes Phillip