"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: make regress failing test with GOT_TEST_PACK=1
To:
Yang Zhong <yzhong@freebsdfoundation.org>
Cc:
gameoftrees@openbsd.org
Date:
Tue, 8 Dec 2020 21:10:43 +0100

Download raw body.

Thread
On Tue, Dec 08, 2020 at 10:10:59AM -0800, Yang Zhong wrote:
> On main, if I run
> $ make regress GOT_TEST_PACK=1
> I get:
> 
> ===> regress
> ===> regress/cmdline
> ./checkout.sh -q -r "/tmp"
> ./update.sh -q -r "/tmp"
>    .
>    .
>    .
> ./fetch.sh -q -r "/tmp"
> ./tree.sh -q -r "/tmp"
> --- /tmp/got-test-tree_submodule_of_same_repo-eGrVPmMM/stderr.expected
>    Tue Dec  8 09:59:48 2020
> +++ /tmp/got-test-tree_submodule_of_same_repo-eGrVPmMM/stderr    Tue
> Dec  8 09:59:48 2020
> @@ -1,2 +1,2 @@
> -got-read-tree: bad object data
> +got-read-pack: bad object data
>  got: bad object data
> FAILED
>    .
>    .
>    .

Thanks for spotting this! The test expects the wrong output
in case the repository is packed. This fixes it for me:

diff 9cd7cbd12706001e5786d399b4421e5150c82be1 /home/stsp/src/got
blob - 68b58e3ee50007e8b30b983b92b7e2536cb39a20
file + regress/cmdline/tree.sh
--- regress/cmdline/tree.sh
+++ regress/cmdline/tree.sh
@@ -123,7 +123,13 @@ test_tree_submodule_of_same_repo() {
 		test_done "$testroot" "1"
 		return 1
 	fi
-	echo "got-read-tree: bad object data" > $testroot/stderr.expected
+	if [ -n "$GOT_TEST_PACK" ]; then
+		echo "got-read-pack: bad object data" \
+			> $testroot/stderr.expected
+	else
+		echo "got-read-tree: bad object data" \
+			> $testroot/stderr.expected
+	fi
 	echo "got: bad object data" >> $testroot/stderr.expected
 
 	cmp -s $testroot/stderr.expected $testroot/stderr