git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Jakub Narebski <jnareb@gmail.com>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH 1/6] Make test-lib.sh emit valid TAP format
Date: Fri, 7 May 2010 20:49:08 +0000	[thread overview]
Message-ID: <AANLkTimvWnaoZs7k-fxCWTvnO8LxjAcvA-2-7_CHGfF6@mail.gmail.com> (raw)
In-Reply-To: <m37hnffow2.fsf@localhost.localdomain>

On Fri, May 7, 2010 at 20:17, Jakub Narebski <jnareb@gmail.com> wrote:
> Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:
>
>> TAP, the the Test Anything Protocol, is a simple text-based interface
>> between testing modules in a test harness. test-lib.sh's output was
>> already very close to being valid TAP. This change brings it all the
>> way there.
>>
>> The advantage of using TAP is that any program that reads the format
>> (a "test harness") can run the tests. The most popular of these is the
>> prove(1) utility that comes with Perl. It can run tests in parallel,
>> display colored output, format the output to console, file, HTML etc.,
>> and much more.
>>
>> On my quad Xeon server running the test suite with `make test` takes
>> 21 minutes. Running it with `prove -j 15 ./t[0-9]*.sh` takes just over
>> 5 minutes.
>>
>> With parallel tests the whole test suite doesn't have to stall because
>> tests like t3404-rebase-interactive.sh take a long time.
>
> I would have thought that it would be better for git test suite to
> enable TAP output with --tap switch.  On the other hand changing
> output to TAP, replacing old format, would be less code to maintain.

That was my thinking as well. TAP is human readable like the old
format, the only difference is that TAP is standardized and can be
read by a wide variety of existing programs. For comparison:

Before the patch:

    $ ./t0005-signals.sh
    *   ok 1: sigchain works
    * passed all 1 test(s)

After:

    $ ./t0005-signals.sh
    ok 1 - sigchain works
    # passed all 1 test(s)
    1..1

Or alternatively:

    $ prove ./t0005-signals.sh
    ./t0005-signals.sh .. ok
    All tests successful.
    Files=1, Tests=1,  0 wallclock secs ( 0.03 usr  0.00 sys +  0.01
cusr  0.02 csys =  0.06 CPU)
    Result: PASS

> I am not sure if testing with 'prove' and TAP output is compatibile
> with all current git test suite options, i.e. --debug, --tee,
> --verbose and --immediate, and with GIT_SKIP_TESTS environmental
> variable.

If you pass things like the --verbose output through prove it'll
work. This is because TAP specifies that any unknown output can be
ignored (i.e. lines that don't match /^(?:not)? ok/).

> Also valuable way of checking where the error occurs in the test,
> namely 'sh -x ./tXXXX-test.sh' would not work, I think, with
> 'prove'.

This doesn't break any method of currently running tests (e.g. running
them manually). You don't *have* to run prove, you just can if you
want to.

> Note also that having Perl (and 'prove') installed is not requirement
> for git runnig, and I think it should not be requirement for git
> development.

It should not be. Using fancy TAP formatting tools (whether it's prove
or something else) is purely optional.

> P.S. I think that such series would be better with the cover letter.

I'll make sure to submit one in the future if I send a large patch
series again, sorry.

      reply	other threads:[~2010-05-07 20:49 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-07 19:37 [PATCH 1/6] Make test-lib.sh emit valid TAP format Ævar Arnfjörð Bjarmason
2010-05-07 19:37 ` [PATCH 2/6] Move t6000lib.sh to lib-* Ævar Arnfjörð Bjarmason
2010-05-07 20:21   ` Jakub Narebski
2010-05-07 19:37 ` [PATCH 3/6] Skip tests in a way that makes sense under TAP Ævar Arnfjörð Bjarmason
2010-05-07 19:37 ` [PATCH 4/6] Turn setup code in t2007-checkout-symlink.sh into a test Ævar Arnfjörð Bjarmason
2010-05-07 20:23   ` Jakub Narebski
2010-05-07 19:37 ` [PATCH 5/6] We use TAP so the Perl test can run without scaffolding Ævar Arnfjörð Bjarmason
2010-05-07 19:37 ` [PATCH 6/6] Add test_harness make target for testing with prove(1) Ævar Arnfjörð Bjarmason
2010-05-07 20:20   ` Jakub Narebski
2010-05-08  3:58     ` Junio C Hamano
2010-05-09 11:04   ` Tor Arntsen
2010-05-07 19:50 ` [PATCH 1/6] Make test-lib.sh emit valid TAP format Sverre Rabbelier
2010-05-07 20:25   ` Ævar Arnfjörð Bjarmason
2010-05-07 20:59     ` [PATCH 1/6 v2] " Ævar Arnfjörð Bjarmason
2010-05-15 19:37       ` Ævar Arnfjörð Bjarmason
2010-05-07 20:17 ` [PATCH 1/6] " Jakub Narebski
2010-05-07 20:49   ` Ævar Arnfjörð Bjarmason [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=AANLkTimvWnaoZs7k-fxCWTvnO8LxjAcvA-2-7_CHGfF6@mail.gmail.com \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jnareb@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).