All of lore.kernel.org
 help / color / mirror / Atom feed
From: "René Scharfe" <rene.scharfe@lsrfire.ath.cx>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: git@vger.kernel.org, gitster@pobox.com
Subject: Re: [PATCH 3/3] Enable parallel tests
Date: Fri, 08 Aug 2008 09:44:31 +0200	[thread overview]
Message-ID: <489BF95F.1070000@lsrfire.ath.cx> (raw)
In-Reply-To: <alpine.DEB.1.00.0808080754230.9611@pacific.mpi-cbg.de.mpi-cbg.de>

Johannes Schindelin schrieb:
> On multiprocessor machines, or with I/O heavy tests (that leave the
> CPU waiting a lot), it makes sense to parallelize the tests.
> 
> However, care has to be taken that the different jobs use different
> trash directories.

Good idea!

> This commit does so, by inspecting the MAKEFLAGS variable to detect
> if the option "-j" or "--jobs" was passed to make.  In that case, the
> test is run with the new "--parallel" option.

How about making the test harness be able to run multiple tests in
parallel by default, i.e. always use a different trash directory name
for each test, without adding the new option?  The implementation would
be a bit simpler (no -j detection needed) and the documentation would be
simpler, too.  We could say "look in 'trash directory/tNNNN'" instead of
"look in this place unless you used -j".

> diff --git a/t/test-lib.sh b/t/test-lib.sh
> index 11c0275..c5868c4 100644
> --- a/t/test-lib.sh
> +++ b/t/test-lib.sh
> @@ -74,6 +74,7 @@ esac
>  	) &&
>  	color=t
>  
> +test="trash directory"
>  while test "$#" -ne 0
>  do
>  	case "$1" in
> @@ -94,6 +95,10 @@ do
>  	--no-python)
>  		# noop now...
>  		shift ;;
> +	--parallel)
> +		test="$test.$(basename "$0" .sh)"
> +		remove_trash="$(pwd)/$test"
> +		shift ;;

test="trash directory/$this_test"?

The advantage would be that all trash was still inside "trash
directory".  Not sure if the extra directory level would break
something.  (Note: $this_test is defined a bit later in the script.)

test="trash for $this_test"?

This one still has a space in it..

>  	*)
>  		break ;;
>  	esac
> @@ -449,6 +454,11 @@ test_done () {
>  		# we will leave things as they are.
>  
>  		say_color pass "passed all $msg"
> +
> +		test ! -z = "$remove_trash" &&

This test succeeds always, because = is not an empty string.

René

  parent reply	other threads:[~2008-08-08  7:45 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-08  5:59 [PATCH 0/3] Enable parallelized tests Johannes Schindelin
2008-08-08  5:59 ` [PATCH 1/3] t9700: remove useless check Johannes Schindelin
2008-08-08  5:59 ` [PATCH 2/3] tests: Clarify dependencies between tests, 'aggregate-results' and 'clean' Johannes Schindelin
2008-08-08  5:59 ` [PATCH 3/3] Enable parallel tests Johannes Schindelin
2008-08-08  6:52   ` Junio C Hamano
2008-08-08 10:26     ` Johannes Schindelin
2008-08-08 10:33       ` Junio C Hamano
2008-08-08  7:44   ` René Scharfe [this message]
2008-08-08  8:28     ` Junio C Hamano
2008-08-08  9:31       ` [PATCH] tests: use $TEST_DIRECTORY to refer to the t/ directory Junio C Hamano
2008-08-08 10:35         ` Johannes Schindelin
2008-08-08 10:40           ` Junio C Hamano
2008-08-08 14:40             ` Stephan Beyer
2008-08-09 22:53         ` Olivier Marin
2008-08-09 23:20           ` Junio C Hamano
2008-08-10  7:33           ` Junio C Hamano
2008-08-08 10:37     ` [PATCH 3/3] Enable parallel tests Johannes Schindelin
2008-08-08 11:08       ` [PATCH 3/3 v2] " Johannes Schindelin
2008-08-08 15:03         ` Stephan Beyer
2008-08-08 15:27           ` Johannes Schindelin
2008-08-08 15:36 ` [PATCH 0/3] Enable parallelized tests SZEDER Gábor
2008-08-08 16:02   ` Stephan Beyer
2008-08-08 16:30     ` Johannes Schindelin
2008-08-08 16:33       ` Stephan Beyer
2008-08-08 16:51         ` Johannes Schindelin
2008-08-08 16:56           ` Stephan Beyer

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=489BF95F.1070000@lsrfire.ath.cx \
    --to=rene.scharfe@lsrfire.ath.cx \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.