From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: "SZEDER Gábor" <szeder.dev@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>, Jeff King <peff@peff.net>,
git@vger.kernel.org
Subject: Re: [PATCH] test-lib: don't check prereqs of test cases that won't be run anyway
Date: Tue, 12 Nov 2019 20:28:56 +0100 (CET) [thread overview]
Message-ID: <nycvar.QRO.7.76.6.1911122028270.46@tvgsbejvaqbjf.bet> (raw)
In-Reply-To: <20191112122438.17057-1-szeder.dev@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2082 bytes --]
Hi Gábor,
On Tue, 12 Nov 2019, SZEDER Gábor wrote:
> With './t1234-foo.sh -r 5,6' we can run only specific test cases in a
> test script, but our test framwork still evaluates all lazy prereqs
> that the excluded test cases might depend on. This is unnecessary and
> produces verbose and trace output that can be distracting. This has
> been an issue ever since the '-r|--run=' options were introduced in
> 0445e6f0a1 (test-lib: '--run' to run only specific tests, 2014-04-30),
> because that commit added the check of the list of test cases
> specified with '-r' after evaluating the prereqs.
>
> Avoid this unnecessary prereq evaluation by checking the list of test
> cases specified with '-r' before looking at the prereqs.
>
> Note that GIT_SKIP_TESTS has always been checked before the prereqs,
> so prereqs necessary for tests skipped that way were not evaluated.
>
> Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
> ---
Thank you for this patch!
Dscho
>
> Following up on:
>
> https://public-inbox.org/git/20190923165828.GA27068@szeder.dev/
>
> t/test-lib.sh | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/t/test-lib.sh b/t/test-lib.sh
> index e06fa02a0e..24b541f494 100644
> --- a/t/test-lib.sh
> +++ b/t/test-lib.sh
> @@ -1000,6 +1000,12 @@ test_skip () {
> to_skip=t
> skipped_reason="GIT_SKIP_TESTS"
> fi
> + if test -z "$to_skip" && test -n "$run_list" &&
> + ! match_test_selector_list '--run' $test_count "$run_list"
> + then
> + to_skip=t
> + skipped_reason="--run"
> + fi
> if test -z "$to_skip" && test -n "$test_prereq" &&
> ! test_have_prereq "$test_prereq"
> then
> @@ -1012,12 +1018,6 @@ test_skip () {
> fi
> skipped_reason="missing $missing_prereq${of_prereq}"
> fi
> - if test -z "$to_skip" && test -n "$run_list" &&
> - ! match_test_selector_list '--run' $test_count "$run_list"
> - then
> - to_skip=t
> - skipped_reason="--run"
> - fi
>
> case "$to_skip" in
> t)
> --
> 2.24.0.388.gde53c094ea
>
>
prev parent reply other threads:[~2019-11-12 19:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-12 12:24 [PATCH] test-lib: don't check prereqs of test cases that won't be run anyway SZEDER Gábor
2019-11-12 14:05 ` Jeff King
2019-11-12 19:28 ` Johannes Schindelin [this message]
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=nycvar.QRO.7.76.6.1911122028270.46@tvgsbejvaqbjf.bet \
--to=johannes.schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
--cc=szeder.dev@gmail.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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).