Re: [PATCH v2 3/6] t1302: make tests more robust with new extensions
- From
Toon Claes <toon@iotcl.com>
- Date
- Jan 23, 2024, 14:08 UTC
- Message-ID
- <87a5owqgzi.fsf@iotcl.com>
- In-Reply-To
- <1284b70fab6dd85114cb24fc5c7b6c49e35eb135.1704877233.git.ps@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 39 quoted lines
> [[PGP Signed Part:Undecided]]
> [1. text/plain]
> In t1302 we exercise logic around "core.repositoryFormatVersion" and
> extensions. These tests are not particularly robust against extensions
> like the newly introduced "refStorage" extension.
>
> Refactor the tests to be more robust:
>
> - Check the DEFAULT_REPO_FORMAT prereq to determine the expected
> repository format version. This helps to ensure that we only need to
> update the prereq in a central place when new extensions are added.
>
> - Use a separate repository to rewrite ".git/config" to test
> combinations of the repository format version and extensions. This
> ensures that we don't break the main test repository.
>
> - Do not rewrite ".git/config" when exercising the "preciousObjects"
> extension.
>
> Signed-off-by: Patrick Steinhardt <ps@pks.im>
> ---
> t/t1302-repo-version.sh | 19 +++++++++++++++----
> 1 file changed, 15 insertions(+), 4 deletions(-)
>
> diff --git a/t/t1302-repo-version.sh b/t/t1302-repo-version.sh
> index 179474fa65..7c680c91c4 100755
> --- a/t/t1302-repo-version.sh
> +++ b/t/t1302-repo-version.sh
> @@ -79,8 +84,13 @@ mkconfig () {
>
> while read outcome version extensions; do
> test_expect_success "$outcome version=$version $extensions" "
> - mkconfig $version $extensions >.git/config &&
> - check_${outcome}
> + test_when_finished 'rm -rf extensions' &&
> + git init extensions &&
> + (
> + cd extensions &&
> + mkconfig $version $extensions >.git/config &&Why did you not remove the use of `mkconfig` here?
-- Toon