git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Todd Zullinger <tmz@pobox.com>
Cc: Brandon Williams <bmwill@google.com>,
	git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH] http: fix v1 protocol tests with apache httpd < 2.4
Date: Wed, 3 Jan 2018 01:17:04 -0500	[thread overview]
Message-ID: <20180103061703.GB25752@sigill.intra.peff.net> (raw)
In-Reply-To: <20180103003946.GC12108@zaya.teonanacatl.net>

On Tue, Jan 02, 2018 at 07:39:46PM -0500, Todd Zullinger wrote:

> Brandon Williams wrote:
> > Seems good to me.  I think I was just being overly cautious when i was
> > implementing those patches.  Thanks!
> 
> Cool, thanks for taking a look.
> 
> In this case, the test isn't dependent on apache > 2.4, but
> before I checked that I wondered if we had any way to run a
> test only if the apache version was greater or lesser than
> some release.  Luckily, I didn't have to work out such a
> method. :)
> 
> I don't know if there's a clean way to do that
> automatically, short of parsing the output of 'httpd -v'
> should we ever need to add such a prereq.

In the general case, we could probably define an endpoint within an <If>
block, and then try to access the endpoint from the test script.

E.g., something like:

    <IfVersion >= 2.4>
    Alias /have-2.4.txt www/yes.txt
    </IfVersion>

in the apache config, and then:

  test_lazy_prereq APACHE24 '
        echo yes >"$HTTPD_DOCUMENT_ROOT_PATH/yes.txt" &&
        curl -f "$HTTPD_URL/have-2.4.txt"
  '

in the test script (of course we may not want to depend on having
command-line curl, but we could replace that with "git ls-remote" or
similar).

One nice thing about that approach is that it can be extended to other
"If" blocks, like if we have a particular module available, or if ssl is
configured.

-Peff

  reply	other threads:[~2018-01-03  6:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-31  2:32 [PATCH] http: fix v1 protocol tests with apache httpd < 2.4 Todd Zullinger
2018-01-03  0:21 ` Brandon Williams
2018-01-03  0:39   ` Todd Zullinger
2018-01-03  6:17     ` Jeff King [this message]
2018-01-03 16:21       ` Todd Zullinger
2018-01-03  5:56 ` Jeff King

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=20180103061703.GB25752@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=bmwill@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=tmz@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.
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).