Git development
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Felipe Contreras <felipe.contreras@gmail.com>
Cc: git@vger.kernel.org, Fabian Stelzer <fs@gigacodes.de>,
	Brandon Casey <drafnel@gmail.com>
Subject: Re: [PATCH] test: simplify counts aggregation
Date: Wed, 08 Mar 2023 10:12:43 +0100	[thread overview]
Message-ID: <230308.86bkl3zjp3.gmgdl@evledraar.gmail.com> (raw)
In-Reply-To: <20230308090536.2562917-1-felipe.contreras@gmail.com>


On Wed, Mar 08 2023, Felipe Contreras wrote:

> When the list of files as input was implemented in 6508eedf67
> (t/aggregate-results: accomodate systems with small max argument list
> length, 2010-06-01), a much simpler solution wasn't considered.
>
> Let's just pass the pattern as an argument.
>
> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
> ---
>  t/Makefile             | 4 +---
>  t/aggregate-results.sh | 2 +-
>  2 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/t/Makefile b/t/Makefile
> index 2c2b252240..6bc878558f 100644
> --- a/t/Makefile
> +++ b/t/Makefile
> @@ -140,9 +140,7 @@ aggregate-results-and-cleanup: $(T)
>  	$(MAKE) clean
>  
>  aggregate-results:
> -	for f in '$(TEST_RESULTS_DIRECTORY_SQ)'/t*-*.counts; do \
> -		echo "$$f"; \
> -	done | '$(SHELL_PATH_SQ)' ./aggregate-results.sh
> +	'$(SHELL_PATH_SQ)' ./aggregate-results.sh '$(TEST_RESULTS_DIRECTORY_SQ)/t*-*.counts'
>  
>  valgrind:
>  	$(MAKE) GIT_TEST_OPTS="$(GIT_TEST_OPTS) --valgrind"
> diff --git a/t/aggregate-results.sh b/t/aggregate-results.sh
> index 7f2b83bdc8..2efc2c37cd 100755
> --- a/t/aggregate-results.sh
> +++ b/t/aggregate-results.sh
> @@ -8,7 +8,7 @@ broken=0
>  total=0
>  missing_prereq=
>  
> -while read file
> +for file in $1
>  do
>  	while read type value
>  	do

This leaves this code in contrib presumably broken:
	
	contrib/subtree/t/Makefile-aggregate-results:
	contrib/subtree/t/Makefile-     for f in '$(TEST_RESULTS_DIRECTORY_SQ)'/t*-*.counts; do \
	contrib/subtree/t/Makefile-             echo "$$f"; \
	contrib/subtree/t/Makefile:     done | '$(SHELL_PATH_SQ)' ../../../t/aggregate-results.sh

But overall I like this direction, if we can just change that contrib
Makefile as well to use the new mode the script excepts.

I think we can go even further here, and just pass the
$(TEST_RESULTS_DIRECTORY_SQ) as an argument to the script, then have it
do something like (untested):

	results_dir=$1
	for file in "$results_dir"/t*-*.counts

Which I think is a bit more obvious, and since the only task of the
script is to do exactly this, there's no reason not to have it do that
search by itself.


  reply	other threads:[~2023-03-08  9:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-08  9:05 [PATCH] test: simplify counts aggregation Felipe Contreras
2023-03-08  9:12 ` Ævar Arnfjörð Bjarmason [this message]
2023-03-08  9:26   ` Eric Wong
2023-03-08 10:04     ` Felipe Contreras
2023-03-08  9:56   ` Felipe Contreras
2023-03-08 11:15     ` Ævar Arnfjörð Bjarmason
2023-03-08 12:07       ` Felipe Contreras

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=230308.86bkl3zjp3.gmgdl@evledraar.gmail.com \
    --to=avarab@gmail.com \
    --cc=drafnel@gmail.com \
    --cc=felipe.contreras@gmail.com \
    --cc=fs@gigacodes.de \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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