git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Michael J Gruber <git@drmicha.warpmail.net>,
	git@vger.kernel.org, tboegi@web.de
Subject: Re: [PATCH 0/5] test-lib: filesystem prerequisites
Date: Thu, 26 Jul 2012 14:43:37 -0400	[thread overview]
Message-ID: <20120726184337.GB16037@sigill.intra.peff.net> (raw)
In-Reply-To: <7vtxwu75gy.fsf@alter.siamese.dyndns.org>

On Thu, Jul 26, 2012 at 11:16:45AM -0700, Junio C Hamano wrote:

> Consolidating the logic to set necessary prerequisites used in
> various scripts is very good, but I am not sure adding them to
> test-lib and run them unconditionally is a good idea.  SYMLINKS is
> used by 47 among 595 tests, which is common enough, but the new ones
> are not common enough.  I do not think we want to create a temporary
> "junk" dir, two temporary "camelcase" files, read and compare them,
> when nobody in the script cares.
> 
> We do not have to split them into separate include files, though, in
> order to avoid such waste.  Instead, you can make the logic to set
> prerequisite conditional inside test-lib.sh and update the users.
> 
> Something like:
> [...]
> 	(at the beginning of t/t0003-attributes.sh)
> 	#!/bin/sh
>         test_description=gitattributes
>         TEST_WANT_PREREQ=CASE_INSENSITIVE_FS,SYMLINKS
> 	. ./test-lib.sh

That looks like a maintenance annoyance. Can't we just have the
prerequisite-checker lazily perform the test on demand and cache the
result?  It should be OK as long as:

  1. The prereq is careful about its pre- and post- conditions. We
     already make sure to clean up after those tests so as not to taint
     later tests. We would probably want to also make them more careful
     about preconditions like which directory they are in (so, for
     example, refer to "$TRASH_DIRECTORY/junk" and not "junk").

  2. The prereq test does not accidentally munge any existing test
     state from previous tests. That should not be a big deal as long as
     we avoid names like "junk" in favor of more unique names like
     "check-case-sensitivity-prereq".

-Peff

  reply	other threads:[~2012-07-26 18:43 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-14 17:52 [PATCH] t3910: give reason for skipping the test Michael J Gruber
2012-07-14 18:19 ` Torsten Bögershausen
2012-07-26 13:39   ` [PATCH 0/5] test-lib: filesystem prerequisites Michael J Gruber
2012-07-26 13:39     ` [PATCH 1/5] test-lib: provide case insensitivity as a prerequisite Michael J Gruber
2012-07-26 13:39     ` [PATCH 2/5] t0050: use the CASE_INSENSITIVE_FS test prereq Michael J Gruber
2012-07-26 13:39     ` [PATCH 3/5] t0050: use the SYMLINKS " Michael J Gruber
2012-07-26 13:39     ` [PATCH 4/5] test-lib: provide UTF8 behaviour as a prerequisite Michael J Gruber
2012-07-26 13:39     ` [PATCH 5/5] t3910: use the SYMLINKS test prereq Michael J Gruber
2012-07-26 18:16     ` [PATCH 0/5] test-lib: filesystem prerequisites Junio C Hamano
2012-07-26 18:43       ` Jeff King [this message]
2012-07-26 20:10         ` Junio C Hamano
2012-07-27  9:31           ` Michael J Gruber
2012-07-27 17:29             ` Junio C Hamano
2012-07-30  9:56               ` Michael J Gruber
2012-07-30  9:57               ` [PATCHv2 5/5] t3910: use the UTF8_NFD_TO_NFC test prereq Michael J Gruber
2012-07-30 15:29                 ` Junio C Hamano
2012-08-04  5:37                 ` Torsten Bögershausen
2012-08-04 22:04                   ` Junio C Hamano
2012-08-06 12:44                     ` Michael J Gruber

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=20120726184337.GB16037@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=tboegi@web.de \
    /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).