Re: [PATCH 3/3] t1509: facilitate repeated script invocations

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

 



Hi,

On Mon, 5 Dec 2022, Eric Sunshine wrote:

> On Mon, Dec 5, 2022 at 9:48 PM Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx> wrote:
> > On Mon, Nov 21 2022, Eric Sunshine via GitGitGadget wrote:
> > > t1509-root-work-tree.sh, which tests behavior of a Git repository
> > > located at the root `/` directory, refuses to run if it detects the
> > > presence of an existing repository at `/`. This safeguard ensures that
> > > it won't clobber a legitimate repository at that location. However,
> > > because t1509 does a poor job of cleaning up after itself, it runs afoul
> > > of its own safety check on subsequent runs, which makes it painful to
> > > run the script repeatedly since each run requires manual cleanup of
> > > detritus from the previous run.
> > >
> > > Address this shortcoming by making t1509 clean up after itself as its
> > > last action. This is safe since the script can only make it to this
> > > cleanup action if it did not find a legitimate repository at `/` in the
> > > first place, so the resources cleaned up here can only have been created
> > > by the script itself.

Makes sense.

> > This is an existing wart, but I also wondered why the "expected",
> > "result" etc. was needed. Either we could make the tests creating those
> > do a "test_when_finished" removal of it, or better yet just create those
> > in the trash directory.

An even better suggestion would be to use `test_atexit`, of course.

Ciao,
Johannes

[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