From: Jeff King <peff@peff.net>
To: Thomas Rast <trast@student.ethz.ch>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH] test-lib: save test counts across invocations
Date: Thu, 1 Sep 2011 12:38:46 -0400 [thread overview]
Message-ID: <20110901163846.GD15018@sigill.intra.peff.net> (raw)
In-Reply-To: <8fe5381a6b69079b8c20452fd4d99a128764dd52.1314882443.git.trast@student.ethz.ch>
On Thu, Sep 01, 2011 at 03:08:45PM +0200, Thomas Rast wrote:
> Save the number of tests run ($test_count) in a file under
> test-counts/. Then when sourcing test-lib.sh the next time, compare
> the timestamps. If the counts file is older than the test, discard.
> Otherwise use the count that we saved and give prove the test plan
> ("1..N") up front.
Hmm. What happens when we're wrong? Does our eye-candy just print
something non-sensical like "13/12", or does prove actually care that we
run the right number of tests?
> Sparked by a discussion on G+. I think this is the "simple" approach.
> The "cute" approach would be to let test-lib.sh define test_* as
> test-counting dummies once, source the test script itself (avoiding
> the sourcing loop with test-lib) to count what it does, then do the
> real work.
I don't think the "cute" approach will ever be accurate. Deciding
whether to run later tests sometimes depends on the results of earlier
tests, in at least two cases:
1. Some tests find out which capabilities the system has, and set
prerequisites. You need to actually run those tests, not make them
counting dummies.
2. Some tests create state that we then iterate on. For example, I
think the mailinfo tests do something like:
test_expect_success 'split' '
git mailsplit -o patches mbox
'
for i in patches/*; do
test_expect_success "check patch $i" '
git mailinfo $i >output
...
'
done
You'd get an inaccurate count if you didn't actually run the
mailsplit command.
Anyway, this whole thing is a cute idea, and I do love eye candy, but I
wonder if it's worth the complexity. All this is telling us is how far
into each of the scripts it is. But we have literally hundreds of test
scripts, all with varying numbers of tests of varying speeds, and you're
probably running 16 or more at one time. So it doesn't tell you what you
really want to know, which is: how soon will the test suite probably be
done running.
-Peff
next prev parent reply other threads:[~2011-09-01 16:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-01 13:08 [PATCH] test-lib: save test counts across invocations Thomas Rast
2011-09-01 16:14 ` Junio C Hamano
2011-09-01 16:38 ` Jeff King [this message]
2011-09-01 18:38 ` Alex Vandiver
2011-09-01 18:45 ` Jeff King
2011-09-02 12:39 ` Thomas Rast
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=20110901163846.GD15018@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=trast@student.ethz.ch \
/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;
as well as URLs for NNTP newsgroup(s).