public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Phillip Wood <phillip.wood123@gmail•com>
To: Usman Akinyemi <usmanakinyemi202@gmail•com>, git@vger•kernel.org
Cc: gitster@pobox•com, chriscool@tuxfamily•org,
	christian.couder@gmail•com, me@ttaylorr•com, ps@pks•im
Subject: Re: [PATCH v4 1/2] t/t1517: automate `git subcmd -h` tests outside a repository
Date: Tue, 26 Aug 2025 16:57:25 +0100	[thread overview]
Message-ID: <370f11e1-b335-4111-912c-94429c5018d6@gmail.com> (raw)
In-Reply-To: <20250721115519.140361-2-usmanakinyemi202@gmail.com>

Hi Usman

On 21/07/2025 12:55, Usman Akinyemi wrote:
> 
> diff --git a/t/t1517-outside-repo.sh b/t/t1517-outside-repo.sh
> index 6824581317..9fcebb7d94 100755
> --- a/t/t1517-outside-repo.sh
> +++ b/t/t1517-outside-repo.sh
> @@ -110,8 +110,29 @@ test_expect_success LIBCURL 'remote-http outside repository' '
>   test_expect_success 'update-server-info does not crash with -h' '
>   	test_expect_code 129 git update-server-info -h >usage &&
>   	test_grep "[Uu]sage: git update-server-info " usage &&
> -	test_expect_code 129 nongit git update-server-info -h >usage &&
> -	test_grep "[Uu]sage: git update-server-info " usage
>   '
>   
> +for cmd in $(git --list-cmds=main)

This lists all the git commands in $PATH which is causing "make test" to 
fail when I run it locally as it is testing all my local "git-*" scripts 
most of which apparently fail this test. If there isn't already we 
should add a option that lists the commands only in $GIT_EXEC_PATH and 
use it here.

Also when I run the test with '-i' it does not stop at the first 
failure. I'm not sure what's causing that as I thought 
test_expect_success should exit on failure even when it is called in a loop.

Thanks

Phillip

> +do
> +	cmd=${cmd%.*} # strip .sh, .perl, etc.
> +	case "$cmd" in
> +	archimport | cvsexportcommit | cvsimport | cvsserver | daemon | \
> +	difftool--helper | filter-branch | fsck-objects | get-tar-commit-id | \
> +	http-backend | http-fetch | http-push | init-db | instaweb.sh | \
> +	merge-octopus | merge-one-file | merge-resolve | mergetool | \
> +	mktag | p4 | p4.py | pickaxe | quiltimport | remote-ftp | remote-ftps | \
> +	remote-http | remote-https | replay | request-pull | send-email | \
> +	sh-i18n--envsubst | shell | show | stage | submodule | svn | \
> +	upload-archive--writer | upload-pack | web--browse | whatchanged)
> +		expect_outcome=expect_failure ;;
> +	*)
> +		expect_outcome=expect_success ;;
> +	esac
> +	test_$expect_outcome "'git $cmd -h' outside a repository" '
> +		test_expect_code 129 nongit git $cmd -h >usage &&
> +		echo "Hello" &&
> +		test_grep "[Uu]sage: git $cmd " usage
> +	'
> +done
> +
>   test_done


  parent reply	other threads:[~2025-08-26 15:57 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-06 21:41 [PATCH v2 0/7] move builtin help test to t1517 Usman Akinyemi
2025-07-06 21:41 ` [PATCH v2 1/7] t/t1517: move checkout-index -h " Usman Akinyemi
2025-07-06 21:41 ` [PATCH v2 2/7] t/t1517: move for-each-ref " Usman Akinyemi
2025-07-06 21:41 ` [PATCH v2 3/7] t/t1517: move ls-files " Usman Akinyemi
2025-07-06 21:41 ` [PATCH v2 4/7] t/t1517: move pack-refs " Usman Akinyemi
2025-07-06 21:41 ` [PATCH v2 5/7] t/t1517: move send-pack " Usman Akinyemi
2025-07-06 21:41 ` [PATCH v2 6/7] t/t1517: move verify-commit " Usman Akinyemi
2025-07-06 21:41 ` [PATCH v2 7/7] t/t1517: move verify-tag " Usman Akinyemi
2025-07-06 21:50 ` [PATCH v2 0/7] move builtin help " Usman Akinyemi
2025-07-06 21:50   ` [PATCH v3 1/7] t/t1517: move checkout-index -h " Usman Akinyemi
2025-07-06 21:50   ` [PATCH v3 2/7] t/t1517: move for-each-ref " Usman Akinyemi
2025-07-06 21:50   ` [PATCH v3 3/7] t/t1517: move ls-files " Usman Akinyemi
2025-07-06 21:50   ` [PATCH v3 4/7] t/t1517: move pack-refs " Usman Akinyemi
2025-07-06 21:50   ` [PATCH v3 5/7] t/t1517: move send-pack " Usman Akinyemi
2025-07-06 21:50   ` [PATCH v3 6/7] t/t1517: move verify-commit " Usman Akinyemi
2025-07-07 16:12     ` Junio C Hamano
2025-07-10 22:59       ` Usman Akinyemi
2025-07-11 16:37         ` Junio C Hamano
2025-07-21 11:55           ` [PATCH v4 0/2] refactor t1517 to focus on help output outside a repository Usman Akinyemi
2025-07-21 11:55             ` [PATCH v4 1/2] t/t1517: automate `git subcmd -h` tests " Usman Akinyemi
2025-07-26 14:34               ` D. Ben Knoble
2025-07-26 21:53                 ` Usman Akinyemi
2025-07-30 21:14                   ` D. Ben Knoble
2025-07-28 15:08                 ` Junio C Hamano
2025-08-02 19:56                 ` D. Ben Knoble
2025-08-03  1:27                   ` Usman Akinyemi
2025-07-26 14:37               ` D. Ben Knoble
2025-07-26 14:52                 ` D. Ben Knoble
2025-07-26 21:51                 ` Usman Akinyemi
2025-07-30 21:15                   ` D. Ben Knoble
2025-07-28 15:09                 ` Junio C Hamano
2025-08-26 15:57               ` Phillip Wood [this message]
2025-08-28 13:47                 ` D. Ben Knoble
2025-08-29 13:05                   ` Phillip Wood
2025-08-29 13:22                     ` D. Ben Knoble
2025-08-29 16:31                     ` Junio C Hamano
2025-08-30  3:49                       ` Usman Akinyemi
2025-07-21 11:55             ` [PATCH v4 2/2] t5200: move `update-server-info -h` test from t1517 Usman Akinyemi
2025-07-26 16:02               ` D. Ben Knoble
2025-08-03  2:07             ` [PATCH V5 0/3] refactor t1517 to focus on help output outside a repository Usman Akinyemi
2025-08-03  2:07               ` [PATCH V5 1/3] t/t1517: automate `git subcmd -h` tests " Usman Akinyemi
2025-08-03 14:52                 ` D. Ben Knoble
2025-08-03 17:39                   ` Junio C Hamano
2025-08-06  7:20                     ` Usman Akinyemi
2025-08-03  2:07               ` [PATCH V5 2/3] t5200: move `update-server-info -h` test from t1517 Usman Akinyemi
2025-08-03  2:07               ` [PATCH V5 3/3] t5304: move `prune " Usman Akinyemi
2025-08-08  1:06               ` [PATCH v6 0/3] refactor t1517 to focus on help output outside a repository Usman Akinyemi
2025-08-08  1:06                 ` [PATCH v6 1/3] t/t1517: automate `git subcmd -h` tests " Usman Akinyemi
2025-08-08  1:06                 ` [PATCH v6 2/3] t5200: move `update-server-info -h` test from t1517 Usman Akinyemi
2025-08-08  1:06                 ` [PATCH v6 3/3] t5304: move `prune " Usman Akinyemi
2025-08-08 14:53                 ` [PATCH v6 0/3] refactor t1517 to focus on help output outside a repository Junio C Hamano
2025-08-09 14:46                   ` D. Ben Knoble
2025-07-06 21:50   ` [PATCH v3 7/7] t/t1517: move verify-tag -h test to t1517 Usman Akinyemi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=370f11e1-b335-4111-912c-94429c5018d6@gmail.com \
    --to=phillip.wood123@gmail$(echo .)com \
    --cc=chriscool@tuxfamily$(echo .)org \
    --cc=christian.couder@gmail$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=gitster@pobox$(echo .)com \
    --cc=me@ttaylorr$(echo .)com \
    --cc=phillip.wood@dunelm$(echo .)org.uk \
    --cc=ps@pks$(echo .)im \
    --cc=usmanakinyemi202@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox