Re: [PATCH v4 6/8] test-http-server: pass Git requests to http-backend
- From
Victoria Dye <vdye@github.com>
- Date
- Jan 12, 2023, 20:54 UTC
- Message-ID
- <3858d972-6659-76c5-8d13-b9c803bc32c8@github.com>
- In-Reply-To
- <AS2PR03MB9815D6B888AD0E0E12C1C679C0FC9@AS2PR03MB9815.eurprd03.prod.outlook.com>
Matthew John Cheetham wrote:
Show 6 quoted lines
> > On 2022-12-14 15:20, Victoria Dye wrote: >> nit: '$TEST_OUTPUT_DIRECTORY' instead of '$(pwd)' is more consistent with >> what I see in other tests. > > I don't see this? In fact I see more usages of `$(pwd)` than your suggestion.
To be honest, I'm not sure how I missed this. '$(pwd)' *is* quite common in the tests, although it does seem to be used mostly in individual tests rather than file-level variables (although that's not universally true, e.g. using it to set 'CURR_DIR' in 't9400-diff-highlight.sh').
So, contrary to my earlier comment, this seems best left up to (your) personal preference than any concrete rule.
Show 10 quoted lines
>
>> Also, if you're creating a repo in its own subdirectory ('repo'), you can
>> set 'TEST_NO_CREATE_REPO=1' before importing './test-lib' to avoid creating
>> a repo at the root level of the test output dir - it can help avoid
>> potential weird/unexpected behavior as a result of being in a repo inside of
>> another repo.
>
> However.. after setting `TEST_NO_CREATE_REPO=1` I was getting CI failures
> around a missing PWD, so my next iteration uses the `$TRASH_DIRECTORY` variable
> explicitly in paths instead :-)You're right, I was completely misreading the purpose of 'TEST_OUTPUT_DIRECTORY' in 'test-lib.sh':
Show 6 quoted lines
> if test -z "$TEST_OUTPUT_DIRECTORY" > then > # Similarly, override this to store the test-results subdir > # elsewhere > TEST_OUTPUT_DIRECTORY=$TEST_DIRECTORY > fi
"the test-results subdir" != "the test working directory". As you pointed out, '$TRASH_DIRECTORY' would be the variable to use here.