threads / patch / 65215

patcht9200: handle missing CVS with skip_all

Subject: [GSoC PATCH] t9200: handle missing CVS with skip_all

## tl;dr

2 messages between Mar 11, 2026 and Mar 11, 2026. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Pablo Sabater· Mar 11, 2026, 19:40 UTC · lore

CVS initialization runs outside a test_expect_success and when it fails, the error report isn't good.

Wrap CVS initialization in a skip_all check so when CVS initialization fails, the error report becomes clearer.

Move the Git repo initialization into its own test_expect_success instead of being in the same CVS check.

Signed-off-by: Pablo Sabater <pabloosabaterr@gmail.com>
---
 t/t9200-git-cvsexportcommit.sh | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)
Show changes to t/t9200-git-cvsexportcommit.sh +11 −7
diff --git a/t/t9200-git-cvsexportcommit.sh b/t/t9200-git-cvsexportcommit.sh
index a44eabf0d8..cba3b1a28a 100755
--- a/t/t9200-git-cvsexportcommit.sh
+++ b/t/t9200-git-cvsexportcommit.sh
@@ -30,13 +30,17 @@ export CVSROOT CVSWORK GIT_DIR
 
 rm -rf "$CVSROOT" "$CVSWORK"
 
-cvs init &&
-test -d "$CVSROOT" &&
-cvs -Q co -d "$CVSWORK" . &&
-echo >empty &&
-git add empty &&
-git commit -q -a -m "Initial" 2>/dev/null ||
-exit 1
+if ! cvs init || ! test -d "$CVSROOT" || ! cvs -Q co -d "$CVSWORK" .
+then
+	skip_all="cvs repository set-up fails"
+	test_done
+fi
+
+test_expect_success 'git setup' '
+	echo >empty &&
+	git add empty &&
+	git commit -q -a -m Initial
+'
 
 check_entries () {
 	# $1 == directory, $2 == expected
-- 
2.43.0
Junio C Hamano· Mar 11, 2026, 19:49 UTC · re: Pablo Sabater · lore

Re: [GSoC PATCH] t9200: handle missing CVS with skip_all

Pablo Sabater <pabloosabaterr@gmail.com> writes:
Show 13 quoted lines
> CVS initialization runs outside a test_expect_success and when it
> fails, the error report isn't good.
>
> Wrap CVS initialization in a skip_all check so when CVS initialization
> fails, the error report becomes clearer.
>
> Move the Git repo initialization into its own test_expect_success instead
> of being in the same CVS check.
>
> Signed-off-by: Pablo Sabater <pabloosabaterr@gmail.com>
> ---
>  t/t9200-git-cvsexportcommit.sh | 18 +++++++++++-------
>  1 file changed, 11 insertions(+), 7 deletions(-)
Makes sense.  Will queue.  Thanks.
Show 29 quoted lines
> diff --git a/t/t9200-git-cvsexportcommit.sh b/t/t9200-git-cvsexportcommit.sh
> index a44eabf0d8..cba3b1a28a 100755
> --- a/t/t9200-git-cvsexportcommit.sh
> +++ b/t/t9200-git-cvsexportcommit.sh
> @@ -30,13 +30,17 @@ export CVSROOT CVSWORK GIT_DIR
>  
>  rm -rf "$CVSROOT" "$CVSWORK"
>  
> -cvs init &&
> -test -d "$CVSROOT" &&
> -cvs -Q co -d "$CVSWORK" . &&
> -echo >empty &&
> -git add empty &&
> -git commit -q -a -m "Initial" 2>/dev/null ||
> -exit 1
> +if ! cvs init || ! test -d "$CVSROOT" || ! cvs -Q co -d "$CVSWORK" .
> +then
> +	skip_all="cvs repository set-up fails"
> +	test_done
> +fi
> +
> +test_expect_success 'git setup' '
> +	echo >empty &&
> +	git add empty &&
> +	git commit -q -a -m Initial
> +'
>  
>  check_entries () {
>  	# $1 == directory, $2 == expected

← back to recent threads